From 74351c240380c456b5d46c3d5010778c8b2271f4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 21 Jul 2021 00:02:19 +0000 Subject: [PATCH 1/3] build: switch to release-please release tagging (#1129) (#256) Requires https://github.com/googleapis/releasetool/pull/338 Source-Link: https://github.com/googleapis/synthtool/commit/1563597d28eca099d6411bbc29ecd09314a80746 Post-Processor: gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:06c970a44680229c1e8cefa701dbc93b80468ec4a34e6968475084e4ec1e2d7d --- .github/.OwlBot.lock.yaml | 2 +- .github/release-please.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 9d507ee..b143442 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-nodejs:latest - digest: sha256:41d5457ff79c3945782ab7e23bf4d617fd7bf3f2b03b6d84808010f7d2e10ca2 + digest: sha256:06c970a44680229c1e8cefa701dbc93b80468ec4a34e6968475084e4ec1e2d7d diff --git a/.github/release-please.yml b/.github/release-please.yml index 85344b9..a1b41da 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1 +1,2 @@ +handleGHRelease: true releaseType: node From a7ff3962a2ec495d152343314110ef0466bdb061 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 21 Jul 2021 00:18:12 +0000 Subject: [PATCH 2/3] chore: release 2.2.7 (#252) :robot: I have created a release \*beep\* \*boop\* --- ### [2.2.7](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.2.6...v2.2.7) (2021-07-21) ### Bug Fixes * Updating WORKSPACE files to use the newest version of the Typescript generator. ([#251](https://www.github.com/googleapis/nodejs-cloudbuild/issues/251)) ([7bc5f7f](https://www.github.com/googleapis/nodejs-cloudbuild/commit/7bc5f7ff6c1485baaf1444a608d8ebb88ad20cfe)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- CHANGELOG.md | 7 +++++++ package.json | 2 +- samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 363c8ae..e826dbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [2.2.7](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.2.6...v2.2.7) (2021-07-21) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#251](https://www.github.com/googleapis/nodejs-cloudbuild/issues/251)) ([7bc5f7f](https://www.github.com/googleapis/nodejs-cloudbuild/commit/7bc5f7ff6c1485baaf1444a608d8ebb88ad20cfe)) + ### [2.2.6](https://www.github.com/googleapis/nodejs-cloudbuild/compare/v2.2.5...v2.2.6) (2021-07-12) diff --git a/package.json b/package.json index 9546f28..9055a33 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "repository": "googleapis/nodejs-cloudbuild", "name": "@google-cloud/cloudbuild", - "version": "2.2.6", + "version": "2.2.7", "author": "Google LLC", "description": "Cloud Build API client for Node.js", "main": "build/src/index.js", diff --git a/samples/package.json b/samples/package.json index 13f3981..3491580 100644 --- a/samples/package.json +++ b/samples/package.json @@ -15,7 +15,7 @@ "test": "c8 mocha system-test --timeout=800000" }, "dependencies": { - "@google-cloud/cloudbuild": "^2.2.6" + "@google-cloud/cloudbuild": "^2.2.7" }, "devDependencies": { "c8": "^7.0.0", From 2e5b3f540d9cd2b3a616c4581b07ebcfc444e7c7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 21 Jul 2021 09:18:14 -0700 Subject: [PATCH 3/3] feat: add a WorkerPools API (#254) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add a WorkerPools API BREAKING CHANGE: Proto had a prior definitions of WorkerPool resources which were never supported. This change replaces those resources with definitions that are currently supported. Committer: @mwiczer PiperOrigin-RevId: 385610622 Source-Link: https://github.com/googleapis/googleapis/commit/7a1fb837d3aab1e66562e177b1731280f641dd2a Source-Link: https://github.com/googleapis/googleapis-gen/commit/07289aaf2241f2a254f0a8d95885267e2649c220 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: kelsk <38271546+kelsk@users.noreply.github.com> --- .../devtools/cloudbuild/v1/cloudbuild.proto | 465 ++- protos/protos.d.ts | 921 ++++- protos/protos.js | 3204 ++++++++++++----- protos/protos.json | 426 ++- src/v1/cloud_build_client.ts | 1146 ++++-- src/v1/gapic_metadata.json | 72 +- test/gapic_cloud_build_v1.ts | 1475 ++++++-- 7 files changed, 5563 insertions(+), 2146 deletions(-) diff --git a/protos/google/devtools/cloudbuild/v1/cloudbuild.proto b/protos/google/devtools/cloudbuild/v1/cloudbuild.proto index 5262e24..3b51e3f 100644 --- a/protos/google/devtools/cloudbuild/v1/cloudbuild.proto +++ b/protos/google/devtools/cloudbuild/v1/cloudbuild.proto @@ -279,32 +279,63 @@ service CloudBuild { }; } - // Creates a `WorkerPool` to run the builds, and returns the new worker pool. - // - // This API is experimental. - rpc CreateWorkerPool(CreateWorkerPoolRequest) returns (WorkerPool) {} + // Creates a `WorkerPool`. + rpc CreateWorkerPool(CreateWorkerPoolRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/workerPools" + body: "worker_pool" + }; + option (google.api.method_signature) = "parent,worker_pool,worker_pool_id"; + option (google.longrunning.operation_info) = { + response_type: "WorkerPool" + metadata_type: "CreateWorkerPoolOperationMetadata" + }; + } - // Returns information about a `WorkerPool`. - // - // This API is experimental. - rpc GetWorkerPool(GetWorkerPoolRequest) returns (WorkerPool) {} + // Returns details of a `WorkerPool`. + rpc GetWorkerPool(GetWorkerPoolRequest) returns (WorkerPool) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/workerPools/*}" + }; + option (google.api.method_signature) = "name"; + } - // Deletes a `WorkerPool` by its project ID and WorkerPool name. - // - // This API is experimental. + // Deletes a `WorkerPool`. rpc DeleteWorkerPool(DeleteWorkerPoolRequest) - returns (google.protobuf.Empty) {} + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/workerPools/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteWorkerPoolOperationMetadata" + }; + } - // Update a `WorkerPool`. - // - // This API is experimental. - rpc UpdateWorkerPool(UpdateWorkerPoolRequest) returns (WorkerPool) {} + // Updates a `WorkerPool`. + rpc UpdateWorkerPool(UpdateWorkerPoolRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{worker_pool.name=projects/*/locations/*/workerPools/*}" + body: "worker_pool" + }; + option (google.api.method_signature) = "worker_pool,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "WorkerPool" + metadata_type: "UpdateWorkerPoolOperationMetadata" + }; + } - // List project's `WorkerPools`. - // - // This API is experimental. + // Lists `WorkerPool`s. rpc ListWorkerPools(ListWorkerPoolsRequest) - returns (ListWorkerPoolsResponse) {} + returns (ListWorkerPoolsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/workerPools" + }; + option (google.api.method_signature) = "parent"; + } } // Specifies a build to retry. @@ -1440,6 +1471,22 @@ message UpdateBuildTriggerRequest { // Optional arguments to enable specific features of builds. message BuildOptions { + // Details about how a build should be executed on a `WorkerPool`. + // + // See [running builds in a private + // pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) + // for more information. + message PoolOption { + // The `WorkerPool` resource to execute the build on. + // You must have `cloudbuild.workerpools.use` on the project hosting the + // WorkerPool. + // + // Format projects/{project}/locations/{location}/workerPools/{workerPoolId} + string name = 1 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + }]; + } + // Specifies the manner in which the build should be verified, if at all. enum VerifyOption { // Not a verifiable build. (default) @@ -1551,11 +1598,15 @@ message BuildOptions { // Storage. LogStreamingOption log_streaming_option = 5; - // Option to specify a `WorkerPool` for the build. - // Format: projects/{project}/locations/{location}/workerPools/{workerPool} + // This field deprecated; please use `pool.name` instead. + string worker_pool = 7 [deprecated = true]; + + // Optional. Specification for execution on a `WorkerPool`. // - // This field is in beta and is available only to restricted users. - string worker_pool = 7; + // See [running builds in a private + // pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) + // for more information. + PoolOption pool = 19 [(google.api.field_behavior) = OPTIONAL]; // Option to specify the logging mode, which determines if and where build // logs are stored. @@ -1611,36 +1662,32 @@ message ReceiveTriggerWebhookRequest { // ReceiveTriggerWebhook method. message ReceiveTriggerWebhookResponse {} -// Configuration for a WorkerPool to run the builds. +// Configuration for a `WorkerPool`. +// +// Cloud Build owns and maintains a pool of workers for general use and have no +// access to a project's private network. By default, builds submitted to +// Cloud Build will use a worker from this pool. // -// Workers are machines that Cloud Build uses to run your builds. By default, -// all workers run in a project owned by Cloud Build. To have full control over -// the workers that execute your builds -- such as enabling them to access -// private resources on your private network -- you can request Cloud Build to -// run the workers in your own project by creating a custom workers pool. +// If your build needs access to resources on a private network, +// create and use a `WorkerPool` to run your builds. Private `WorkerPool`s give +// your builds access to any single VPC network that you +// administer, including any on-prem resources connected to that VPC +// network. For an overview of private pools, see +// [Private pools +// overview](https://cloud.google.com/build/docs/private-pools/private-pools-overview). message WorkerPool { - // Supported GCP regions to create the `WorkerPool`. - enum Region { - // no region - REGION_UNSPECIFIED = 0; - - // us-central1 region - US_CENTRAL1 = 1; - - // us-west1 region - US_WEST1 = 2; - - // us-east1 region - US_EAST1 = 3; - - // us-east4 region - US_EAST4 = 4; - } + option (google.api.resource) = { + type: "cloudbuild.googleapis.com/WorkerPool" + pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}" + plural: "workerPools" + singular: "workerPool" + style: DECLARATIVE_FRIENDLY + }; - // `WorkerPool` status - enum Status { - // Status of the `WorkerPool` is unknown. - STATUS_UNSPECIFIED = 0; + // State of the `WorkerPool`. + enum State { + // State of the `WorkerPool` is unknown. + STATE_UNSPECIFIED = 0; // `WorkerPool` is being created. CREATING = 1; @@ -1655,139 +1702,273 @@ message WorkerPool { DELETED = 4; } - // User-defined name of the `WorkerPool`. - string name = 14; - - // The project ID of the GCP project for which the `WorkerPool` is created. - string project_id = 2; - - // Output only. The service account used to manage the `WorkerPool`. The - // service account must have the Compute Instance Admin (Beta) permission at - // the project level. - string service_account_email = 3; + // Output only. The resource name of the `WorkerPool`, with format + // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. + // The value of `{worker_pool}` is provided by `worker_pool_id` in + // `CreateWorkerPool` request and the value of `{location}` is determined by + // the endpoint accessed. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Total number of workers to be created across all requested regions. - int64 worker_count = 4; + // A user-specified, human-readable name for the `WorkerPool`. If provided, + // this value must be 1-63 characters. + string display_name = 2; - // Configuration to be used for a creating workers in the `WorkerPool`. - WorkerConfig worker_config = 16; + // Output only. A unique identifier for the `WorkerPool`. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - // List of regions to create the `WorkerPool`. Regions can't be empty. - // If Cloud Build adds a new GCP region in the future, the existing - // `WorkerPool` will not be enabled in the new region automatically; - // you must add the new region to the `regions` field to enable the - // `WorkerPool` in that region. - repeated Region regions = 9; + // User specified annotations. See https://google.aip.dev/128#annotations + // for more details such as format and size limitations. + map annotations = 4; // Output only. Time at which the request to create the `WorkerPool` was // received. - google.protobuf.Timestamp create_time = 11; + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Time at which the request to update the `WorkerPool` was // received. - google.protobuf.Timestamp update_time = 17; + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Time at which the request to delete the `WorkerPool` was // received. - google.protobuf.Timestamp delete_time = 12; + google.protobuf.Timestamp delete_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. WorkerPool Status. - Status status = 13; -} + // Output only. `WorkerPool` state. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Private Pool configuration for the `WorkerPool`. + oneof config { + // Private Pool using a v1 configuration. + PrivatePoolV1Config private_pool_v1_config = 12; + } -// WorkerConfig defines the configuration to be used for a creating workers in -// the pool. -message WorkerConfig { - // Machine Type of the worker, such as n1-standard-1. - // See https://cloud.google.com/compute/docs/machine-types. - // If left blank, Cloud Build will use a standard unspecified machine to - // create the worker pool. - // `machine_type` is overridden if you specify a different machine type in - // `build_options`. In this case, the VM specified in the `build_options` - // will be created on demand at build time. For more information see - // https://cloud.google.com/cloud-build/docs/speeding-up-builds#using_custom_virtual_machine_sizes - string machine_type = 1; - - // Size of the disk attached to the worker, in GB. - // See https://cloud.google.com/compute/docs/disks/ - // If `0` is specified, Cloud Build will use a standard disk size. - // `disk_size` is overridden if you specify a different disk size in - // `build_options`. In this case, a VM with a disk size specified in the - // `build_options` will be created on demand at build time. For more - // information see - // https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#buildoptions - int64 disk_size_gb = 2; - - // The network definition used to create the worker. - // If this section is left empty, the workers will be created in - // WorkerPool.project_id on the default network. - Network network = 3; - - // The tag applied to the worker, and the same tag used by the firewall rule. - // It is used to identify the Cloud Build workers among other VMs. - // The default value for tag is `worker`. - string tag = 4; + // Output only. Checksum computed by the server. May be sent on update and + // delete requests to ensure that the client has an up-to-date value before + // proceeding. + string etag = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; } -// Network describes the GCP network used to create workers in. -message Network { - // Project id containing the defined network and subnetwork. For a peered VPC, - // this will be the same as the project_id in which the workers are created. - // For a shared VPC, this will be the project sharing the network with the - // project_id project in which workers will be created. For custom workers - // with no VPC, this will be the same as project_id. - string project_id = 1; +// Configuration for a V1 `PrivatePool`. +message PrivatePoolV1Config { + // Defines the configuration to be used for creating workers in + // the pool. + message WorkerConfig { + // Machine type of a worker, such as `e2-medium`. + // See [Worker pool config + // file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). + // If left blank, Cloud Build will use a sensible default. + string machine_type = 1; + + // Size of the disk attached to the worker, in GB. + // See [Worker pool config + // file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). + // Specify a value of up to 1000. If `0` is specified, Cloud Build will use + // a standard disk size. + int64 disk_size_gb = 2; + } + + // Defines the network configuration for the pool. + message NetworkConfig { + // Defines the egress option for the pool. + enum EgressOption { + // If set, defaults to PUBLIC_EGRESS. + EGRESS_OPTION_UNSPECIFIED = 0; - // Network on which the workers are created. - // "default" network is used if empty. - string network = 2; + // If set, workers are created without any public address, which prevents + // network egress to public IPs unless a network proxy is configured. + NO_PUBLIC_EGRESS = 1; - // Subnetwork on which the workers are created. - // "default" subnetwork is used if empty. - string subnetwork = 3; + // If set, workers are created with a public address which allows for + // public internet egress. + PUBLIC_EGRESS = 2; + } + + // Required. Immutable. The network definition that the workers are peered + // to. If this section is left empty, the workers will be peered to + // `WorkerPool.project_id` on the service producer network. Must be in the + // format `projects/{project}/global/networks/{network}`, where `{project}` + // is a project number, such as `12345`, and `{network}` is the name of a + // VPC network in the project. See + // [Understanding network configuration + // options](https://cloud.google.com/build/docs/private-pools/set-up-private-pool-environment) + string peered_network = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + } + ]; + + // Option to configure network egress for the workers. + EgressOption egress_option = 2; + } + + // Machine configuration for the workers in the pool. + WorkerConfig worker_config = 1; + + // Network configuration for the pool. + NetworkConfig network_config = 2; } // Request to create a new `WorkerPool`. message CreateWorkerPoolRequest { - // ID of the parent project. - string parent = 1; + // Required. The parent resource where this worker pool will be created. + // Format: `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; - // `WorkerPool` resource to create. - WorkerPool worker_pool = 2; + // Required. `WorkerPool` resource to create. + WorkerPool worker_pool = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Immutable. The ID to use for the `WorkerPool`, which will become + // the final component of the resource name. + // + // This value should be 1-63 characters, and valid characters + // are /[a-z][0-9]-/. + string worker_pool_id = 3 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // If set, validate the request and preview the response, but do not actually + // post it. + bool validate_only = 4; } // Request to get a `WorkerPool` with the specified name. message GetWorkerPoolRequest { - // The field will contain name of the resource requested, for example: - // "projects/project-1/workerPools/workerpool-name" - string name = 1; + // Required. The name of the `WorkerPool` to retrieve. + // Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + } + ]; } // Request to delete a `WorkerPool`. message DeleteWorkerPoolRequest { - // The field will contain name of the resource requested, for example: - // "projects/project-1/workerPools/workerpool-name" - string name = 1; + // Required. The name of the `WorkerPool` to delete. + // Format: + // `projects/{project}/locations/{workerPool}/workerPools/{workerPool}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + } + ]; + + // Optional. If this is provided, it must match the server's etag on the + // workerpool for the request to be processed. + string etag = 2; + + // If set to true, and the `WorkerPool` is not found, the request will succeed + // but no action will be taken on the server. + bool allow_missing = 3; + + // If set, validate the request and preview the response, but do not actually + // post it. + bool validate_only = 4; } // Request to update a `WorkerPool`. message UpdateWorkerPoolRequest { - // The field will contain name of the resource requested, for example: - // "projects/project-1/workerPools/workerpool-name" - string name = 2; + // Required. The `WorkerPool` to update. + // + // The `name` field is used to identify the `WorkerPool` to update. + // Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. + WorkerPool worker_pool = 1 [(google.api.field_behavior) = REQUIRED]; - // `WorkerPool` resource to update. - WorkerPool worker_pool = 3; + // A mask specifying which fields in `worker_pool` to update. + google.protobuf.FieldMask update_mask = 2; + + // If set, validate the request and preview the response, but do not actually + // post it. + bool validate_only = 4; } -// Request to list `WorkerPools`. +// Request to list `WorkerPool`s. message ListWorkerPoolsRequest { - // ID of the parent project. - string parent = 1; + // Required. The parent of the collection of `WorkerPools`. + // Format: `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of `WorkerPool`s to return. The service may return + // fewer than this value. If omitted, the server will use a sensible default. + int32 page_size = 2; + + // A page token, received from a previous `ListWorkerPools` call. Provide this + // to retrieve the subsequent page. + string page_token = 3; } // Response containing existing `WorkerPools`. message ListWorkerPoolsResponse { - // `WorkerPools` for the project. + // `WorkerPools` for the specified project. repeated WorkerPool worker_pools = 1; + + // Continuation token used to page through large result sets. Provide this + // value in a subsequent ListWorkerPoolsRequest to return the next page of + // results. + string next_page_token = 2; +} + +// Metadata for the `CreateWorkerPool` operation. +message CreateWorkerPoolOperationMetadata { + // The resource name of the `WorkerPool` to create. + // Format: + // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. + string worker_pool = 1 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + }]; + + // Time the operation was created. + google.protobuf.Timestamp create_time = 2; + + // Time the operation was completed. + google.protobuf.Timestamp complete_time = 3; +} + +// Metadata for the `UpdateWorkerPool` operation. +message UpdateWorkerPoolOperationMetadata { + // The resource name of the `WorkerPool` being updated. + // Format: + // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. + string worker_pool = 1 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + }]; + + // Time the operation was created. + google.protobuf.Timestamp create_time = 2; + + // Time the operation was completed. + google.protobuf.Timestamp complete_time = 3; +} + +// Metadata for the `DeleteWorkerPool` operation. +message DeleteWorkerPoolOperationMetadata { + // The resource name of the `WorkerPool` being deleted. + // Format: + // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. + string worker_pool = 1 [(google.api.resource_reference) = { + type: "cloudbuild.googleapis.com/WorkerPool" + }]; + + // Time the operation was created. + google.protobuf.Timestamp create_time = 2; + + // Time the operation was completed. + google.protobuf.Timestamp complete_time = 3; } diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 347b724..8cf3951 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -217,7 +217,7 @@ export namespace google { /** * Calls CreateWorkerPool. * @param request CreateWorkerPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and WorkerPool + * @param callback Node-style callback called with the error, if any, and Operation */ public createWorkerPool(request: google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.CreateWorkerPoolCallback): void; @@ -226,7 +226,7 @@ export namespace google { * @param request CreateWorkerPoolRequest message or plain object * @returns Promise */ - public createWorkerPool(request: google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest): Promise; + public createWorkerPool(request: google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest): Promise; /** * Calls GetWorkerPool. @@ -245,7 +245,7 @@ export namespace google { /** * Calls DeleteWorkerPool. * @param request DeleteWorkerPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * @param callback Node-style callback called with the error, if any, and Operation */ public deleteWorkerPool(request: google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.DeleteWorkerPoolCallback): void; @@ -254,12 +254,12 @@ export namespace google { * @param request DeleteWorkerPoolRequest message or plain object * @returns Promise */ - public deleteWorkerPool(request: google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest): Promise; + public deleteWorkerPool(request: google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest): Promise; /** * Calls UpdateWorkerPool. * @param request UpdateWorkerPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and WorkerPool + * @param callback Node-style callback called with the error, if any, and Operation */ public updateWorkerPool(request: google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest, callback: google.devtools.cloudbuild.v1.CloudBuild.UpdateWorkerPoolCallback): void; @@ -268,7 +268,7 @@ export namespace google { * @param request UpdateWorkerPoolRequest message or plain object * @returns Promise */ - public updateWorkerPool(request: google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest): Promise; + public updateWorkerPool(request: google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest): Promise; /** * Calls ListWorkerPools. @@ -374,9 +374,9 @@ export namespace google { /** * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild#createWorkerPool}. * @param error Error, if any - * @param [response] WorkerPool + * @param [response] Operation */ - type CreateWorkerPoolCallback = (error: (Error|null), response?: google.devtools.cloudbuild.v1.WorkerPool) => void; + type CreateWorkerPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild#getWorkerPool}. @@ -388,16 +388,16 @@ export namespace google { /** * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild#deleteWorkerPool}. * @param error Error, if any - * @param [response] Empty + * @param [response] Operation */ - type DeleteWorkerPoolCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + type DeleteWorkerPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild#updateWorkerPool}. * @param error Error, if any - * @param [response] WorkerPool + * @param [response] Operation */ - type UpdateWorkerPoolCallback = (error: (Error|null), response?: google.devtools.cloudbuild.v1.WorkerPool) => void; + type UpdateWorkerPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** * Callback as used by {@link google.devtools.cloudbuild.v1.CloudBuild#listWorkerPools}. @@ -4997,6 +4997,9 @@ export namespace google { /** BuildOptions workerPool */ workerPool?: (string|null); + /** BuildOptions pool */ + pool?: (google.devtools.cloudbuild.v1.BuildOptions.IPoolOption|null); + /** BuildOptions logging */ logging?: (google.devtools.cloudbuild.v1.BuildOptions.LoggingMode|keyof typeof google.devtools.cloudbuild.v1.BuildOptions.LoggingMode|null); @@ -5043,6 +5046,9 @@ export namespace google { /** BuildOptions workerPool. */ public workerPool: string; + /** BuildOptions pool. */ + public pool?: (google.devtools.cloudbuild.v1.BuildOptions.IPoolOption|null); + /** BuildOptions logging. */ public logging: (google.devtools.cloudbuild.v1.BuildOptions.LoggingMode|keyof typeof google.devtools.cloudbuild.v1.BuildOptions.LoggingMode); @@ -5128,6 +5134,96 @@ export namespace google { namespace BuildOptions { + /** Properties of a PoolOption. */ + interface IPoolOption { + + /** PoolOption name */ + name?: (string|null); + } + + /** Represents a PoolOption. */ + class PoolOption implements IPoolOption { + + /** + * Constructs a new PoolOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.BuildOptions.IPoolOption); + + /** PoolOption name. */ + public name: string; + + /** + * Creates a new PoolOption instance using the specified properties. + * @param [properties] Properties to set + * @returns PoolOption instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.BuildOptions.IPoolOption): google.devtools.cloudbuild.v1.BuildOptions.PoolOption; + + /** + * Encodes the specified PoolOption message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOptions.PoolOption.verify|verify} messages. + * @param message PoolOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.BuildOptions.IPoolOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PoolOption message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOptions.PoolOption.verify|verify} messages. + * @param message PoolOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.BuildOptions.IPoolOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PoolOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PoolOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.BuildOptions.PoolOption; + + /** + * Decodes a PoolOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PoolOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.BuildOptions.PoolOption; + + /** + * Verifies a PoolOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PoolOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PoolOption + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.BuildOptions.PoolOption; + + /** + * Creates a plain object from a PoolOption message. Also converts values to other types if specified. + * @param message PoolOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.BuildOptions.PoolOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PoolOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** VerifyOption enum. */ enum VerifyOption { NOT_VERIFIED = 0, @@ -5371,20 +5467,14 @@ export namespace google { /** WorkerPool name */ name?: (string|null); - /** WorkerPool projectId */ - projectId?: (string|null); - - /** WorkerPool serviceAccountEmail */ - serviceAccountEmail?: (string|null); - - /** WorkerPool workerCount */ - workerCount?: (number|Long|string|null); + /** WorkerPool displayName */ + displayName?: (string|null); - /** WorkerPool workerConfig */ - workerConfig?: (google.devtools.cloudbuild.v1.IWorkerConfig|null); + /** WorkerPool uid */ + uid?: (string|null); - /** WorkerPool regions */ - regions?: (google.devtools.cloudbuild.v1.WorkerPool.Region[]|null); + /** WorkerPool annotations */ + annotations?: ({ [k: string]: string }|null); /** WorkerPool createTime */ createTime?: (google.protobuf.ITimestamp|null); @@ -5395,8 +5485,14 @@ export namespace google { /** WorkerPool deleteTime */ deleteTime?: (google.protobuf.ITimestamp|null); - /** WorkerPool status */ - status?: (google.devtools.cloudbuild.v1.WorkerPool.Status|keyof typeof google.devtools.cloudbuild.v1.WorkerPool.Status|null); + /** WorkerPool state */ + state?: (google.devtools.cloudbuild.v1.WorkerPool.State|keyof typeof google.devtools.cloudbuild.v1.WorkerPool.State|null); + + /** WorkerPool privatePoolV1Config */ + privatePoolV1Config?: (google.devtools.cloudbuild.v1.IPrivatePoolV1Config|null); + + /** WorkerPool etag */ + etag?: (string|null); } /** Represents a WorkerPool. */ @@ -5411,20 +5507,14 @@ export namespace google { /** WorkerPool name. */ public name: string; - /** WorkerPool projectId. */ - public projectId: string; - - /** WorkerPool serviceAccountEmail. */ - public serviceAccountEmail: string; - - /** WorkerPool workerCount. */ - public workerCount: (number|Long|string); + /** WorkerPool displayName. */ + public displayName: string; - /** WorkerPool workerConfig. */ - public workerConfig?: (google.devtools.cloudbuild.v1.IWorkerConfig|null); + /** WorkerPool uid. */ + public uid: string; - /** WorkerPool regions. */ - public regions: google.devtools.cloudbuild.v1.WorkerPool.Region[]; + /** WorkerPool annotations. */ + public annotations: { [k: string]: string }; /** WorkerPool createTime. */ public createTime?: (google.protobuf.ITimestamp|null); @@ -5435,8 +5525,17 @@ export namespace google { /** WorkerPool deleteTime. */ public deleteTime?: (google.protobuf.ITimestamp|null); - /** WorkerPool status. */ - public status: (google.devtools.cloudbuild.v1.WorkerPool.Status|keyof typeof google.devtools.cloudbuild.v1.WorkerPool.Status); + /** WorkerPool state. */ + public state: (google.devtools.cloudbuild.v1.WorkerPool.State|keyof typeof google.devtools.cloudbuild.v1.WorkerPool.State); + + /** WorkerPool privatePoolV1Config. */ + public privatePoolV1Config?: (google.devtools.cloudbuild.v1.IPrivatePoolV1Config|null); + + /** WorkerPool etag. */ + public etag: string; + + /** WorkerPool config. */ + public config?: "privatePoolV1Config"; /** * Creates a new WorkerPool instance using the specified properties. @@ -5511,18 +5610,9 @@ export namespace google { namespace WorkerPool { - /** Region enum. */ - enum Region { - REGION_UNSPECIFIED = 0, - US_CENTRAL1 = 1, - US_WEST1 = 2, - US_EAST1 = 3, - US_EAST4 = 4 - } - - /** Status enum. */ - enum Status { - STATUS_UNSPECIFIED = 0, + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, CREATING = 1, RUNNING = 2, DELETING = 3, @@ -5530,214 +5620,305 @@ export namespace google { } } - /** Properties of a WorkerConfig. */ - interface IWorkerConfig { - - /** WorkerConfig machineType */ - machineType?: (string|null); - - /** WorkerConfig diskSizeGb */ - diskSizeGb?: (number|Long|string|null); + /** Properties of a PrivatePoolV1Config. */ + interface IPrivatePoolV1Config { - /** WorkerConfig network */ - network?: (google.devtools.cloudbuild.v1.INetwork|null); + /** PrivatePoolV1Config workerConfig */ + workerConfig?: (google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig|null); - /** WorkerConfig tag */ - tag?: (string|null); + /** PrivatePoolV1Config networkConfig */ + networkConfig?: (google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig|null); } - /** Represents a WorkerConfig. */ - class WorkerConfig implements IWorkerConfig { + /** Represents a PrivatePoolV1Config. */ + class PrivatePoolV1Config implements IPrivatePoolV1Config { /** - * Constructs a new WorkerConfig. + * Constructs a new PrivatePoolV1Config. * @param [properties] Properties to set */ - constructor(properties?: google.devtools.cloudbuild.v1.IWorkerConfig); + constructor(properties?: google.devtools.cloudbuild.v1.IPrivatePoolV1Config); - /** WorkerConfig machineType. */ - public machineType: string; - - /** WorkerConfig diskSizeGb. */ - public diskSizeGb: (number|Long|string); + /** PrivatePoolV1Config workerConfig. */ + public workerConfig?: (google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig|null); - /** WorkerConfig network. */ - public network?: (google.devtools.cloudbuild.v1.INetwork|null); - - /** WorkerConfig tag. */ - public tag: string; + /** PrivatePoolV1Config networkConfig. */ + public networkConfig?: (google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig|null); /** - * Creates a new WorkerConfig instance using the specified properties. + * Creates a new PrivatePoolV1Config instance using the specified properties. * @param [properties] Properties to set - * @returns WorkerConfig instance + * @returns PrivatePoolV1Config instance */ - public static create(properties?: google.devtools.cloudbuild.v1.IWorkerConfig): google.devtools.cloudbuild.v1.WorkerConfig; + public static create(properties?: google.devtools.cloudbuild.v1.IPrivatePoolV1Config): google.devtools.cloudbuild.v1.PrivatePoolV1Config; /** - * Encodes the specified WorkerConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.WorkerConfig.verify|verify} messages. - * @param message WorkerConfig message or plain object to encode + * Encodes the specified PrivatePoolV1Config message. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.verify|verify} messages. + * @param message PrivatePoolV1Config message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.devtools.cloudbuild.v1.IWorkerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.devtools.cloudbuild.v1.IPrivatePoolV1Config, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WorkerConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.WorkerConfig.verify|verify} messages. - * @param message WorkerConfig message or plain object to encode + * Encodes the specified PrivatePoolV1Config message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.verify|verify} messages. + * @param message PrivatePoolV1Config message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.devtools.cloudbuild.v1.IWorkerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IPrivatePoolV1Config, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WorkerConfig message from the specified reader or buffer. + * Decodes a PrivatePoolV1Config message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WorkerConfig + * @returns PrivatePoolV1Config * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.WorkerConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.PrivatePoolV1Config; /** - * Decodes a WorkerConfig message from the specified reader or buffer, length delimited. + * Decodes a PrivatePoolV1Config message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WorkerConfig + * @returns PrivatePoolV1Config * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.WorkerConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.PrivatePoolV1Config; /** - * Verifies a WorkerConfig message. + * Verifies a PrivatePoolV1Config message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WorkerConfig message from a plain object. Also converts values to their respective internal types. + * Creates a PrivatePoolV1Config message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WorkerConfig + * @returns PrivatePoolV1Config */ - public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.WorkerConfig; + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.PrivatePoolV1Config; /** - * Creates a plain object from a WorkerConfig message. Also converts values to other types if specified. - * @param message WorkerConfig + * Creates a plain object from a PrivatePoolV1Config message. Also converts values to other types if specified. + * @param message PrivatePoolV1Config * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.devtools.cloudbuild.v1.WorkerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.devtools.cloudbuild.v1.PrivatePoolV1Config, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WorkerConfig to JSON. + * Converts this PrivatePoolV1Config to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Network. */ - interface INetwork { + namespace PrivatePoolV1Config { - /** Network projectId */ - projectId?: (string|null); + /** Properties of a WorkerConfig. */ + interface IWorkerConfig { - /** Network network */ - network?: (string|null); + /** WorkerConfig machineType */ + machineType?: (string|null); - /** Network subnetwork */ - subnetwork?: (string|null); - } + /** WorkerConfig diskSizeGb */ + diskSizeGb?: (number|Long|string|null); + } - /** Represents a Network. */ - class Network implements INetwork { + /** Represents a WorkerConfig. */ + class WorkerConfig implements IWorkerConfig { - /** - * Constructs a new Network. - * @param [properties] Properties to set - */ - constructor(properties?: google.devtools.cloudbuild.v1.INetwork); + /** + * Constructs a new WorkerConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig); - /** Network projectId. */ - public projectId: string; + /** WorkerConfig machineType. */ + public machineType: string; - /** Network network. */ - public network: string; + /** WorkerConfig diskSizeGb. */ + public diskSizeGb: (number|Long|string); - /** Network subnetwork. */ - public subnetwork: string; + /** + * Creates a new WorkerConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkerConfig instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig): google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig; - /** - * Creates a new Network instance using the specified properties. - * @param [properties] Properties to set - * @returns Network instance - */ - public static create(properties?: google.devtools.cloudbuild.v1.INetwork): google.devtools.cloudbuild.v1.Network; + /** + * Encodes the specified WorkerConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig.verify|verify} messages. + * @param message WorkerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Network message. Does not implicitly {@link google.devtools.cloudbuild.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.devtools.cloudbuild.v1.INetwork, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified WorkerConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig.verify|verify} messages. + * @param message WorkerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Network message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.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.devtools.cloudbuild.v1.INetwork, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a WorkerConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig; - /** - * 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.devtools.cloudbuild.v1.Network; + /** + * Decodes a WorkerConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig; - /** - * 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.devtools.cloudbuild.v1.Network; + /** + * Verifies a WorkerConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * 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 WorkerConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkerConfig + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig; - /** - * 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.devtools.cloudbuild.v1.Network; + /** + * Creates a plain object from a WorkerConfig message. Also converts values to other types if specified. + * @param message WorkerConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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.devtools.cloudbuild.v1.Network, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this WorkerConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this Network to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Properties of a NetworkConfig. */ + interface INetworkConfig { + + /** NetworkConfig peeredNetwork */ + peeredNetwork?: (string|null); + + /** NetworkConfig egressOption */ + egressOption?: (google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption|keyof typeof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption|null); + } + + /** Represents a NetworkConfig. */ + class NetworkConfig implements INetworkConfig { + + /** + * Constructs a new NetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig); + + /** NetworkConfig peeredNetwork. */ + public peeredNetwork: string; + + /** NetworkConfig egressOption. */ + public egressOption: (google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption|keyof typeof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption); + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkConfig instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig): google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig; + + /** + * Verifies a NetworkConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkConfig + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @param message NetworkConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace NetworkConfig { + + /** EgressOption enum. */ + enum EgressOption { + EGRESS_OPTION_UNSPECIFIED = 0, + NO_PUBLIC_EGRESS = 1, + PUBLIC_EGRESS = 2 + } + } } /** Properties of a CreateWorkerPoolRequest. */ @@ -5748,6 +5929,12 @@ export namespace google { /** CreateWorkerPoolRequest workerPool */ workerPool?: (google.devtools.cloudbuild.v1.IWorkerPool|null); + + /** CreateWorkerPoolRequest workerPoolId */ + workerPoolId?: (string|null); + + /** CreateWorkerPoolRequest validateOnly */ + validateOnly?: (boolean|null); } /** Represents a CreateWorkerPoolRequest. */ @@ -5765,6 +5952,12 @@ export namespace google { /** CreateWorkerPoolRequest workerPool. */ public workerPool?: (google.devtools.cloudbuild.v1.IWorkerPool|null); + /** CreateWorkerPoolRequest workerPoolId. */ + public workerPoolId: string; + + /** CreateWorkerPoolRequest validateOnly. */ + public validateOnly: boolean; + /** * Creates a new CreateWorkerPoolRequest instance using the specified properties. * @param [properties] Properties to set @@ -5931,6 +6124,15 @@ export namespace google { /** DeleteWorkerPoolRequest name */ name?: (string|null); + + /** DeleteWorkerPoolRequest etag */ + etag?: (string|null); + + /** DeleteWorkerPoolRequest allowMissing */ + allowMissing?: (boolean|null); + + /** DeleteWorkerPoolRequest validateOnly */ + validateOnly?: (boolean|null); } /** Represents a DeleteWorkerPoolRequest. */ @@ -5945,6 +6147,15 @@ export namespace google { /** DeleteWorkerPoolRequest name. */ public name: string; + /** DeleteWorkerPoolRequest etag. */ + public etag: string; + + /** DeleteWorkerPoolRequest allowMissing. */ + public allowMissing: boolean; + + /** DeleteWorkerPoolRequest validateOnly. */ + public validateOnly: boolean; + /** * Creates a new DeleteWorkerPoolRequest instance using the specified properties. * @param [properties] Properties to set @@ -6019,11 +6230,14 @@ export namespace google { /** Properties of an UpdateWorkerPoolRequest. */ interface IUpdateWorkerPoolRequest { - /** UpdateWorkerPoolRequest name */ - name?: (string|null); - /** UpdateWorkerPoolRequest workerPool */ workerPool?: (google.devtools.cloudbuild.v1.IWorkerPool|null); + + /** UpdateWorkerPoolRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateWorkerPoolRequest validateOnly */ + validateOnly?: (boolean|null); } /** Represents an UpdateWorkerPoolRequest. */ @@ -6035,12 +6249,15 @@ export namespace google { */ constructor(properties?: google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest); - /** UpdateWorkerPoolRequest name. */ - public name: string; - /** UpdateWorkerPoolRequest workerPool. */ public workerPool?: (google.devtools.cloudbuild.v1.IWorkerPool|null); + /** UpdateWorkerPoolRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateWorkerPoolRequest validateOnly. */ + public validateOnly: boolean; + /** * Creates a new UpdateWorkerPoolRequest instance using the specified properties. * @param [properties] Properties to set @@ -6117,6 +6334,12 @@ export namespace google { /** ListWorkerPoolsRequest parent */ parent?: (string|null); + + /** ListWorkerPoolsRequest pageSize */ + pageSize?: (number|null); + + /** ListWorkerPoolsRequest pageToken */ + pageToken?: (string|null); } /** Represents a ListWorkerPoolsRequest. */ @@ -6131,6 +6354,12 @@ export namespace google { /** ListWorkerPoolsRequest parent. */ public parent: string; + /** ListWorkerPoolsRequest pageSize. */ + public pageSize: number; + + /** ListWorkerPoolsRequest pageToken. */ + public pageToken: string; + /** * Creates a new ListWorkerPoolsRequest instance using the specified properties. * @param [properties] Properties to set @@ -6207,6 +6436,9 @@ export namespace google { /** ListWorkerPoolsResponse workerPools */ workerPools?: (google.devtools.cloudbuild.v1.IWorkerPool[]|null); + + /** ListWorkerPoolsResponse nextPageToken */ + nextPageToken?: (string|null); } /** Represents a ListWorkerPoolsResponse. */ @@ -6221,6 +6453,9 @@ export namespace google { /** ListWorkerPoolsResponse workerPools. */ public workerPools: google.devtools.cloudbuild.v1.IWorkerPool[]; + /** ListWorkerPoolsResponse nextPageToken. */ + public nextPageToken: string; + /** * Creates a new ListWorkerPoolsResponse instance using the specified properties. * @param [properties] Properties to set @@ -6291,6 +6526,312 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** Properties of a CreateWorkerPoolOperationMetadata. */ + interface ICreateWorkerPoolOperationMetadata { + + /** CreateWorkerPoolOperationMetadata workerPool */ + workerPool?: (string|null); + + /** CreateWorkerPoolOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CreateWorkerPoolOperationMetadata completeTime */ + completeTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CreateWorkerPoolOperationMetadata. */ + class CreateWorkerPoolOperationMetadata implements ICreateWorkerPoolOperationMetadata { + + /** + * Constructs a new CreateWorkerPoolOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata); + + /** CreateWorkerPoolOperationMetadata workerPool. */ + public workerPool: string; + + /** CreateWorkerPoolOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CreateWorkerPoolOperationMetadata completeTime. */ + public completeTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CreateWorkerPoolOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateWorkerPoolOperationMetadata instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata): google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata; + + /** + * Encodes the specified CreateWorkerPoolOperationMetadata message. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata.verify|verify} messages. + * @param message CreateWorkerPoolOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateWorkerPoolOperationMetadata message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata.verify|verify} messages. + * @param message CreateWorkerPoolOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateWorkerPoolOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateWorkerPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata; + + /** + * Decodes a CreateWorkerPoolOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateWorkerPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata; + + /** + * Verifies a CreateWorkerPoolOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateWorkerPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateWorkerPoolOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata; + + /** + * Creates a plain object from a CreateWorkerPoolOperationMetadata message. Also converts values to other types if specified. + * @param message CreateWorkerPoolOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateWorkerPoolOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateWorkerPoolOperationMetadata. */ + interface IUpdateWorkerPoolOperationMetadata { + + /** UpdateWorkerPoolOperationMetadata workerPool */ + workerPool?: (string|null); + + /** UpdateWorkerPoolOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** UpdateWorkerPoolOperationMetadata completeTime */ + completeTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an UpdateWorkerPoolOperationMetadata. */ + class UpdateWorkerPoolOperationMetadata implements IUpdateWorkerPoolOperationMetadata { + + /** + * Constructs a new UpdateWorkerPoolOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata); + + /** UpdateWorkerPoolOperationMetadata workerPool. */ + public workerPool: string; + + /** UpdateWorkerPoolOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** UpdateWorkerPoolOperationMetadata completeTime. */ + public completeTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new UpdateWorkerPoolOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateWorkerPoolOperationMetadata instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata): google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata; + + /** + * Encodes the specified UpdateWorkerPoolOperationMetadata message. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata.verify|verify} messages. + * @param message UpdateWorkerPoolOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateWorkerPoolOperationMetadata message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata.verify|verify} messages. + * @param message UpdateWorkerPoolOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateWorkerPoolOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateWorkerPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata; + + /** + * Decodes an UpdateWorkerPoolOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateWorkerPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata; + + /** + * Verifies an UpdateWorkerPoolOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateWorkerPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateWorkerPoolOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata; + + /** + * Creates a plain object from an UpdateWorkerPoolOperationMetadata message. Also converts values to other types if specified. + * @param message UpdateWorkerPoolOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateWorkerPoolOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteWorkerPoolOperationMetadata. */ + interface IDeleteWorkerPoolOperationMetadata { + + /** DeleteWorkerPoolOperationMetadata workerPool */ + workerPool?: (string|null); + + /** DeleteWorkerPoolOperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DeleteWorkerPoolOperationMetadata completeTime */ + completeTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a DeleteWorkerPoolOperationMetadata. */ + class DeleteWorkerPoolOperationMetadata implements IDeleteWorkerPoolOperationMetadata { + + /** + * Constructs a new DeleteWorkerPoolOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata); + + /** DeleteWorkerPoolOperationMetadata workerPool. */ + public workerPool: string; + + /** DeleteWorkerPoolOperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DeleteWorkerPoolOperationMetadata completeTime. */ + public completeTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new DeleteWorkerPoolOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteWorkerPoolOperationMetadata instance + */ + public static create(properties?: google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata): google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata; + + /** + * Encodes the specified DeleteWorkerPoolOperationMetadata message. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata.verify|verify} messages. + * @param message DeleteWorkerPoolOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteWorkerPoolOperationMetadata message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata.verify|verify} messages. + * @param message DeleteWorkerPoolOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteWorkerPoolOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteWorkerPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata; + + /** + * Decodes a DeleteWorkerPoolOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteWorkerPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata; + + /** + * Verifies a DeleteWorkerPoolOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteWorkerPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteWorkerPoolOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata; + + /** + * Creates a plain object from a DeleteWorkerPoolOperationMetadata message. Also converts values to other types if specified. + * @param message DeleteWorkerPoolOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteWorkerPoolOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } } } diff --git a/protos/protos.js b/protos/protos.js index 7ed7d92..c8d5932 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -500,7 +500,7 @@ * @typedef CreateWorkerPoolCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.devtools.cloudbuild.v1.WorkerPool} [response] WorkerPool + * @param {google.longrunning.Operation} [response] Operation */ /** @@ -509,12 +509,12 @@ * @memberof google.devtools.cloudbuild.v1.CloudBuild * @instance * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest} request CreateWorkerPoolRequest message or plain object - * @param {google.devtools.cloudbuild.v1.CloudBuild.CreateWorkerPoolCallback} callback Node-style callback called with the error, if any, and WorkerPool + * @param {google.devtools.cloudbuild.v1.CloudBuild.CreateWorkerPoolCallback} callback Node-style callback called with the error, if any, and Operation * @returns {undefined} * @variation 1 */ Object.defineProperty(CloudBuild.prototype.createWorkerPool = function createWorkerPool(request, callback) { - return this.rpcCall(createWorkerPool, $root.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest, $root.google.devtools.cloudbuild.v1.WorkerPool, request, callback); + return this.rpcCall(createWorkerPool, $root.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "CreateWorkerPool" }); /** @@ -523,7 +523,7 @@ * @memberof google.devtools.cloudbuild.v1.CloudBuild * @instance * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest} request CreateWorkerPoolRequest message or plain object - * @returns {Promise} Promise + * @returns {Promise} Promise * @variation 2 */ @@ -566,7 +566,7 @@ * @typedef DeleteWorkerPoolCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * @param {google.longrunning.Operation} [response] Operation */ /** @@ -575,12 +575,12 @@ * @memberof google.devtools.cloudbuild.v1.CloudBuild * @instance * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest} request DeleteWorkerPoolRequest message or plain object - * @param {google.devtools.cloudbuild.v1.CloudBuild.DeleteWorkerPoolCallback} callback Node-style callback called with the error, if any, and Empty + * @param {google.devtools.cloudbuild.v1.CloudBuild.DeleteWorkerPoolCallback} callback Node-style callback called with the error, if any, and Operation * @returns {undefined} * @variation 1 */ Object.defineProperty(CloudBuild.prototype.deleteWorkerPool = function deleteWorkerPool(request, callback) { - return this.rpcCall(deleteWorkerPool, $root.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest, $root.google.protobuf.Empty, request, callback); + return this.rpcCall(deleteWorkerPool, $root.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "DeleteWorkerPool" }); /** @@ -589,7 +589,7 @@ * @memberof google.devtools.cloudbuild.v1.CloudBuild * @instance * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest} request DeleteWorkerPoolRequest message or plain object - * @returns {Promise} Promise + * @returns {Promise} Promise * @variation 2 */ @@ -599,7 +599,7 @@ * @typedef UpdateWorkerPoolCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.devtools.cloudbuild.v1.WorkerPool} [response] WorkerPool + * @param {google.longrunning.Operation} [response] Operation */ /** @@ -608,12 +608,12 @@ * @memberof google.devtools.cloudbuild.v1.CloudBuild * @instance * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest} request UpdateWorkerPoolRequest message or plain object - * @param {google.devtools.cloudbuild.v1.CloudBuild.UpdateWorkerPoolCallback} callback Node-style callback called with the error, if any, and WorkerPool + * @param {google.devtools.cloudbuild.v1.CloudBuild.UpdateWorkerPoolCallback} callback Node-style callback called with the error, if any, and Operation * @returns {undefined} * @variation 1 */ Object.defineProperty(CloudBuild.prototype.updateWorkerPool = function updateWorkerPool(request, callback) { - return this.rpcCall(updateWorkerPool, $root.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest, $root.google.devtools.cloudbuild.v1.WorkerPool, request, callback); + return this.rpcCall(updateWorkerPool, $root.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest, $root.google.longrunning.Operation, request, callback); }, "name", { value: "UpdateWorkerPool" }); /** @@ -622,7 +622,7 @@ * @memberof google.devtools.cloudbuild.v1.CloudBuild * @instance * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest} request UpdateWorkerPoolRequest message or plain object - * @returns {Promise} Promise + * @returns {Promise} Promise * @variation 2 */ @@ -12720,6 +12720,7 @@ * @property {boolean|null} [dynamicSubstitutions] BuildOptions dynamicSubstitutions * @property {google.devtools.cloudbuild.v1.BuildOptions.LogStreamingOption|null} [logStreamingOption] BuildOptions logStreamingOption * @property {string|null} [workerPool] BuildOptions workerPool + * @property {google.devtools.cloudbuild.v1.BuildOptions.IPoolOption|null} [pool] BuildOptions pool * @property {google.devtools.cloudbuild.v1.BuildOptions.LoggingMode|null} [logging] BuildOptions logging * @property {Array.|null} [env] BuildOptions env * @property {Array.|null} [secretEnv] BuildOptions secretEnv @@ -12809,6 +12810,14 @@ */ BuildOptions.prototype.workerPool = ""; + /** + * BuildOptions pool. + * @member {google.devtools.cloudbuild.v1.BuildOptions.IPoolOption|null|undefined} pool + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @instance + */ + BuildOptions.prototype.pool = null; + /** * BuildOptions logging. * @member {google.devtools.cloudbuild.v1.BuildOptions.LoggingMode} logging @@ -12896,6 +12905,8 @@ $root.google.devtools.cloudbuild.v1.Volume.encode(message.volumes[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); if (message.dynamicSubstitutions != null && Object.hasOwnProperty.call(message, "dynamicSubstitutions")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.dynamicSubstitutions); + if (message.pool != null && Object.hasOwnProperty.call(message, "pool")) + $root.google.devtools.cloudbuild.v1.BuildOptions.PoolOption.encode(message.pool, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); return writer; }; @@ -12961,6 +12972,9 @@ case 7: message.workerPool = reader.string(); break; + case 19: + message.pool = $root.google.devtools.cloudbuild.v1.BuildOptions.PoolOption.decode(reader, reader.uint32()); + break; case 11: message.logging = reader.int32(); break; @@ -13072,6 +13086,11 @@ if (message.workerPool != null && message.hasOwnProperty("workerPool")) if (!$util.isString(message.workerPool)) return "workerPool: string expected"; + if (message.pool != null && message.hasOwnProperty("pool")) { + var error = $root.google.devtools.cloudbuild.v1.BuildOptions.PoolOption.verify(message.pool); + if (error) + return "pool." + error; + } if (message.logging != null && message.hasOwnProperty("logging")) switch (message.logging) { default: @@ -13212,6 +13231,11 @@ } if (object.workerPool != null) message.workerPool = String(object.workerPool); + if (object.pool != null) { + if (typeof object.pool !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.BuildOptions.pool: object expected"); + message.pool = $root.google.devtools.cloudbuild.v1.BuildOptions.PoolOption.fromObject(object.pool); + } switch (object.logging) { case "LOGGING_UNSPECIFIED": case 0: @@ -13297,6 +13321,7 @@ object.workerPool = ""; object.logging = options.enums === String ? "LOGGING_UNSPECIFIED" : 0; object.dynamicSubstitutions = false; + object.pool = null; } if (message.sourceProvenanceHash && message.sourceProvenanceHash.length) { object.sourceProvenanceHash = []; @@ -13337,6 +13362,8 @@ } if (message.dynamicSubstitutions != null && message.hasOwnProperty("dynamicSubstitutions")) object.dynamicSubstitutions = message.dynamicSubstitutions; + if (message.pool != null && message.hasOwnProperty("pool")) + object.pool = $root.google.devtools.cloudbuild.v1.BuildOptions.PoolOption.toObject(message.pool, options); return object; }; @@ -13351,6 +13378,193 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + BuildOptions.PoolOption = (function() { + + /** + * Properties of a PoolOption. + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @interface IPoolOption + * @property {string|null} [name] PoolOption name + */ + + /** + * Constructs a new PoolOption. + * @memberof google.devtools.cloudbuild.v1.BuildOptions + * @classdesc Represents a PoolOption. + * @implements IPoolOption + * @constructor + * @param {google.devtools.cloudbuild.v1.BuildOptions.IPoolOption=} [properties] Properties to set + */ + function PoolOption(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PoolOption name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @instance + */ + PoolOption.prototype.name = ""; + + /** + * Creates a new PoolOption instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @static + * @param {google.devtools.cloudbuild.v1.BuildOptions.IPoolOption=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.BuildOptions.PoolOption} PoolOption instance + */ + PoolOption.create = function create(properties) { + return new PoolOption(properties); + }; + + /** + * Encodes the specified PoolOption message. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOptions.PoolOption.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @static + * @param {google.devtools.cloudbuild.v1.BuildOptions.IPoolOption} message PoolOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PoolOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified PoolOption message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.BuildOptions.PoolOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @static + * @param {google.devtools.cloudbuild.v1.BuildOptions.IPoolOption} message PoolOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PoolOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PoolOption message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.BuildOptions.PoolOption} PoolOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PoolOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.BuildOptions.PoolOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PoolOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.BuildOptions.PoolOption} PoolOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PoolOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PoolOption message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PoolOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a PoolOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.BuildOptions.PoolOption} PoolOption + */ + PoolOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.BuildOptions.PoolOption) + return object; + var message = new $root.google.devtools.cloudbuild.v1.BuildOptions.PoolOption(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a PoolOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @static + * @param {google.devtools.cloudbuild.v1.BuildOptions.PoolOption} message PoolOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PoolOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this PoolOption to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.BuildOptions.PoolOption + * @instance + * @returns {Object.} JSON object + */ + PoolOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PoolOption; + })(); + /** * VerifyOption enum. * @name google.devtools.cloudbuild.v1.BuildOptions.VerifyOption @@ -13888,15 +14102,15 @@ * @memberof google.devtools.cloudbuild.v1 * @interface IWorkerPool * @property {string|null} [name] WorkerPool name - * @property {string|null} [projectId] WorkerPool projectId - * @property {string|null} [serviceAccountEmail] WorkerPool serviceAccountEmail - * @property {number|Long|null} [workerCount] WorkerPool workerCount - * @property {google.devtools.cloudbuild.v1.IWorkerConfig|null} [workerConfig] WorkerPool workerConfig - * @property {Array.|null} [regions] WorkerPool regions + * @property {string|null} [displayName] WorkerPool displayName + * @property {string|null} [uid] WorkerPool uid + * @property {Object.|null} [annotations] WorkerPool annotations * @property {google.protobuf.ITimestamp|null} [createTime] WorkerPool createTime * @property {google.protobuf.ITimestamp|null} [updateTime] WorkerPool updateTime * @property {google.protobuf.ITimestamp|null} [deleteTime] WorkerPool deleteTime - * @property {google.devtools.cloudbuild.v1.WorkerPool.Status|null} [status] WorkerPool status + * @property {google.devtools.cloudbuild.v1.WorkerPool.State|null} [state] WorkerPool state + * @property {google.devtools.cloudbuild.v1.IPrivatePoolV1Config|null} [privatePoolV1Config] WorkerPool privatePoolV1Config + * @property {string|null} [etag] WorkerPool etag */ /** @@ -13908,7 +14122,7 @@ * @param {google.devtools.cloudbuild.v1.IWorkerPool=} [properties] Properties to set */ function WorkerPool(properties) { - this.regions = []; + this.annotations = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13924,76 +14138,90 @@ WorkerPool.prototype.name = ""; /** - * WorkerPool projectId. - * @member {string} projectId + * WorkerPool displayName. + * @member {string} displayName * @memberof google.devtools.cloudbuild.v1.WorkerPool * @instance */ - WorkerPool.prototype.projectId = ""; + WorkerPool.prototype.displayName = ""; /** - * WorkerPool serviceAccountEmail. - * @member {string} serviceAccountEmail + * WorkerPool uid. + * @member {string} uid * @memberof google.devtools.cloudbuild.v1.WorkerPool * @instance */ - WorkerPool.prototype.serviceAccountEmail = ""; + WorkerPool.prototype.uid = ""; /** - * WorkerPool workerCount. - * @member {number|Long} workerCount + * WorkerPool annotations. + * @member {Object.} annotations * @memberof google.devtools.cloudbuild.v1.WorkerPool * @instance */ - WorkerPool.prototype.workerCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + WorkerPool.prototype.annotations = $util.emptyObject; /** - * WorkerPool workerConfig. - * @member {google.devtools.cloudbuild.v1.IWorkerConfig|null|undefined} workerConfig + * WorkerPool createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime * @memberof google.devtools.cloudbuild.v1.WorkerPool * @instance */ - WorkerPool.prototype.workerConfig = null; + WorkerPool.prototype.createTime = null; /** - * WorkerPool regions. - * @member {Array.} regions + * WorkerPool updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime * @memberof google.devtools.cloudbuild.v1.WorkerPool * @instance */ - WorkerPool.prototype.regions = $util.emptyArray; + WorkerPool.prototype.updateTime = null; /** - * WorkerPool createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime + * WorkerPool deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime * @memberof google.devtools.cloudbuild.v1.WorkerPool * @instance */ - WorkerPool.prototype.createTime = null; + WorkerPool.prototype.deleteTime = null; /** - * WorkerPool updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * WorkerPool state. + * @member {google.devtools.cloudbuild.v1.WorkerPool.State} state * @memberof google.devtools.cloudbuild.v1.WorkerPool * @instance */ - WorkerPool.prototype.updateTime = null; + WorkerPool.prototype.state = 0; /** - * WorkerPool deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * WorkerPool privatePoolV1Config. + * @member {google.devtools.cloudbuild.v1.IPrivatePoolV1Config|null|undefined} privatePoolV1Config * @memberof google.devtools.cloudbuild.v1.WorkerPool * @instance */ - WorkerPool.prototype.deleteTime = null; + WorkerPool.prototype.privatePoolV1Config = null; + + /** + * WorkerPool etag. + * @member {string} etag + * @memberof google.devtools.cloudbuild.v1.WorkerPool + * @instance + */ + WorkerPool.prototype.etag = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * WorkerPool status. - * @member {google.devtools.cloudbuild.v1.WorkerPool.Status} status + * WorkerPool config. + * @member {"privatePoolV1Config"|undefined} config * @memberof google.devtools.cloudbuild.v1.WorkerPool * @instance */ - WorkerPool.prototype.status = 0; + Object.defineProperty(WorkerPool.prototype, "config", { + get: $util.oneOfGetter($oneOfFields = ["privatePoolV1Config"]), + set: $util.oneOfSetter($oneOfFields) + }); /** * Creates a new WorkerPool instance using the specified properties. @@ -14019,30 +14247,27 @@ WorkerPool.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); - if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceAccountEmail); - if (message.workerCount != null && Object.hasOwnProperty.call(message, "workerCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.workerCount); - if (message.regions != null && message.regions.length) { - writer.uint32(/* id 9, wireType 2 =*/74).fork(); - for (var i = 0; i < message.regions.length; ++i) - writer.int32(message.regions[i]); - writer.ldelim(); - } - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 13, wireType 0 =*/104).int32(message.status); if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.name); - if (message.workerConfig != null && Object.hasOwnProperty.call(message, "workerConfig")) - $root.google.devtools.cloudbuild.v1.WorkerConfig.encode(message.workerConfig, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + if (message.privatePoolV1Config != null && Object.hasOwnProperty.call(message, "privatePoolV1Config")) + $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.encode(message.privatePoolV1Config, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; @@ -14073,46 +14298,58 @@ WorkerPool.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.WorkerPool(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.WorkerPool(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 14: + case 1: message.name = reader.string(); break; case 2: - message.projectId = reader.string(); + message.displayName = reader.string(); break; case 3: - message.serviceAccountEmail = reader.string(); + message.uid = reader.string(); break; case 4: - message.workerCount = reader.int64(); - break; - case 16: - message.workerConfig = $root.google.devtools.cloudbuild.v1.WorkerConfig.decode(reader, reader.uint32()); - break; - case 9: - if (!(message.regions && message.regions.length)) - message.regions = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.regions.push(reader.int32()); - } else - message.regions.push(reader.int32()); + 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 11: + case 5: message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; - case 17: + case 6: message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; - case 12: + case 7: message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; - case 13: - message.status = reader.int32(); + case 8: + message.state = reader.int32(); + break; + case 12: + message.privatePoolV1Config = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.decode(reader, reader.uint32()); + break; + case 11: + message.etag = reader.string(); break; default: reader.skipType(tag & 7); @@ -14149,37 +14386,23 @@ WorkerPool.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - if (!$util.isString(message.serviceAccountEmail)) - return "serviceAccountEmail: string expected"; - if (message.workerCount != null && message.hasOwnProperty("workerCount")) - if (!$util.isInteger(message.workerCount) && !(message.workerCount && $util.isInteger(message.workerCount.low) && $util.isInteger(message.workerCount.high))) - return "workerCount: integer|Long expected"; - if (message.workerConfig != null && message.hasOwnProperty("workerConfig")) { - var error = $root.google.devtools.cloudbuild.v1.WorkerConfig.verify(message.workerConfig); - if (error) - return "workerConfig." + error; - } - if (message.regions != null && message.hasOwnProperty("regions")) { - if (!Array.isArray(message.regions)) - return "regions: array expected"; - for (var i = 0; i < message.regions.length; ++i) - switch (message.regions[i]) { - default: - return "regions: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.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.createTime != null && message.hasOwnProperty("createTime")) { var error = $root.google.protobuf.Timestamp.verify(message.createTime); @@ -14196,10 +14419,10 @@ if (error) return "deleteTime." + error; } - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { default: - return "status: enum value expected"; + return "state: enum value expected"; case 0: case 1: case 2: @@ -14207,7 +14430,18 @@ case 4: break; } - return null; + if (message.privatePoolV1Config != null && message.hasOwnProperty("privatePoolV1Config")) { + properties.config = 1; + { + var error = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.verify(message.privatePoolV1Config); + if (error) + return "privatePoolV1Config." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; }; /** @@ -14224,52 +14458,16 @@ var message = new $root.google.devtools.cloudbuild.v1.WorkerPool(); if (object.name != null) message.name = String(object.name); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.serviceAccountEmail != null) - message.serviceAccountEmail = String(object.serviceAccountEmail); - if (object.workerCount != null) - if ($util.Long) - (message.workerCount = $util.Long.fromValue(object.workerCount)).unsigned = false; - else if (typeof object.workerCount === "string") - message.workerCount = parseInt(object.workerCount, 10); - else if (typeof object.workerCount === "number") - message.workerCount = object.workerCount; - else if (typeof object.workerCount === "object") - message.workerCount = new $util.LongBits(object.workerCount.low >>> 0, object.workerCount.high >>> 0).toNumber(); - if (object.workerConfig != null) { - if (typeof object.workerConfig !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.WorkerPool.workerConfig: object expected"); - message.workerConfig = $root.google.devtools.cloudbuild.v1.WorkerConfig.fromObject(object.workerConfig); - } - if (object.regions) { - if (!Array.isArray(object.regions)) - throw TypeError(".google.devtools.cloudbuild.v1.WorkerPool.regions: array expected"); - message.regions = []; - for (var i = 0; i < object.regions.length; ++i) - switch (object.regions[i]) { - default: - case "REGION_UNSPECIFIED": - case 0: - message.regions[i] = 0; - break; - case "US_CENTRAL1": - case 1: - message.regions[i] = 1; - break; - case "US_WEST1": - case 2: - message.regions[i] = 2; - break; - case "US_EAST1": - case 3: - message.regions[i] = 3; - break; - case "US_EAST4": - case 4: - message.regions[i] = 4; - break; - } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.WorkerPool.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.createTime != null) { if (typeof object.createTime !== "object") @@ -14286,28 +14484,35 @@ throw TypeError(".google.devtools.cloudbuild.v1.WorkerPool.deleteTime: object expected"); message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); } - switch (object.status) { - case "STATUS_UNSPECIFIED": + switch (object.state) { + case "STATE_UNSPECIFIED": case 0: - message.status = 0; + message.state = 0; break; case "CREATING": case 1: - message.status = 1; + message.state = 1; break; case "RUNNING": case 2: - message.status = 2; + message.state = 2; break; case "DELETING": case 3: - message.status = 3; + message.state = 3; break; case "DELETED": case 4: - message.status = 4; + message.state = 4; break; } + if (object.privatePoolV1Config != null) { + if (typeof object.privatePoolV1Config !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.WorkerPool.privatePoolV1Config: object expected"); + message.privatePoolV1Config = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.fromObject(object.privatePoolV1Config); + } + if (object.etag != null) + message.etag = String(object.etag); return message; }; @@ -14324,49 +14529,45 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.regions = []; + if (options.objects || options.defaults) + object.annotations = {}; if (options.defaults) { - object.projectId = ""; - object.serviceAccountEmail = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.workerCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.workerCount = options.longs === String ? "0" : 0; - object.createTime = null; - object.deleteTime = null; - object.status = options.enums === String ? "STATUS_UNSPECIFIED" : 0; object.name = ""; - object.workerConfig = null; + object.displayName = ""; + object.uid = ""; + object.createTime = null; object.updateTime = null; + object.deleteTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.etag = ""; } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) - object.serviceAccountEmail = message.serviceAccountEmail; - if (message.workerCount != null && message.hasOwnProperty("workerCount")) - if (typeof message.workerCount === "number") - object.workerCount = options.longs === String ? String(message.workerCount) : message.workerCount; - else - object.workerCount = options.longs === String ? $util.Long.prototype.toString.call(message.workerCount) : options.longs === Number ? new $util.LongBits(message.workerCount.low >>> 0, message.workerCount.high >>> 0).toNumber() : message.workerCount; - if (message.regions && message.regions.length) { - object.regions = []; - for (var j = 0; j < message.regions.length; ++j) - object.regions[j] = options.enums === String ? $root.google.devtools.cloudbuild.v1.WorkerPool.Region[message.regions[j]] : message.regions[j]; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + 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.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.google.devtools.cloudbuild.v1.WorkerPool.Status[message.status] : message.status; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.workerConfig != null && message.hasOwnProperty("workerConfig")) - object.workerConfig = $root.google.devtools.cloudbuild.v1.WorkerConfig.toObject(message.workerConfig, options); if (message.updateTime != null && message.hasOwnProperty("updateTime")) object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.devtools.cloudbuild.v1.WorkerPool.State[message.state] : message.state; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.privatePoolV1Config != null && message.hasOwnProperty("privatePoolV1Config")) { + object.privatePoolV1Config = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.toObject(message.privatePoolV1Config, options); + if (options.oneofs) + object.config = "privatePoolV1Config"; + } return object; }; @@ -14382,38 +14583,18 @@ }; /** - * Region enum. - * @name google.devtools.cloudbuild.v1.WorkerPool.Region - * @enum {number} - * @property {number} REGION_UNSPECIFIED=0 REGION_UNSPECIFIED value - * @property {number} US_CENTRAL1=1 US_CENTRAL1 value - * @property {number} US_WEST1=2 US_WEST1 value - * @property {number} US_EAST1=3 US_EAST1 value - * @property {number} US_EAST4=4 US_EAST4 value - */ - WorkerPool.Region = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REGION_UNSPECIFIED"] = 0; - values[valuesById[1] = "US_CENTRAL1"] = 1; - values[valuesById[2] = "US_WEST1"] = 2; - values[valuesById[3] = "US_EAST1"] = 3; - values[valuesById[4] = "US_EAST4"] = 4; - return values; - })(); - - /** - * Status enum. - * @name google.devtools.cloudbuild.v1.WorkerPool.Status + * State enum. + * @name google.devtools.cloudbuild.v1.WorkerPool.State * @enum {number} - * @property {number} STATUS_UNSPECIFIED=0 STATUS_UNSPECIFIED value + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} CREATING=1 CREATING value * @property {number} RUNNING=2 RUNNING value * @property {number} DELETING=3 DELETING value * @property {number} DELETED=4 DELETED value */ - WorkerPool.Status = (function() { + WorkerPool.State = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATUS_UNSPECIFIED"] = 0; + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; values[valuesById[1] = "CREATING"] = 1; values[valuesById[2] = "RUNNING"] = 2; values[valuesById[3] = "DELETING"] = 3; @@ -14424,27 +14605,25 @@ return WorkerPool; })(); - v1.WorkerConfig = (function() { + v1.PrivatePoolV1Config = (function() { /** - * Properties of a WorkerConfig. + * Properties of a PrivatePoolV1Config. * @memberof google.devtools.cloudbuild.v1 - * @interface IWorkerConfig - * @property {string|null} [machineType] WorkerConfig machineType - * @property {number|Long|null} [diskSizeGb] WorkerConfig diskSizeGb - * @property {google.devtools.cloudbuild.v1.INetwork|null} [network] WorkerConfig network - * @property {string|null} [tag] WorkerConfig tag + * @interface IPrivatePoolV1Config + * @property {google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig|null} [workerConfig] PrivatePoolV1Config workerConfig + * @property {google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig|null} [networkConfig] PrivatePoolV1Config networkConfig */ /** - * Constructs a new WorkerConfig. + * Constructs a new PrivatePoolV1Config. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a WorkerConfig. - * @implements IWorkerConfig + * @classdesc Represents a PrivatePoolV1Config. + * @implements IPrivatePoolV1Config * @constructor - * @param {google.devtools.cloudbuild.v1.IWorkerConfig=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.IPrivatePoolV1Config=} [properties] Properties to set */ - function WorkerConfig(properties) { + function PrivatePoolV1Config(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14452,114 +14631,88 @@ } /** - * WorkerConfig machineType. - * @member {string} machineType - * @memberof google.devtools.cloudbuild.v1.WorkerConfig - * @instance - */ - WorkerConfig.prototype.machineType = ""; - - /** - * WorkerConfig diskSizeGb. - * @member {number|Long} diskSizeGb - * @memberof google.devtools.cloudbuild.v1.WorkerConfig - * @instance - */ - WorkerConfig.prototype.diskSizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * WorkerConfig network. - * @member {google.devtools.cloudbuild.v1.INetwork|null|undefined} network - * @memberof google.devtools.cloudbuild.v1.WorkerConfig + * PrivatePoolV1Config workerConfig. + * @member {google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig|null|undefined} workerConfig + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config * @instance */ - WorkerConfig.prototype.network = null; + PrivatePoolV1Config.prototype.workerConfig = null; /** - * WorkerConfig tag. - * @member {string} tag - * @memberof google.devtools.cloudbuild.v1.WorkerConfig + * PrivatePoolV1Config networkConfig. + * @member {google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig|null|undefined} networkConfig + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config * @instance */ - WorkerConfig.prototype.tag = ""; + PrivatePoolV1Config.prototype.networkConfig = null; /** - * Creates a new WorkerConfig instance using the specified properties. + * Creates a new PrivatePoolV1Config instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.WorkerConfig + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config * @static - * @param {google.devtools.cloudbuild.v1.IWorkerConfig=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.WorkerConfig} WorkerConfig instance + * @param {google.devtools.cloudbuild.v1.IPrivatePoolV1Config=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config} PrivatePoolV1Config instance */ - WorkerConfig.create = function create(properties) { - return new WorkerConfig(properties); + PrivatePoolV1Config.create = function create(properties) { + return new PrivatePoolV1Config(properties); }; /** - * Encodes the specified WorkerConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.WorkerConfig.verify|verify} messages. + * Encodes the specified PrivatePoolV1Config message. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.WorkerConfig + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config * @static - * @param {google.devtools.cloudbuild.v1.IWorkerConfig} message WorkerConfig message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IPrivatePoolV1Config} message PrivatePoolV1Config message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WorkerConfig.encode = function encode(message, writer) { + PrivatePoolV1Config.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); - if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.diskSizeGb); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - $root.google.devtools.cloudbuild.v1.Network.encode(message.network, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.tag != null && Object.hasOwnProperty.call(message, "tag")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.tag); + if (message.workerConfig != null && Object.hasOwnProperty.call(message, "workerConfig")) + $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig.encode(message.workerConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) + $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.encode(message.networkConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified WorkerConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.WorkerConfig.verify|verify} messages. + * Encodes the specified PrivatePoolV1Config message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.WorkerConfig + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config * @static - * @param {google.devtools.cloudbuild.v1.IWorkerConfig} message WorkerConfig message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IPrivatePoolV1Config} message PrivatePoolV1Config message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WorkerConfig.encodeDelimited = function encodeDelimited(message, writer) { + PrivatePoolV1Config.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WorkerConfig message from the specified reader or buffer. + * Decodes a PrivatePoolV1Config message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.WorkerConfig + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.WorkerConfig} WorkerConfig + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config} PrivatePoolV1Config * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WorkerConfig.decode = function decode(reader, length) { + PrivatePoolV1Config.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.WorkerConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.machineType = reader.string(); + message.workerConfig = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig.decode(reader, reader.uint32()); break; case 2: - message.diskSizeGb = reader.int64(); - break; - case 3: - message.network = $root.google.devtools.cloudbuild.v1.Network.decode(reader, reader.uint32()); - break; - case 4: - message.tag = reader.string(); + message.networkConfig = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -14570,255 +14723,1158 @@ }; /** - * Decodes a WorkerConfig message from the specified reader or buffer, length delimited. + * Decodes a PrivatePoolV1Config message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.WorkerConfig + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.WorkerConfig} WorkerConfig + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config} PrivatePoolV1Config * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WorkerConfig.decodeDelimited = function decodeDelimited(reader) { + PrivatePoolV1Config.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WorkerConfig message. + * Verifies a PrivatePoolV1Config message. * @function verify - * @memberof google.devtools.cloudbuild.v1.WorkerConfig + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WorkerConfig.verify = function verify(message) { + PrivatePoolV1Config.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.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) - if (!$util.isInteger(message.diskSizeGb) && !(message.diskSizeGb && $util.isInteger(message.diskSizeGb.low) && $util.isInteger(message.diskSizeGb.high))) - return "diskSizeGb: integer|Long expected"; - if (message.network != null && message.hasOwnProperty("network")) { - var error = $root.google.devtools.cloudbuild.v1.Network.verify(message.network); + if (message.workerConfig != null && message.hasOwnProperty("workerConfig")) { + var error = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig.verify(message.workerConfig); if (error) - return "network." + error; + return "workerConfig." + error; + } + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { + var error = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.verify(message.networkConfig); + if (error) + return "networkConfig." + error; } - if (message.tag != null && message.hasOwnProperty("tag")) - if (!$util.isString(message.tag)) - return "tag: string expected"; return null; }; /** - * Creates a WorkerConfig message from a plain object. Also converts values to their respective internal types. + * Creates a PrivatePoolV1Config message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.WorkerConfig + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.WorkerConfig} WorkerConfig + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config} PrivatePoolV1Config */ - WorkerConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.WorkerConfig) + PrivatePoolV1Config.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config) return object; - var message = new $root.google.devtools.cloudbuild.v1.WorkerConfig(); - if (object.machineType != null) - message.machineType = String(object.machineType); - 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.network != null) { - if (typeof object.network !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.WorkerConfig.network: object expected"); - message.network = $root.google.devtools.cloudbuild.v1.Network.fromObject(object.network); + var message = new $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config(); + if (object.workerConfig != null) { + if (typeof object.workerConfig !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.PrivatePoolV1Config.workerConfig: object expected"); + message.workerConfig = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig.fromObject(object.workerConfig); + } + if (object.networkConfig != null) { + if (typeof object.networkConfig !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.PrivatePoolV1Config.networkConfig: object expected"); + message.networkConfig = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.fromObject(object.networkConfig); } - if (object.tag != null) - message.tag = String(object.tag); return message; }; /** - * Creates a plain object from a WorkerConfig message. Also converts values to other types if specified. + * Creates a plain object from a PrivatePoolV1Config message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.WorkerConfig + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config * @static - * @param {google.devtools.cloudbuild.v1.WorkerConfig} message WorkerConfig + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config} message PrivatePoolV1Config * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WorkerConfig.toObject = function toObject(message, options) { + PrivatePoolV1Config.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.machineType = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.diskSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.diskSizeGb = options.longs === String ? "0" : 0; - object.network = null; - object.tag = ""; + object.workerConfig = null; + object.networkConfig = null; } - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - 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 (message.network != null && message.hasOwnProperty("network")) - object.network = $root.google.devtools.cloudbuild.v1.Network.toObject(message.network, options); - if (message.tag != null && message.hasOwnProperty("tag")) - object.tag = message.tag; + if (message.workerConfig != null && message.hasOwnProperty("workerConfig")) + object.workerConfig = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig.toObject(message.workerConfig, options); + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) + object.networkConfig = $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.toObject(message.networkConfig, options); return object; }; /** - * Converts this WorkerConfig to JSON. + * Converts this PrivatePoolV1Config to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.WorkerConfig + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config * @instance * @returns {Object.} JSON object */ - WorkerConfig.prototype.toJSON = function toJSON() { + PrivatePoolV1Config.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return WorkerConfig; - })(); - - v1.Network = (function() { + PrivatePoolV1Config.WorkerConfig = (function() { - /** - * Properties of a Network. - * @memberof google.devtools.cloudbuild.v1 - * @interface INetwork - * @property {string|null} [projectId] Network projectId - * @property {string|null} [network] Network network - * @property {string|null} [subnetwork] Network subnetwork - */ + /** + * Properties of a WorkerConfig. + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @interface IWorkerConfig + * @property {string|null} [machineType] WorkerConfig machineType + * @property {number|Long|null} [diskSizeGb] WorkerConfig diskSizeGb + */ - /** - * Constructs a new Network. - * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a Network. - * @implements INetwork - * @constructor - * @param {google.devtools.cloudbuild.v1.INetwork=} [properties] Properties to set - */ - function Network(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new WorkerConfig. + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @classdesc Represents a WorkerConfig. + * @implements IWorkerConfig + * @constructor + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig=} [properties] Properties to set + */ + function WorkerConfig(properties) { + if (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 projectId. - * @member {string} projectId - * @memberof google.devtools.cloudbuild.v1.Network - * @instance - */ - Network.prototype.projectId = ""; + /** + * WorkerConfig machineType. + * @member {string} machineType + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @instance + */ + WorkerConfig.prototype.machineType = ""; - /** - * Network network. - * @member {string} network - * @memberof google.devtools.cloudbuild.v1.Network - * @instance - */ - Network.prototype.network = ""; + /** + * WorkerConfig diskSizeGb. + * @member {number|Long} diskSizeGb + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @instance + */ + WorkerConfig.prototype.diskSizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Network subnetwork. - * @member {string} subnetwork - * @memberof google.devtools.cloudbuild.v1.Network - * @instance - */ - Network.prototype.subnetwork = ""; + /** + * Creates a new WorkerConfig instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @static + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig} WorkerConfig instance + */ + WorkerConfig.create = function create(properties) { + return new WorkerConfig(properties); + }; - /** - * Creates a new Network instance using the specified properties. - * @function create - * @memberof google.devtools.cloudbuild.v1.Network - * @static - * @param {google.devtools.cloudbuild.v1.INetwork=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.Network} Network instance - */ - Network.create = function create(properties) { - return new Network(properties); - }; + /** + * Encodes the specified WorkerConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @static + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig} message WorkerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.diskSizeGb); + return writer; + }; - /** - * Encodes the specified Network message. Does not implicitly {@link google.devtools.cloudbuild.v1.Network.verify|verify} messages. - * @function encode - * @memberof google.devtools.cloudbuild.v1.Network - * @static - * @param {google.devtools.cloudbuild.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.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.network); - if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.subnetwork); - return writer; - }; + /** + * Encodes the specified WorkerConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @static + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.IWorkerConfig} message WorkerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkerConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified Network message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.Network.verify|verify} messages. - * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.Network - * @static - * @param {google.devtools.cloudbuild.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 WorkerConfig message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig} WorkerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.machineType = reader.string(); + break; + case 2: + message.diskSizeGb = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a Network message from the specified reader or buffer. - * @function decode - * @memberof google.devtools.cloudbuild.v1.Network - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.Network} Network - * @throws {Error} If the payload is not a reader or valid buffer + /** + * Decodes a WorkerConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig} WorkerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkerConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkerConfig message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkerConfig.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.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + if (!$util.isInteger(message.diskSizeGb) && !(message.diskSizeGb && $util.isInteger(message.diskSizeGb.low) && $util.isInteger(message.diskSizeGb.high))) + return "diskSizeGb: integer|Long expected"; + return null; + }; + + /** + * Creates a WorkerConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig} WorkerConfig + */ + WorkerConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig) + return object; + var message = new $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig(); + if (object.machineType != null) + message.machineType = String(object.machineType); + 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(); + return message; + }; + + /** + * Creates a plain object from a WorkerConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @static + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig} message WorkerConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkerConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.machineType = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.diskSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.diskSizeGb = options.longs === String ? "0" : 0; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + 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; + return object; + }; + + /** + * Converts this WorkerConfig to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.WorkerConfig + * @instance + * @returns {Object.} JSON object + */ + WorkerConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WorkerConfig; + })(); + + PrivatePoolV1Config.NetworkConfig = (function() { + + /** + * Properties of a NetworkConfig. + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @interface INetworkConfig + * @property {string|null} [peeredNetwork] NetworkConfig peeredNetwork + * @property {google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption|null} [egressOption] NetworkConfig egressOption + */ + + /** + * Constructs a new NetworkConfig. + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config + * @classdesc Represents a NetworkConfig. + * @implements INetworkConfig + * @constructor + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig=} [properties] Properties to set + */ + function NetworkConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkConfig peeredNetwork. + * @member {string} peeredNetwork + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @instance + */ + NetworkConfig.prototype.peeredNetwork = ""; + + /** + * NetworkConfig egressOption. + * @member {google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption} egressOption + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @instance + */ + NetworkConfig.prototype.egressOption = 0; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @static + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig} NetworkConfig instance + */ + NetworkConfig.create = function create(properties) { + return new NetworkConfig(properties); + }; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @static + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.peeredNetwork != null && Object.hasOwnProperty.call(message, "peeredNetwork")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.peeredNetwork); + if (message.egressOption != null && Object.hasOwnProperty.call(message, "egressOption")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.egressOption); + return writer; + }; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @static + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.peeredNetwork = reader.string(); + break; + case 2: + message.egressOption = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkConfig message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.peeredNetwork != null && message.hasOwnProperty("peeredNetwork")) + if (!$util.isString(message.peeredNetwork)) + return "peeredNetwork: string expected"; + if (message.egressOption != null && message.hasOwnProperty("egressOption")) + switch (message.egressOption) { + default: + return "egressOption: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig} NetworkConfig + */ + NetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig) + return object; + var message = new $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig(); + if (object.peeredNetwork != null) + message.peeredNetwork = String(object.peeredNetwork); + switch (object.egressOption) { + case "EGRESS_OPTION_UNSPECIFIED": + case 0: + message.egressOption = 0; + break; + case "NO_PUBLIC_EGRESS": + case 1: + message.egressOption = 1; + break; + case "PUBLIC_EGRESS": + case 2: + message.egressOption = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @static + * @param {google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig} message NetworkConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.peeredNetwork = ""; + object.egressOption = options.enums === String ? "EGRESS_OPTION_UNSPECIFIED" : 0; + } + if (message.peeredNetwork != null && message.hasOwnProperty("peeredNetwork")) + object.peeredNetwork = message.peeredNetwork; + if (message.egressOption != null && message.hasOwnProperty("egressOption")) + object.egressOption = options.enums === String ? $root.google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption[message.egressOption] : message.egressOption; + return object; + }; + + /** + * Converts this NetworkConfig to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * EgressOption enum. + * @name google.devtools.cloudbuild.v1.PrivatePoolV1Config.NetworkConfig.EgressOption + * @enum {number} + * @property {number} EGRESS_OPTION_UNSPECIFIED=0 EGRESS_OPTION_UNSPECIFIED value + * @property {number} NO_PUBLIC_EGRESS=1 NO_PUBLIC_EGRESS value + * @property {number} PUBLIC_EGRESS=2 PUBLIC_EGRESS value + */ + NetworkConfig.EgressOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EGRESS_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "NO_PUBLIC_EGRESS"] = 1; + values[valuesById[2] = "PUBLIC_EGRESS"] = 2; + return values; + })(); + + return NetworkConfig; + })(); + + return PrivatePoolV1Config; + })(); + + v1.CreateWorkerPoolRequest = (function() { + + /** + * Properties of a CreateWorkerPoolRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface ICreateWorkerPoolRequest + * @property {string|null} [parent] CreateWorkerPoolRequest parent + * @property {google.devtools.cloudbuild.v1.IWorkerPool|null} [workerPool] CreateWorkerPoolRequest workerPool + * @property {string|null} [workerPoolId] CreateWorkerPoolRequest workerPoolId + * @property {boolean|null} [validateOnly] CreateWorkerPoolRequest validateOnly + */ + + /** + * Constructs a new CreateWorkerPoolRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a CreateWorkerPoolRequest. + * @implements ICreateWorkerPoolRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest=} [properties] Properties to set + */ + function CreateWorkerPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateWorkerPoolRequest parent. + * @member {string} parent + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @instance + */ + CreateWorkerPoolRequest.prototype.parent = ""; + + /** + * CreateWorkerPoolRequest workerPool. + * @member {google.devtools.cloudbuild.v1.IWorkerPool|null|undefined} workerPool + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @instance + */ + CreateWorkerPoolRequest.prototype.workerPool = null; + + /** + * CreateWorkerPoolRequest workerPoolId. + * @member {string} workerPoolId + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @instance + */ + CreateWorkerPoolRequest.prototype.workerPoolId = ""; + + /** + * CreateWorkerPoolRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @instance + */ + CreateWorkerPoolRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateWorkerPoolRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolRequest} CreateWorkerPoolRequest instance + */ + CreateWorkerPoolRequest.create = function create(properties) { + return new CreateWorkerPoolRequest(properties); + }; + + /** + * Encodes the specified CreateWorkerPoolRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateWorkerPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest} message CreateWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkerPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + $root.google.devtools.cloudbuild.v1.WorkerPool.encode(message.workerPool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.workerPoolId != null && Object.hasOwnProperty.call(message, "workerPoolId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.workerPoolId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateWorkerPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest} message CreateWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolRequest} CreateWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkerPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.workerPool = $root.google.devtools.cloudbuild.v1.WorkerPool.decode(reader, reader.uint32()); + break; + case 3: + message.workerPoolId = reader.string(); + break; + case 4: + message.validateOnly = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolRequest} CreateWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateWorkerPoolRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateWorkerPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.workerPool != null && message.hasOwnProperty("workerPool")) { + var error = $root.google.devtools.cloudbuild.v1.WorkerPool.verify(message.workerPool); + if (error) + return "workerPool." + error; + } + if (message.workerPoolId != null && message.hasOwnProperty("workerPoolId")) + if (!$util.isString(message.workerPoolId)) + return "workerPoolId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolRequest} CreateWorkerPoolRequest + */ + CreateWorkerPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.workerPool != null) { + if (typeof object.workerPool !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.CreateWorkerPoolRequest.workerPool: object expected"); + message.workerPool = $root.google.devtools.cloudbuild.v1.WorkerPool.fromObject(object.workerPool); + } + if (object.workerPoolId != null) + message.workerPoolId = String(object.workerPoolId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateWorkerPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.CreateWorkerPoolRequest} message CreateWorkerPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateWorkerPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.workerPool = null; + object.workerPoolId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = $root.google.devtools.cloudbuild.v1.WorkerPool.toObject(message.workerPool, options); + if (message.workerPoolId != null && message.hasOwnProperty("workerPoolId")) + object.workerPoolId = message.workerPoolId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateWorkerPoolRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @instance + * @returns {Object.} JSON object + */ + CreateWorkerPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateWorkerPoolRequest; + })(); + + v1.GetWorkerPoolRequest = (function() { + + /** + * Properties of a GetWorkerPoolRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IGetWorkerPoolRequest + * @property {string|null} [name] GetWorkerPoolRequest name + */ + + /** + * Constructs a new GetWorkerPoolRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a GetWorkerPoolRequest. + * @implements IGetWorkerPoolRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IGetWorkerPoolRequest=} [properties] Properties to set + */ + function GetWorkerPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetWorkerPoolRequest name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @instance + */ + GetWorkerPoolRequest.prototype.name = ""; + + /** + * Creates a new GetWorkerPoolRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.IGetWorkerPoolRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.GetWorkerPoolRequest} GetWorkerPoolRequest instance + */ + GetWorkerPoolRequest.create = function create(properties) { + return new GetWorkerPoolRequest(properties); + }; + + /** + * Encodes the specified GetWorkerPoolRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.GetWorkerPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.IGetWorkerPoolRequest} message GetWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkerPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetWorkerPoolRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.GetWorkerPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.IGetWorkerPoolRequest} message GetWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetWorkerPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.GetWorkerPoolRequest} GetWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkerPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.GetWorkerPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetWorkerPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.devtools.cloudbuild.v1.GetWorkerPoolRequest} GetWorkerPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetWorkerPoolRequest message. + * @function verify + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetWorkerPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.devtools.cloudbuild.v1.GetWorkerPoolRequest} GetWorkerPoolRequest + */ + GetWorkerPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.GetWorkerPoolRequest) + return object; + var message = new $root.google.devtools.cloudbuild.v1.GetWorkerPoolRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetWorkerPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.GetWorkerPoolRequest} message GetWorkerPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetWorkerPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetWorkerPoolRequest to JSON. + * @function toJSON + * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @instance + * @returns {Object.} JSON object + */ + GetWorkerPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetWorkerPoolRequest; + })(); + + v1.DeleteWorkerPoolRequest = (function() { + + /** + * Properties of a DeleteWorkerPoolRequest. + * @memberof google.devtools.cloudbuild.v1 + * @interface IDeleteWorkerPoolRequest + * @property {string|null} [name] DeleteWorkerPoolRequest name + * @property {string|null} [etag] DeleteWorkerPoolRequest etag + * @property {boolean|null} [allowMissing] DeleteWorkerPoolRequest allowMissing + * @property {boolean|null} [validateOnly] DeleteWorkerPoolRequest validateOnly + */ + + /** + * Constructs a new DeleteWorkerPoolRequest. + * @memberof google.devtools.cloudbuild.v1 + * @classdesc Represents a DeleteWorkerPoolRequest. + * @implements IDeleteWorkerPoolRequest + * @constructor + * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest=} [properties] Properties to set + */ + function DeleteWorkerPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteWorkerPoolRequest name. + * @member {string} name + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @instance + */ + DeleteWorkerPoolRequest.prototype.name = ""; + + /** + * DeleteWorkerPoolRequest etag. + * @member {string} etag + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @instance + */ + DeleteWorkerPoolRequest.prototype.etag = ""; + + /** + * DeleteWorkerPoolRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @instance + */ + DeleteWorkerPoolRequest.prototype.allowMissing = false; + + /** + * DeleteWorkerPoolRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @instance + */ + DeleteWorkerPoolRequest.prototype.validateOnly = false; + + /** + * Creates a new DeleteWorkerPoolRequest instance using the specified properties. + * @function create + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest instance + */ + DeleteWorkerPoolRequest.create = function create(properties) { + return new DeleteWorkerPoolRequest(properties); + }; + + /** + * Encodes the specified DeleteWorkerPoolRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest} message DeleteWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkerPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.allowMissing); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified DeleteWorkerPoolRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @static + * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest} message DeleteWorkerPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest + * @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) { + DeleteWorkerPoolRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.Network(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.projectId = reader.string(); + message.name = reader.string(); break; case 2: - message.network = reader.string(); + message.etag = reader.string(); break; case 3: - message.subnetwork = reader.string(); + message.allowMissing = reader.bool(); + break; + case 4: + message.validateOnly = reader.bool(); break; default: reader.skipType(tag & 7); @@ -14829,125 +15885,134 @@ }; /** - * Decodes a Network message from the specified reader or buffer, length delimited. + * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.Network + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.Network} Network + * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest * @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) { + DeleteWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Network message. + * Verifies a DeleteWorkerPoolRequest message. * @function verify - * @memberof google.devtools.cloudbuild.v1.Network + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest * @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) { + DeleteWorkerPoolRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) - if (!$util.isString(message.subnetwork)) - return "subnetwork: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a Network message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.Network + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.Network} Network + * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest */ - Network.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.Network) + DeleteWorkerPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest) return object; - var message = new $root.google.devtools.cloudbuild.v1.Network(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.network != null) - message.network = String(object.network); - if (object.subnetwork != null) - message.subnetwork = String(object.subnetwork); + var message = new $root.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.etag != null) + message.etag = String(object.etag); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a Network message. Also converts values to other types if specified. + * Creates a plain object from a DeleteWorkerPoolRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.Network + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest * @static - * @param {google.devtools.cloudbuild.v1.Network} message Network + * @param {google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest} message DeleteWorkerPoolRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Network.toObject = function toObject(message, options) { + DeleteWorkerPoolRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.projectId = ""; - object.network = ""; - object.subnetwork = ""; + object.name = ""; + object.etag = ""; + object.allowMissing = false; + object.validateOnly = false; } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) - object.subnetwork = message.subnetwork; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this Network to JSON. + * Converts this DeleteWorkerPoolRequest to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.Network + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest * @instance * @returns {Object.} JSON object */ - Network.prototype.toJSON = function toJSON() { + DeleteWorkerPoolRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Network; + return DeleteWorkerPoolRequest; })(); - v1.CreateWorkerPoolRequest = (function() { + v1.UpdateWorkerPoolRequest = (function() { /** - * Properties of a CreateWorkerPoolRequest. + * Properties of an UpdateWorkerPoolRequest. * @memberof google.devtools.cloudbuild.v1 - * @interface ICreateWorkerPoolRequest - * @property {string|null} [parent] CreateWorkerPoolRequest parent - * @property {google.devtools.cloudbuild.v1.IWorkerPool|null} [workerPool] CreateWorkerPoolRequest workerPool + * @interface IUpdateWorkerPoolRequest + * @property {google.devtools.cloudbuild.v1.IWorkerPool|null} [workerPool] UpdateWorkerPoolRequest workerPool + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateWorkerPoolRequest updateMask + * @property {boolean|null} [validateOnly] UpdateWorkerPoolRequest validateOnly */ /** - * Constructs a new CreateWorkerPoolRequest. + * Constructs a new UpdateWorkerPoolRequest. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a CreateWorkerPoolRequest. - * @implements ICreateWorkerPoolRequest + * @classdesc Represents an UpdateWorkerPoolRequest. + * @implements IUpdateWorkerPoolRequest * @constructor - * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest=} [properties] Properties to set */ - function CreateWorkerPoolRequest(properties) { + function UpdateWorkerPoolRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14955,88 +16020,101 @@ } /** - * CreateWorkerPoolRequest parent. - * @member {string} parent - * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * UpdateWorkerPoolRequest workerPool. + * @member {google.devtools.cloudbuild.v1.IWorkerPool|null|undefined} workerPool + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest * @instance */ - CreateWorkerPoolRequest.prototype.parent = ""; + UpdateWorkerPoolRequest.prototype.workerPool = null; /** - * CreateWorkerPoolRequest workerPool. - * @member {google.devtools.cloudbuild.v1.IWorkerPool|null|undefined} workerPool - * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * UpdateWorkerPoolRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest * @instance */ - CreateWorkerPoolRequest.prototype.workerPool = null; + UpdateWorkerPoolRequest.prototype.updateMask = null; /** - * Creates a new CreateWorkerPoolRequest instance using the specified properties. + * UpdateWorkerPoolRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @instance + */ + UpdateWorkerPoolRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateWorkerPoolRequest instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest * @static - * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolRequest} CreateWorkerPoolRequest instance - */ - CreateWorkerPoolRequest.create = function create(properties) { - return new CreateWorkerPoolRequest(properties); + * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest instance + */ + UpdateWorkerPoolRequest.create = function create(properties) { + return new UpdateWorkerPoolRequest(properties); }; /** - * Encodes the specified CreateWorkerPoolRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateWorkerPoolRequest.verify|verify} messages. + * Encodes the specified UpdateWorkerPoolRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest * @static - * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest} message CreateWorkerPoolRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest} message UpdateWorkerPoolRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateWorkerPoolRequest.encode = function encode(message, writer) { + UpdateWorkerPoolRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) - $root.google.devtools.cloudbuild.v1.WorkerPool.encode(message.workerPool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.devtools.cloudbuild.v1.WorkerPool.encode(message.workerPool, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); return writer; }; /** - * Encodes the specified CreateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateWorkerPoolRequest.verify|verify} messages. + * Encodes the specified UpdateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest * @static - * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest} message CreateWorkerPoolRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest} message UpdateWorkerPoolRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer. + * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolRequest} CreateWorkerPoolRequest + * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateWorkerPoolRequest.decode = function decode(reader, length) { + UpdateWorkerPoolRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.workerPool = $root.google.devtools.cloudbuild.v1.WorkerPool.decode(reader, reader.uint32()); break; case 2: - message.workerPool = $root.google.devtools.cloudbuild.v1.WorkerPool.decode(reader, reader.uint32()); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 4: + message.validateOnly = reader.bool(); break; default: reader.skipType(tag & 7); @@ -15047,121 +16125,136 @@ }; /** - * Decodes a CreateWorkerPoolRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolRequest} CreateWorkerPoolRequest + * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateWorkerPoolRequest message. + * Verifies an UpdateWorkerPoolRequest message. * @function verify - * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateWorkerPoolRequest.verify = function verify(message) { + UpdateWorkerPoolRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; if (message.workerPool != null && message.hasOwnProperty("workerPool")) { var error = $root.google.devtools.cloudbuild.v1.WorkerPool.verify(message.workerPool); if (error) return "workerPool." + error; } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; return null; }; /** - * Creates a CreateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolRequest} CreateWorkerPoolRequest + * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest */ - CreateWorkerPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest) + UpdateWorkerPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest) return object; - var message = new $root.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest(); - if (object.parent != null) - message.parent = String(object.parent); + var message = new $root.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest(); if (object.workerPool != null) { if (typeof object.workerPool !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.CreateWorkerPoolRequest.workerPool: object expected"); + throw TypeError(".google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest.workerPool: object expected"); message.workerPool = $root.google.devtools.cloudbuild.v1.WorkerPool.fromObject(object.workerPool); } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); return message; }; /** - * Creates a plain object from a CreateWorkerPoolRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateWorkerPoolRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest * @static - * @param {google.devtools.cloudbuild.v1.CreateWorkerPoolRequest} message CreateWorkerPoolRequest + * @param {google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest} message UpdateWorkerPoolRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateWorkerPoolRequest.toObject = function toObject(message, options) { + UpdateWorkerPoolRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; object.workerPool = null; + object.updateMask = null; + object.validateOnly = false; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; if (message.workerPool != null && message.hasOwnProperty("workerPool")) object.workerPool = $root.google.devtools.cloudbuild.v1.WorkerPool.toObject(message.workerPool, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; return object; }; /** - * Converts this CreateWorkerPoolRequest to JSON. + * Converts this UpdateWorkerPoolRequest to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest * @instance * @returns {Object.} JSON object */ - CreateWorkerPoolRequest.prototype.toJSON = function toJSON() { + UpdateWorkerPoolRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateWorkerPoolRequest; + return UpdateWorkerPoolRequest; })(); - v1.GetWorkerPoolRequest = (function() { + v1.ListWorkerPoolsRequest = (function() { /** - * Properties of a GetWorkerPoolRequest. + * Properties of a ListWorkerPoolsRequest. * @memberof google.devtools.cloudbuild.v1 - * @interface IGetWorkerPoolRequest - * @property {string|null} [name] GetWorkerPoolRequest name + * @interface IListWorkerPoolsRequest + * @property {string|null} [parent] ListWorkerPoolsRequest parent + * @property {number|null} [pageSize] ListWorkerPoolsRequest pageSize + * @property {string|null} [pageToken] ListWorkerPoolsRequest pageToken */ /** - * Constructs a new GetWorkerPoolRequest. + * Constructs a new ListWorkerPoolsRequest. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a GetWorkerPoolRequest. - * @implements IGetWorkerPoolRequest + * @classdesc Represents a ListWorkerPoolsRequest. + * @implements IListWorkerPoolsRequest * @constructor - * @param {google.devtools.cloudbuild.v1.IGetWorkerPoolRequest=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsRequest=} [properties] Properties to set */ - function GetWorkerPoolRequest(properties) { + function ListWorkerPoolsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15169,75 +16262,101 @@ } /** - * GetWorkerPoolRequest name. - * @member {string} name - * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * ListWorkerPoolsRequest parent. + * @member {string} parent + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest * @instance */ - GetWorkerPoolRequest.prototype.name = ""; + ListWorkerPoolsRequest.prototype.parent = ""; /** - * Creates a new GetWorkerPoolRequest instance using the specified properties. + * ListWorkerPoolsRequest pageSize. + * @member {number} pageSize + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @instance + */ + ListWorkerPoolsRequest.prototype.pageSize = 0; + + /** + * ListWorkerPoolsRequest pageToken. + * @member {string} pageToken + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @instance + */ + ListWorkerPoolsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListWorkerPoolsRequest instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest * @static - * @param {google.devtools.cloudbuild.v1.IGetWorkerPoolRequest=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.GetWorkerPoolRequest} GetWorkerPoolRequest instance + * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsRequest=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsRequest} ListWorkerPoolsRequest instance */ - GetWorkerPoolRequest.create = function create(properties) { - return new GetWorkerPoolRequest(properties); + ListWorkerPoolsRequest.create = function create(properties) { + return new ListWorkerPoolsRequest(properties); }; /** - * Encodes the specified GetWorkerPoolRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.GetWorkerPoolRequest.verify|verify} messages. + * Encodes the specified ListWorkerPoolsRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListWorkerPoolsRequest.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest * @static - * @param {google.devtools.cloudbuild.v1.IGetWorkerPoolRequest} message GetWorkerPoolRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsRequest} message ListWorkerPoolsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetWorkerPoolRequest.encode = function encode(message, writer) { + ListWorkerPoolsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified GetWorkerPoolRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.GetWorkerPoolRequest.verify|verify} messages. + * Encodes the specified ListWorkerPoolsRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListWorkerPoolsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest * @static - * @param {google.devtools.cloudbuild.v1.IGetWorkerPoolRequest} message GetWorkerPoolRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsRequest} message ListWorkerPoolsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListWorkerPoolsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetWorkerPoolRequest message from the specified reader or buffer. + * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.GetWorkerPoolRequest} GetWorkerPoolRequest + * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsRequest} ListWorkerPoolsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetWorkerPoolRequest.decode = function decode(reader, length) { + ListWorkerPoolsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.GetWorkerPoolRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -15248,107 +16367,126 @@ }; /** - * Decodes a GetWorkerPoolRequest message from the specified reader or buffer, length delimited. + * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.GetWorkerPoolRequest} GetWorkerPoolRequest + * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsRequest} ListWorkerPoolsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { + ListWorkerPoolsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetWorkerPoolRequest message. + * Verifies a ListWorkerPoolsRequest message. * @function verify - * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetWorkerPoolRequest.verify = function verify(message) { + ListWorkerPoolsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a GetWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListWorkerPoolsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.GetWorkerPoolRequest} GetWorkerPoolRequest + * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsRequest} ListWorkerPoolsRequest */ - GetWorkerPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.GetWorkerPoolRequest) + ListWorkerPoolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest) return object; - var message = new $root.google.devtools.cloudbuild.v1.GetWorkerPoolRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a GetWorkerPoolRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListWorkerPoolsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest * @static - * @param {google.devtools.cloudbuild.v1.GetWorkerPoolRequest} message GetWorkerPoolRequest + * @param {google.devtools.cloudbuild.v1.ListWorkerPoolsRequest} message ListWorkerPoolsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetWorkerPoolRequest.toObject = function toObject(message, options) { + ListWorkerPoolsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this GetWorkerPoolRequest to JSON. + * Converts this ListWorkerPoolsRequest to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.GetWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest * @instance * @returns {Object.} JSON object */ - GetWorkerPoolRequest.prototype.toJSON = function toJSON() { + ListWorkerPoolsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetWorkerPoolRequest; + return ListWorkerPoolsRequest; })(); - v1.DeleteWorkerPoolRequest = (function() { + v1.ListWorkerPoolsResponse = (function() { /** - * Properties of a DeleteWorkerPoolRequest. + * Properties of a ListWorkerPoolsResponse. * @memberof google.devtools.cloudbuild.v1 - * @interface IDeleteWorkerPoolRequest - * @property {string|null} [name] DeleteWorkerPoolRequest name + * @interface IListWorkerPoolsResponse + * @property {Array.|null} [workerPools] ListWorkerPoolsResponse workerPools + * @property {string|null} [nextPageToken] ListWorkerPoolsResponse nextPageToken */ /** - * Constructs a new DeleteWorkerPoolRequest. + * Constructs a new ListWorkerPoolsResponse. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a DeleteWorkerPoolRequest. - * @implements IDeleteWorkerPoolRequest + * @classdesc Represents a ListWorkerPoolsResponse. + * @implements IListWorkerPoolsResponse * @constructor - * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsResponse=} [properties] Properties to set */ - function DeleteWorkerPoolRequest(properties) { + function ListWorkerPoolsResponse(properties) { + this.workerPools = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15356,75 +16494,91 @@ } /** - * DeleteWorkerPoolRequest name. - * @member {string} name - * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * ListWorkerPoolsResponse workerPools. + * @member {Array.} workerPools + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse * @instance */ - DeleteWorkerPoolRequest.prototype.name = ""; + ListWorkerPoolsResponse.prototype.workerPools = $util.emptyArray; /** - * Creates a new DeleteWorkerPoolRequest instance using the specified properties. + * ListWorkerPoolsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @instance + */ + ListWorkerPoolsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListWorkerPoolsResponse instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse * @static - * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest instance + * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsResponse=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsResponse} ListWorkerPoolsResponse instance */ - DeleteWorkerPoolRequest.create = function create(properties) { - return new DeleteWorkerPoolRequest(properties); + ListWorkerPoolsResponse.create = function create(properties) { + return new ListWorkerPoolsResponse(properties); }; /** - * Encodes the specified DeleteWorkerPoolRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest.verify|verify} messages. + * Encodes the specified ListWorkerPoolsResponse message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListWorkerPoolsResponse.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse * @static - * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest} message DeleteWorkerPoolRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsResponse} message ListWorkerPoolsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteWorkerPoolRequest.encode = function encode(message, writer) { + ListWorkerPoolsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.workerPools != null && message.workerPools.length) + for (var i = 0; i < message.workerPools.length; ++i) + $root.google.devtools.cloudbuild.v1.WorkerPool.encode(message.workerPools[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified DeleteWorkerPoolRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest.verify|verify} messages. + * Encodes the specified ListWorkerPoolsResponse message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListWorkerPoolsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse * @static - * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest} message DeleteWorkerPoolRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsResponse} message ListWorkerPoolsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListWorkerPoolsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer. + * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest + * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsResponse} ListWorkerPoolsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteWorkerPoolRequest.decode = function decode(reader, length) { + ListWorkerPoolsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ListWorkerPoolsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + if (!(message.workerPools && message.workerPools.length)) + message.workerPools = []; + message.workerPools.push($root.google.devtools.cloudbuild.v1.WorkerPool.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -15435,108 +16589,135 @@ }; /** - * Decodes a DeleteWorkerPoolRequest message from the specified reader or buffer, length delimited. + * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest + * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsResponse} ListWorkerPoolsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { + ListWorkerPoolsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteWorkerPoolRequest message. + * Verifies a ListWorkerPoolsResponse message. * @function verify - * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteWorkerPoolRequest.verify = function verify(message) { + ListWorkerPoolsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.workerPools != null && message.hasOwnProperty("workerPools")) { + if (!Array.isArray(message.workerPools)) + return "workerPools: array expected"; + for (var i = 0; i < message.workerPools.length; ++i) { + var error = $root.google.devtools.cloudbuild.v1.WorkerPool.verify(message.workerPools[i]); + if (error) + return "workerPools." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a DeleteWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListWorkerPoolsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest} DeleteWorkerPoolRequest + * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsResponse} ListWorkerPoolsResponse */ - DeleteWorkerPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest) + ListWorkerPoolsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.ListWorkerPoolsResponse) return object; - var message = new $root.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.devtools.cloudbuild.v1.ListWorkerPoolsResponse(); + if (object.workerPools) { + if (!Array.isArray(object.workerPools)) + throw TypeError(".google.devtools.cloudbuild.v1.ListWorkerPoolsResponse.workerPools: array expected"); + message.workerPools = []; + for (var i = 0; i < object.workerPools.length; ++i) { + if (typeof object.workerPools[i] !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.ListWorkerPoolsResponse.workerPools: object expected"); + message.workerPools[i] = $root.google.devtools.cloudbuild.v1.WorkerPool.fromObject(object.workerPools[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a DeleteWorkerPoolRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListWorkerPoolsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse * @static - * @param {google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest} message DeleteWorkerPoolRequest + * @param {google.devtools.cloudbuild.v1.ListWorkerPoolsResponse} message ListWorkerPoolsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteWorkerPoolRequest.toObject = function toObject(message, options) { + ListWorkerPoolsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.workerPools = []; if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + object.nextPageToken = ""; + if (message.workerPools && message.workerPools.length) { + object.workerPools = []; + for (var j = 0; j < message.workerPools.length; ++j) + object.workerPools[j] = $root.google.devtools.cloudbuild.v1.WorkerPool.toObject(message.workerPools[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this DeleteWorkerPoolRequest to JSON. + * Converts this ListWorkerPoolsResponse to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse * @instance * @returns {Object.} JSON object */ - DeleteWorkerPoolRequest.prototype.toJSON = function toJSON() { + ListWorkerPoolsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteWorkerPoolRequest; + return ListWorkerPoolsResponse; })(); - v1.UpdateWorkerPoolRequest = (function() { + v1.CreateWorkerPoolOperationMetadata = (function() { /** - * Properties of an UpdateWorkerPoolRequest. + * Properties of a CreateWorkerPoolOperationMetadata. * @memberof google.devtools.cloudbuild.v1 - * @interface IUpdateWorkerPoolRequest - * @property {string|null} [name] UpdateWorkerPoolRequest name - * @property {google.devtools.cloudbuild.v1.IWorkerPool|null} [workerPool] UpdateWorkerPoolRequest workerPool + * @interface ICreateWorkerPoolOperationMetadata + * @property {string|null} [workerPool] CreateWorkerPoolOperationMetadata workerPool + * @property {google.protobuf.ITimestamp|null} [createTime] CreateWorkerPoolOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [completeTime] CreateWorkerPoolOperationMetadata completeTime */ /** - * Constructs a new UpdateWorkerPoolRequest. + * Constructs a new CreateWorkerPoolOperationMetadata. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents an UpdateWorkerPoolRequest. - * @implements IUpdateWorkerPoolRequest + * @classdesc Represents a CreateWorkerPoolOperationMetadata. + * @implements ICreateWorkerPoolOperationMetadata * @constructor - * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata=} [properties] Properties to set */ - function UpdateWorkerPoolRequest(properties) { + function CreateWorkerPoolOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15544,88 +16725,101 @@ } /** - * UpdateWorkerPoolRequest name. - * @member {string} name - * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * CreateWorkerPoolOperationMetadata workerPool. + * @member {string} workerPool + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata * @instance */ - UpdateWorkerPoolRequest.prototype.name = ""; + CreateWorkerPoolOperationMetadata.prototype.workerPool = ""; /** - * UpdateWorkerPoolRequest workerPool. - * @member {google.devtools.cloudbuild.v1.IWorkerPool|null|undefined} workerPool - * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * CreateWorkerPoolOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata * @instance */ - UpdateWorkerPoolRequest.prototype.workerPool = null; + CreateWorkerPoolOperationMetadata.prototype.createTime = null; /** - * Creates a new UpdateWorkerPoolRequest instance using the specified properties. + * CreateWorkerPoolOperationMetadata completeTime. + * @member {google.protobuf.ITimestamp|null|undefined} completeTime + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata + * @instance + */ + CreateWorkerPoolOperationMetadata.prototype.completeTime = null; + + /** + * Creates a new CreateWorkerPoolOperationMetadata instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata * @static - * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest instance + * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata} CreateWorkerPoolOperationMetadata instance */ - UpdateWorkerPoolRequest.create = function create(properties) { - return new UpdateWorkerPoolRequest(properties); + CreateWorkerPoolOperationMetadata.create = function create(properties) { + return new CreateWorkerPoolOperationMetadata(properties); }; /** - * Encodes the specified UpdateWorkerPoolRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest.verify|verify} messages. + * Encodes the specified CreateWorkerPoolOperationMetadata message. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata * @static - * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest} message UpdateWorkerPoolRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata} message CreateWorkerPoolOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateWorkerPoolRequest.encode = function encode(message, writer) { + CreateWorkerPoolOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) - $root.google.devtools.cloudbuild.v1.WorkerPool.encode(message.workerPool, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.workerPool); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.completeTime != null && Object.hasOwnProperty.call(message, "completeTime")) + $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateWorkerPoolRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest.verify|verify} messages. + * Encodes the specified CreateWorkerPoolOperationMetadata message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata * @static - * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest} message UpdateWorkerPoolRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata} message CreateWorkerPoolOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateWorkerPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateWorkerPoolOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer. + * Decodes a CreateWorkerPoolOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest + * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata} CreateWorkerPoolOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateWorkerPoolRequest.decode = function decode(reader, length) { + CreateWorkerPoolOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.workerPool = reader.string(); + break; case 2: - message.name = reader.string(); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 3: - message.workerPool = $root.google.devtools.cloudbuild.v1.WorkerPool.decode(reader, reader.uint32()); + message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -15636,121 +16830,136 @@ }; /** - * Decodes an UpdateWorkerPoolRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateWorkerPoolOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest + * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata} CreateWorkerPoolOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateWorkerPoolRequest.decodeDelimited = function decodeDelimited(reader) { + CreateWorkerPoolOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateWorkerPoolRequest message. + * Verifies a CreateWorkerPoolOperationMetadata message. * @function verify - * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateWorkerPoolRequest.verify = function verify(message) { + CreateWorkerPoolOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.workerPool != null && message.hasOwnProperty("workerPool")) { - var error = $root.google.devtools.cloudbuild.v1.WorkerPool.verify(message.workerPool); + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + if (!$util.isString(message.workerPool)) + return "workerPool: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); if (error) - return "workerPool." + error; + return "createTime." + error; + } + if (message.completeTime != null && message.hasOwnProperty("completeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completeTime); + if (error) + return "completeTime." + error; } return null; }; /** - * Creates an UpdateWorkerPoolRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateWorkerPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest} UpdateWorkerPoolRequest + * @returns {google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata} CreateWorkerPoolOperationMetadata */ - UpdateWorkerPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest) - return object; - var message = new $root.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.workerPool != null) { - if (typeof object.workerPool !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest.workerPool: object expected"); - message.workerPool = $root.google.devtools.cloudbuild.v1.WorkerPool.fromObject(object.workerPool); + CreateWorkerPoolOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata) + return object; + var message = new $root.google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata(); + if (object.workerPool != null) + message.workerPool = String(object.workerPool); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.completeTime != null) { + if (typeof object.completeTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata.completeTime: object expected"); + message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime); } return message; }; /** - * Creates a plain object from an UpdateWorkerPoolRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateWorkerPoolOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata * @static - * @param {google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest} message UpdateWorkerPoolRequest + * @param {google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata} message CreateWorkerPoolOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateWorkerPoolRequest.toObject = function toObject(message, options) { + CreateWorkerPoolOperationMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.workerPool = null; + object.workerPool = ""; + object.createTime = null; + object.completeTime = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; if (message.workerPool != null && message.hasOwnProperty("workerPool")) - object.workerPool = $root.google.devtools.cloudbuild.v1.WorkerPool.toObject(message.workerPool, options); + object.workerPool = message.workerPool; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.completeTime != null && message.hasOwnProperty("completeTime")) + object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options); return object; }; /** - * Converts this UpdateWorkerPoolRequest to JSON. + * Converts this CreateWorkerPoolOperationMetadata to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest + * @memberof google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata * @instance * @returns {Object.} JSON object */ - UpdateWorkerPoolRequest.prototype.toJSON = function toJSON() { + CreateWorkerPoolOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateWorkerPoolRequest; + return CreateWorkerPoolOperationMetadata; })(); - v1.ListWorkerPoolsRequest = (function() { + v1.UpdateWorkerPoolOperationMetadata = (function() { /** - * Properties of a ListWorkerPoolsRequest. + * Properties of an UpdateWorkerPoolOperationMetadata. * @memberof google.devtools.cloudbuild.v1 - * @interface IListWorkerPoolsRequest - * @property {string|null} [parent] ListWorkerPoolsRequest parent + * @interface IUpdateWorkerPoolOperationMetadata + * @property {string|null} [workerPool] UpdateWorkerPoolOperationMetadata workerPool + * @property {google.protobuf.ITimestamp|null} [createTime] UpdateWorkerPoolOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [completeTime] UpdateWorkerPoolOperationMetadata completeTime */ /** - * Constructs a new ListWorkerPoolsRequest. + * Constructs a new UpdateWorkerPoolOperationMetadata. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a ListWorkerPoolsRequest. - * @implements IListWorkerPoolsRequest + * @classdesc Represents an UpdateWorkerPoolOperationMetadata. + * @implements IUpdateWorkerPoolOperationMetadata * @constructor - * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsRequest=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata=} [properties] Properties to set */ - function ListWorkerPoolsRequest(properties) { + function UpdateWorkerPoolOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15758,75 +16967,101 @@ } /** - * ListWorkerPoolsRequest parent. - * @member {string} parent - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * UpdateWorkerPoolOperationMetadata workerPool. + * @member {string} workerPool + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata * @instance */ - ListWorkerPoolsRequest.prototype.parent = ""; + UpdateWorkerPoolOperationMetadata.prototype.workerPool = ""; /** - * Creates a new ListWorkerPoolsRequest instance using the specified properties. + * UpdateWorkerPoolOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata + * @instance + */ + UpdateWorkerPoolOperationMetadata.prototype.createTime = null; + + /** + * UpdateWorkerPoolOperationMetadata completeTime. + * @member {google.protobuf.ITimestamp|null|undefined} completeTime + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata + * @instance + */ + UpdateWorkerPoolOperationMetadata.prototype.completeTime = null; + + /** + * Creates a new UpdateWorkerPoolOperationMetadata instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata * @static - * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsRequest=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsRequest} ListWorkerPoolsRequest instance + * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata} UpdateWorkerPoolOperationMetadata instance */ - ListWorkerPoolsRequest.create = function create(properties) { - return new ListWorkerPoolsRequest(properties); + UpdateWorkerPoolOperationMetadata.create = function create(properties) { + return new UpdateWorkerPoolOperationMetadata(properties); }; /** - * Encodes the specified ListWorkerPoolsRequest message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListWorkerPoolsRequest.verify|verify} messages. + * Encodes the specified UpdateWorkerPoolOperationMetadata message. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata * @static - * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsRequest} message ListWorkerPoolsRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata} message UpdateWorkerPoolOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListWorkerPoolsRequest.encode = function encode(message, writer) { + UpdateWorkerPoolOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.workerPool); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.completeTime != null && Object.hasOwnProperty.call(message, "completeTime")) + $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListWorkerPoolsRequest message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListWorkerPoolsRequest.verify|verify} messages. + * Encodes the specified UpdateWorkerPoolOperationMetadata message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata * @static - * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsRequest} message ListWorkerPoolsRequest message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata} message UpdateWorkerPoolOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListWorkerPoolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateWorkerPoolOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer. + * Decodes an UpdateWorkerPoolOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsRequest} ListWorkerPoolsRequest + * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata} UpdateWorkerPoolOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListWorkerPoolsRequest.decode = function decode(reader, length) { + UpdateWorkerPoolOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.workerPool = reader.string(); + break; + case 2: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -15837,108 +17072,136 @@ }; /** - * Decodes a ListWorkerPoolsRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateWorkerPoolOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsRequest} ListWorkerPoolsRequest + * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata} UpdateWorkerPoolOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListWorkerPoolsRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateWorkerPoolOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListWorkerPoolsRequest message. + * Verifies an UpdateWorkerPoolOperationMetadata message. * @function verify - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListWorkerPoolsRequest.verify = function verify(message) { + UpdateWorkerPoolOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + if (!$util.isString(message.workerPool)) + return "workerPool: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.completeTime != null && message.hasOwnProperty("completeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completeTime); + if (error) + return "completeTime." + error; + } return null; }; /** - * Creates a ListWorkerPoolsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateWorkerPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsRequest} ListWorkerPoolsRequest + * @returns {google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata} UpdateWorkerPoolOperationMetadata */ - ListWorkerPoolsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest) + UpdateWorkerPoolOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata) return object; - var message = new $root.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest(); - if (object.parent != null) - message.parent = String(object.parent); + var message = new $root.google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata(); + if (object.workerPool != null) + message.workerPool = String(object.workerPool); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.completeTime != null) { + if (typeof object.completeTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata.completeTime: object expected"); + message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime); + } return message; }; /** - * Creates a plain object from a ListWorkerPoolsRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateWorkerPoolOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata * @static - * @param {google.devtools.cloudbuild.v1.ListWorkerPoolsRequest} message ListWorkerPoolsRequest + * @param {google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata} message UpdateWorkerPoolOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListWorkerPoolsRequest.toObject = function toObject(message, options) { + UpdateWorkerPoolOperationMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; + if (options.defaults) { + object.workerPool = ""; + object.createTime = null; + object.completeTime = null; + } + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = message.workerPool; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.completeTime != null && message.hasOwnProperty("completeTime")) + object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options); return object; }; /** - * Converts this ListWorkerPoolsRequest to JSON. + * Converts this UpdateWorkerPoolOperationMetadata to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsRequest + * @memberof google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata * @instance * @returns {Object.} JSON object */ - ListWorkerPoolsRequest.prototype.toJSON = function toJSON() { + UpdateWorkerPoolOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListWorkerPoolsRequest; + return UpdateWorkerPoolOperationMetadata; })(); - v1.ListWorkerPoolsResponse = (function() { + v1.DeleteWorkerPoolOperationMetadata = (function() { /** - * Properties of a ListWorkerPoolsResponse. + * Properties of a DeleteWorkerPoolOperationMetadata. * @memberof google.devtools.cloudbuild.v1 - * @interface IListWorkerPoolsResponse - * @property {Array.|null} [workerPools] ListWorkerPoolsResponse workerPools + * @interface IDeleteWorkerPoolOperationMetadata + * @property {string|null} [workerPool] DeleteWorkerPoolOperationMetadata workerPool + * @property {google.protobuf.ITimestamp|null} [createTime] DeleteWorkerPoolOperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [completeTime] DeleteWorkerPoolOperationMetadata completeTime */ /** - * Constructs a new ListWorkerPoolsResponse. + * Constructs a new DeleteWorkerPoolOperationMetadata. * @memberof google.devtools.cloudbuild.v1 - * @classdesc Represents a ListWorkerPoolsResponse. - * @implements IListWorkerPoolsResponse + * @classdesc Represents a DeleteWorkerPoolOperationMetadata. + * @implements IDeleteWorkerPoolOperationMetadata * @constructor - * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsResponse=} [properties] Properties to set + * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata=} [properties] Properties to set */ - function ListWorkerPoolsResponse(properties) { - this.workerPools = []; + function DeleteWorkerPoolOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15946,78 +17209,101 @@ } /** - * ListWorkerPoolsResponse workerPools. - * @member {Array.} workerPools - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * DeleteWorkerPoolOperationMetadata workerPool. + * @member {string} workerPool + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata * @instance */ - ListWorkerPoolsResponse.prototype.workerPools = $util.emptyArray; + DeleteWorkerPoolOperationMetadata.prototype.workerPool = ""; /** - * Creates a new ListWorkerPoolsResponse instance using the specified properties. + * DeleteWorkerPoolOperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata + * @instance + */ + DeleteWorkerPoolOperationMetadata.prototype.createTime = null; + + /** + * DeleteWorkerPoolOperationMetadata completeTime. + * @member {google.protobuf.ITimestamp|null|undefined} completeTime + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata + * @instance + */ + DeleteWorkerPoolOperationMetadata.prototype.completeTime = null; + + /** + * Creates a new DeleteWorkerPoolOperationMetadata instance using the specified properties. * @function create - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata * @static - * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsResponse=} [properties] Properties to set - * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsResponse} ListWorkerPoolsResponse instance + * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata=} [properties] Properties to set + * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata} DeleteWorkerPoolOperationMetadata instance */ - ListWorkerPoolsResponse.create = function create(properties) { - return new ListWorkerPoolsResponse(properties); + DeleteWorkerPoolOperationMetadata.create = function create(properties) { + return new DeleteWorkerPoolOperationMetadata(properties); }; /** - * Encodes the specified ListWorkerPoolsResponse message. Does not implicitly {@link google.devtools.cloudbuild.v1.ListWorkerPoolsResponse.verify|verify} messages. + * Encodes the specified DeleteWorkerPoolOperationMetadata message. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata * @static - * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsResponse} message ListWorkerPoolsResponse message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata} message DeleteWorkerPoolOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListWorkerPoolsResponse.encode = function encode(message, writer) { + DeleteWorkerPoolOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.workerPools != null && message.workerPools.length) - for (var i = 0; i < message.workerPools.length; ++i) - $root.google.devtools.cloudbuild.v1.WorkerPool.encode(message.workerPools[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.workerPool != null && Object.hasOwnProperty.call(message, "workerPool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.workerPool); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.completeTime != null && Object.hasOwnProperty.call(message, "completeTime")) + $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListWorkerPoolsResponse message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.ListWorkerPoolsResponse.verify|verify} messages. + * Encodes the specified DeleteWorkerPoolOperationMetadata message, length delimited. Does not implicitly {@link google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata * @static - * @param {google.devtools.cloudbuild.v1.IListWorkerPoolsResponse} message ListWorkerPoolsResponse message or plain object to encode + * @param {google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata} message DeleteWorkerPoolOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListWorkerPoolsResponse.encodeDelimited = function encodeDelimited(message, writer) { + DeleteWorkerPoolOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer. + * Decodes a DeleteWorkerPoolOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsResponse} ListWorkerPoolsResponse + * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata} DeleteWorkerPoolOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListWorkerPoolsResponse.decode = function decode(reader, length) { + DeleteWorkerPoolOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.ListWorkerPoolsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.workerPools && message.workerPools.length)) - message.workerPools = []; - message.workerPools.push($root.google.devtools.cloudbuild.v1.WorkerPool.decode(reader, reader.uint32())); + message.workerPool = reader.string(); + break; + case 2: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -16028,104 +17314,114 @@ }; /** - * Decodes a ListWorkerPoolsResponse message from the specified reader or buffer, length delimited. + * Decodes a DeleteWorkerPoolOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsResponse} ListWorkerPoolsResponse + * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata} DeleteWorkerPoolOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListWorkerPoolsResponse.decodeDelimited = function decodeDelimited(reader) { + DeleteWorkerPoolOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListWorkerPoolsResponse message. + * Verifies a DeleteWorkerPoolOperationMetadata message. * @function verify - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListWorkerPoolsResponse.verify = function verify(message) { + DeleteWorkerPoolOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.workerPools != null && message.hasOwnProperty("workerPools")) { - if (!Array.isArray(message.workerPools)) - return "workerPools: array expected"; - for (var i = 0; i < message.workerPools.length; ++i) { - var error = $root.google.devtools.cloudbuild.v1.WorkerPool.verify(message.workerPools[i]); - if (error) - return "workerPools." + error; - } + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + if (!$util.isString(message.workerPool)) + return "workerPool: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.completeTime != null && message.hasOwnProperty("completeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completeTime); + if (error) + return "completeTime." + error; } return null; }; /** - * Creates a ListWorkerPoolsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteWorkerPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.devtools.cloudbuild.v1.ListWorkerPoolsResponse} ListWorkerPoolsResponse + * @returns {google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata} DeleteWorkerPoolOperationMetadata */ - ListWorkerPoolsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.devtools.cloudbuild.v1.ListWorkerPoolsResponse) + DeleteWorkerPoolOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata) return object; - var message = new $root.google.devtools.cloudbuild.v1.ListWorkerPoolsResponse(); - if (object.workerPools) { - if (!Array.isArray(object.workerPools)) - throw TypeError(".google.devtools.cloudbuild.v1.ListWorkerPoolsResponse.workerPools: array expected"); - message.workerPools = []; - for (var i = 0; i < object.workerPools.length; ++i) { - if (typeof object.workerPools[i] !== "object") - throw TypeError(".google.devtools.cloudbuild.v1.ListWorkerPoolsResponse.workerPools: object expected"); - message.workerPools[i] = $root.google.devtools.cloudbuild.v1.WorkerPool.fromObject(object.workerPools[i]); - } + var message = new $root.google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata(); + if (object.workerPool != null) + message.workerPool = String(object.workerPool); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.completeTime != null) { + if (typeof object.completeTime !== "object") + throw TypeError(".google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata.completeTime: object expected"); + message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime); } return message; }; /** - * Creates a plain object from a ListWorkerPoolsResponse message. Also converts values to other types if specified. + * Creates a plain object from a DeleteWorkerPoolOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata * @static - * @param {google.devtools.cloudbuild.v1.ListWorkerPoolsResponse} message ListWorkerPoolsResponse + * @param {google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata} message DeleteWorkerPoolOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListWorkerPoolsResponse.toObject = function toObject(message, options) { + DeleteWorkerPoolOperationMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.workerPools = []; - if (message.workerPools && message.workerPools.length) { - object.workerPools = []; - for (var j = 0; j < message.workerPools.length; ++j) - object.workerPools[j] = $root.google.devtools.cloudbuild.v1.WorkerPool.toObject(message.workerPools[j], options); + if (options.defaults) { + object.workerPool = ""; + object.createTime = null; + object.completeTime = null; } + if (message.workerPool != null && message.hasOwnProperty("workerPool")) + object.workerPool = message.workerPool; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.completeTime != null && message.hasOwnProperty("completeTime")) + object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options); return object; }; /** - * Converts this ListWorkerPoolsResponse to JSON. + * Converts this DeleteWorkerPoolOperationMetadata to JSON. * @function toJSON - * @memberof google.devtools.cloudbuild.v1.ListWorkerPoolsResponse + * @memberof google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata * @instance * @returns {Object.} JSON object */ - ListWorkerPoolsResponse.prototype.toJSON = function toJSON() { + DeleteWorkerPoolOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListWorkerPoolsResponse; + return DeleteWorkerPoolOperationMetadata; })(); return v1; diff --git a/protos/protos.json b/protos/protos.json index b5e6908..f09d252 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -338,23 +338,121 @@ }, "CreateWorkerPool": { "requestType": "CreateWorkerPoolRequest", - "responseType": "WorkerPool" + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/workerPools", + "(google.api.http).body": "worker_pool", + "(google.api.method_signature)": "parent,worker_pool,worker_pool_id", + "(google.longrunning.operation_info).response_type": "WorkerPool", + "(google.longrunning.operation_info).metadata_type": "CreateWorkerPoolOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/workerPools", + "body": "worker_pool" + } + }, + { + "(google.api.method_signature)": "parent,worker_pool,worker_pool_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "WorkerPool", + "metadata_type": "CreateWorkerPoolOperationMetadata" + } + } + ] }, "GetWorkerPool": { "requestType": "GetWorkerPoolRequest", - "responseType": "WorkerPool" + "responseType": "WorkerPool", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/workerPools/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/workerPools/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, "DeleteWorkerPool": { "requestType": "DeleteWorkerPoolRequest", - "responseType": "google.protobuf.Empty" + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/workerPools/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "DeleteWorkerPoolOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/workerPools/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "DeleteWorkerPoolOperationMetadata" + } + } + ] }, "UpdateWorkerPool": { "requestType": "UpdateWorkerPoolRequest", - "responseType": "WorkerPool" + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{worker_pool.name=projects/*/locations/*/workerPools/*}", + "(google.api.http).body": "worker_pool", + "(google.api.method_signature)": "worker_pool,update_mask", + "(google.longrunning.operation_info).response_type": "WorkerPool", + "(google.longrunning.operation_info).metadata_type": "UpdateWorkerPoolOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{worker_pool.name=projects/*/locations/*/workerPools/*}", + "body": "worker_pool" + } + }, + { + "(google.api.method_signature)": "worker_pool,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "WorkerPool", + "metadata_type": "UpdateWorkerPoolOperationMetadata" + } + } + ] }, "ListWorkerPools": { "requestType": "ListWorkerPoolsRequest", - "responseType": "ListWorkerPoolsResponse" + "responseType": "ListWorkerPoolsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/workerPools", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/workerPools" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] } } }, @@ -1590,7 +1688,17 @@ }, "workerPool": { "type": "string", - "id": 7 + "id": 7, + "options": { + "deprecated": true + } + }, + "pool": { + "type": "PoolOption", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "logging": { "type": "LoggingMode", @@ -1613,6 +1721,17 @@ } }, "nested": { + "PoolOption": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/WorkerPool" + } + } + } + }, "VerifyOption": { "values": { "NOT_VERIFIED": 0, @@ -1681,62 +1800,88 @@ "fields": {} }, "WorkerPool": { + "options": { + "(google.api.resource).type": "cloudbuild.googleapis.com/WorkerPool", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/workerPools/{worker_pool}", + "(google.api.resource).plural": "workerPools", + "(google.api.resource).singular": "workerPool", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "oneofs": { + "config": { + "oneof": [ + "privatePoolV1Config" + ] + } + }, "fields": { "name": { "type": "string", - "id": 14 + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, - "projectId": { + "displayName": { "type": "string", "id": 2 }, - "serviceAccountEmail": { + "uid": { "type": "string", - "id": 3 + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, - "workerCount": { - "type": "int64", + "annotations": { + "keyType": "string", + "type": "string", "id": 4 }, - "workerConfig": { - "type": "WorkerConfig", - "id": 16 - }, - "regions": { - "rule": "repeated", - "type": "Region", - "id": 9 - }, "createTime": { "type": "google.protobuf.Timestamp", - "id": 11 + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "updateTime": { "type": "google.protobuf.Timestamp", - "id": 17 + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, "deleteTime": { "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "privatePoolV1Config": { + "type": "PrivatePoolV1Config", "id": 12 }, - "status": { - "type": "Status", - "id": 13 + "etag": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { - "Region": { - "values": { - "REGION_UNSPECIFIED": 0, - "US_CENTRAL1": 1, - "US_WEST1": 2, - "US_EAST1": 3, - "US_EAST4": 4 - } - }, - "Status": { + "State": { "values": { - "STATUS_UNSPECIFIED": 0, + "STATE_UNSPECIFIED": 0, "CREATING": 1, "RUNNING": 2, "DELETING": 3, @@ -1745,39 +1890,54 @@ } } }, - "WorkerConfig": { + "PrivatePoolV1Config": { "fields": { - "machineType": { - "type": "string", + "workerConfig": { + "type": "WorkerConfig", "id": 1 }, - "diskSizeGb": { - "type": "int64", + "networkConfig": { + "type": "NetworkConfig", "id": 2 - }, - "network": { - "type": "Network", - "id": 3 - }, - "tag": { - "type": "string", - "id": 4 } - } - }, - "Network": { - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "network": { - "type": "string", - "id": 2 + }, + "nested": { + "WorkerConfig": { + "fields": { + "machineType": { + "type": "string", + "id": 1 + }, + "diskSizeGb": { + "type": "int64", + "id": 2 + } + } }, - "subnetwork": { - "type": "string", - "id": 3 + "NetworkConfig": { + "fields": { + "peeredNetwork": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "egressOption": { + "type": "EgressOption", + "id": 2 + } + }, + "nested": { + "EgressOption": { + "values": { + "EGRESS_OPTION_UNSPECIFIED": 0, + "NO_PUBLIC_EGRESS": 1, + "PUBLIC_EGRESS": 2 + } + } + } } } }, @@ -1785,11 +1945,29 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } }, "workerPool": { "type": "WorkerPool", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "workerPoolId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4 } } }, @@ -1797,7 +1975,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/WorkerPool" + } } } }, @@ -1805,19 +1987,42 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/WorkerPool" + } + }, + "etag": { + "type": "string", + "id": 2 + }, + "allowMissing": { + "type": "bool", + "id": 3 + }, + "validateOnly": { + "type": "bool", + "id": 4 } } }, "UpdateWorkerPoolRequest": { "fields": { - "name": { - "type": "string", - "id": 2 - }, "workerPool": { "type": "WorkerPool", - "id": 3 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + }, + "validateOnly": { + "type": "bool", + "id": 4 } } }, @@ -1825,7 +2030,19 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 } } }, @@ -1835,6 +2052,67 @@ "rule": "repeated", "type": "WorkerPool", "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateWorkerPoolOperationMetadata": { + "fields": { + "workerPool": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/WorkerPool" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "completeTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "UpdateWorkerPoolOperationMetadata": { + "fields": { + "workerPool": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/WorkerPool" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "completeTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "DeleteWorkerPoolOperationMetadata": { + "fields": { + "workerPool": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudbuild.googleapis.com/WorkerPool" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "completeTime": { + "type": "google.protobuf.Timestamp", + "id": 3 } } } diff --git a/src/v1/cloud_build_client.ts b/src/v1/cloud_build_client.ts index dd42cff..099fc45 100644 --- a/src/v1/cloud_build_client.ts +++ b/src/v1/cloud_build_client.ts @@ -170,6 +170,9 @@ export class CloudBuildClient { cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}' ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), @@ -197,6 +200,9 @@ export class CloudBuildClient { topicPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/topics/{topic}' ), + workerPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workerPools/{worker_pool}' + ), }; // Some of the methods on this service return "paged" results, @@ -213,6 +219,11 @@ export class CloudBuildClient { 'nextPageToken', 'triggers' ), + listWorkerPools: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'workerPools' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -245,6 +256,24 @@ export class CloudBuildClient { const runBuildTriggerMetadata = protoFilesRoot.lookup( '.google.devtools.cloudbuild.v1.BuildOperationMetadata' ) as gax.protobuf.Type; + const createWorkerPoolResponse = protoFilesRoot.lookup( + '.google.devtools.cloudbuild.v1.WorkerPool' + ) as gax.protobuf.Type; + const createWorkerPoolMetadata = protoFilesRoot.lookup( + '.google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata' + ) as gax.protobuf.Type; + const deleteWorkerPoolResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteWorkerPoolMetadata = protoFilesRoot.lookup( + '.google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata' + ) as gax.protobuf.Type; + const updateWorkerPoolResponse = protoFilesRoot.lookup( + '.google.devtools.cloudbuild.v1.WorkerPool' + ) as gax.protobuf.Type; + const updateWorkerPoolMetadata = protoFilesRoot.lookup( + '.google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createBuild: new this._gaxModule.LongrunningDescriptor( @@ -262,6 +291,21 @@ export class CloudBuildClient { runBuildTriggerResponse.decode.bind(runBuildTriggerResponse), runBuildTriggerMetadata.decode.bind(runBuildTriggerMetadata) ), + createWorkerPool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createWorkerPoolResponse.decode.bind(createWorkerPoolResponse), + createWorkerPoolMetadata.decode.bind(createWorkerPoolMetadata) + ), + deleteWorkerPool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteWorkerPoolResponse.decode.bind(deleteWorkerPoolResponse), + deleteWorkerPoolMetadata.decode.bind(deleteWorkerPoolMetadata) + ), + updateWorkerPool: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateWorkerPoolResponse.decode.bind(updateWorkerPoolResponse), + updateWorkerPoolMetadata.decode.bind(updateWorkerPoolMetadata) + ), }; // Put together the default options sent with requests. @@ -1128,95 +1172,6 @@ export class CloudBuildClient { this.initialize(); return this.innerApiCalls.receiveTriggerWebhook(request, options, callback); } - createWorkerPool( - request?: protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest, - options?: CallOptions - ): Promise< - [ - protos.google.devtools.cloudbuild.v1.IWorkerPool, - protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest | undefined, - {} | undefined - ] - >; - createWorkerPool( - request: protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest, - options: CallOptions, - callback: Callback< - protos.google.devtools.cloudbuild.v1.IWorkerPool, - | protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest - | null - | undefined, - {} | null | undefined - > - ): void; - createWorkerPool( - request: protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest, - callback: Callback< - protos.google.devtools.cloudbuild.v1.IWorkerPool, - | protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Creates a `WorkerPool` to run the builds, and returns the new worker pool. - * - * This API is experimental. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * ID of the parent project. - * @param {google.devtools.cloudbuild.v1.WorkerPool} request.workerPool - * `WorkerPool` resource to create. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [WorkerPool]{@link google.devtools.cloudbuild.v1.WorkerPool}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.createWorkerPool(request); - */ - createWorkerPool( - request?: protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.devtools.cloudbuild.v1.IWorkerPool, - | protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.devtools.cloudbuild.v1.IWorkerPool, - | protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.devtools.cloudbuild.v1.IWorkerPool, - protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest | 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.createWorkerPool(request, options, callback); - } getWorkerPool( request?: protos.google.devtools.cloudbuild.v1.IGetWorkerPoolRequest, options?: CallOptions @@ -1249,15 +1204,13 @@ export class CloudBuildClient { > ): void; /** - * Returns information about a `WorkerPool`. - * - * This API is experimental. + * Returns details of a `WorkerPool`. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * The field will contain name of the resource requested, for example: - * "projects/project-1/workerPools/workerpool-name" + * Required. The name of the `WorkerPool` to retrieve. + * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1302,82 +1255,108 @@ export class CloudBuildClient { options = optionsOrCallback as CallOptions; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getWorkerPool(request, options, callback); } - deleteWorkerPool( - request?: protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest, + + createBuild( + request?: protos.google.devtools.cloudbuild.v1.ICreateBuildRequest, options?: CallOptions ): Promise< [ - protos.google.protobuf.IEmpty, - protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest | undefined, + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - deleteWorkerPool( - request: protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest, + createBuild( + request: protos.google.devtools.cloudbuild.v1.ICreateBuildRequest, options: CallOptions, callback: Callback< - protos.google.protobuf.IEmpty, - | protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest - | null - | undefined, + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - deleteWorkerPool( - request: protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest, + createBuild( + request: protos.google.devtools.cloudbuild.v1.ICreateBuildRequest, callback: Callback< - protos.google.protobuf.IEmpty, - | protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest - | null - | undefined, + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; /** - * Deletes a `WorkerPool` by its project ID and WorkerPool name. + * Starts a build with the specified configuration. * - * This API is experimental. + * This method returns a long-running `Operation`, which includes the build + * ID. Pass the build ID to `GetBuild` to determine the build status (such as + * `SUCCESS` or `FAILURE`). * * @param {Object} request * The request object that will be sent. - * @param {string} request.name - * The field will contain name of the resource requested, for example: - * "projects/project-1/workerPools/workerpool-name" + * @param {string} request.parent + * The parent resource where this build will be created. + * Format: `projects/{project}/locations/{location}` + * @param {string} request.projectId + * Required. ID of the project. + * @param {google.devtools.cloudbuild.v1.Build} request.build + * Required. Build resource to create. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. * @example - * const [response] = await client.deleteWorkerPool(request); + * const [operation] = await client.createBuild(request); + * const [response] = await operation.promise(); */ - deleteWorkerPool( - request?: protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest, + createBuild( + request?: protos.google.devtools.cloudbuild.v1.ICreateBuildRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.protobuf.IEmpty, - | protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest - | null - | undefined, + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.protobuf.IEmpty, - | protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest - | null - | undefined, + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.protobuf.IEmpty, - protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest | undefined, + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1390,84 +1369,167 @@ export class CloudBuildClient { options = optionsOrCallback as CallOptions; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project_id: request.projectId || '', + parent: request.parent || '', + }); this.initialize(); - return this.innerApiCalls.deleteWorkerPool(request, options, callback); + return this.innerApiCalls.createBuild(request, options, callback); } - updateWorkerPool( - request?: protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest, + /** + * Check the status of the long running operation returned by `createBuild()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkCreateBuildProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkCreateBuildProgress( + name: string + ): Promise< + LROperation< + protos.google.devtools.cloudbuild.v1.Build, + protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.createBuild, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.devtools.cloudbuild.v1.Build, + protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + >; + } + retryBuild( + request?: protos.google.devtools.cloudbuild.v1.IRetryBuildRequest, options?: CallOptions ): Promise< [ - protos.google.devtools.cloudbuild.v1.IWorkerPool, - protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest | undefined, + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - updateWorkerPool( - request: protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest, + retryBuild( + request: protos.google.devtools.cloudbuild.v1.IRetryBuildRequest, options: CallOptions, callback: Callback< - protos.google.devtools.cloudbuild.v1.IWorkerPool, - | protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest - | null - | undefined, + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - updateWorkerPool( - request: protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest, + retryBuild( + request: protos.google.devtools.cloudbuild.v1.IRetryBuildRequest, callback: Callback< - protos.google.devtools.cloudbuild.v1.IWorkerPool, - | protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest - | null - | undefined, + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; /** - * Update a `WorkerPool`. + * Creates a new build based on the specified build. * - * This API is experimental. + * This method creates a new build using the original build request, which may + * or may not result in an identical build. + * + * For triggered builds: + * + * * Triggered builds resolve to a precise revision; therefore a retry of a + * triggered build will result in a build that uses the same revision. + * + * For non-triggered builds that specify `RepoSource`: + * + * * If the original build built from the tip of a branch, the retried build + * will build from the tip of that branch, which may not be the same revision + * as the original build. + * * If the original build specified a commit sha or revision ID, the retried + * build will use the identical source. + * + * For builds that specify `StorageSource`: + * + * * If the original build pulled source from Google Cloud Storage without + * specifying the generation of the object, the new build will use the current + * object, which may be different from the original build source. + * * If the original build pulled source from Cloud Storage and specified the + * generation of the object, the new build will attempt to use the same + * object, which may or may not be available depending on the bucket's + * lifecycle management settings. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * The field will contain name of the resource requested, for example: - * "projects/project-1/workerPools/workerpool-name" - * @param {google.devtools.cloudbuild.v1.WorkerPool} request.workerPool - * `WorkerPool` resource to update. + * The name of the `Build` to retry. + * Format: `projects/{project}/locations/{location}/builds/{build}` + * @param {string} request.projectId + * Required. ID of the project. + * @param {string} request.id + * Required. Build ID of the original build. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [WorkerPool]{@link google.devtools.cloudbuild.v1.WorkerPool}. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. * @example - * const [response] = await client.updateWorkerPool(request); + * const [operation] = await client.retryBuild(request); + * const [response] = await operation.promise(); */ - updateWorkerPool( - request?: protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest, + retryBuild( + request?: protos.google.devtools.cloudbuild.v1.IRetryBuildRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.devtools.cloudbuild.v1.IWorkerPool, - | protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest - | null - | undefined, + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.devtools.cloudbuild.v1.IWorkerPool, - | protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest - | null - | undefined, + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.devtools.cloudbuild.v1.IWorkerPool, - protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest | undefined, + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1480,81 +1542,143 @@ export class CloudBuildClient { options = optionsOrCallback as CallOptions; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project_id: request.projectId || '', + name: request.name || '', + }); this.initialize(); - return this.innerApiCalls.updateWorkerPool(request, options, callback); + return this.innerApiCalls.retryBuild(request, options, callback); } - listWorkerPools( - request?: protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + /** + * Check the status of the long running operation returned by `retryBuild()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkRetryBuildProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkRetryBuildProgress( + name: string + ): Promise< + LROperation< + protos.google.devtools.cloudbuild.v1.Build, + protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.retryBuild, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.devtools.cloudbuild.v1.Build, + protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + >; + } + runBuildTrigger( + request?: protos.google.devtools.cloudbuild.v1.IRunBuildTriggerRequest, options?: CallOptions ): Promise< [ - protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse, - protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest | undefined, + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - listWorkerPools( - request: protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + runBuildTrigger( + request: protos.google.devtools.cloudbuild.v1.IRunBuildTriggerRequest, options: CallOptions, callback: Callback< - protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse, - | protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest - | null - | undefined, + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - listWorkerPools( - request: protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + runBuildTrigger( + request: protos.google.devtools.cloudbuild.v1.IRunBuildTriggerRequest, callback: Callback< - protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse, - | protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest - | null - | undefined, + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; /** - * List project's `WorkerPools`. - * - * This API is experimental. + * Runs a `BuildTrigger` at a particular source revision. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * ID of the parent project. + * @param {string} request.name + * The name of the `Trigger` to run. + * Format: `projects/{project}/locations/{location}/triggers/{trigger}` + * @param {string} request.projectId + * Required. ID of the project. + * @param {string} request.triggerId + * Required. ID of the trigger. + * @param {google.devtools.cloudbuild.v1.RepoSource} request.source + * Source to build against this trigger. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListWorkerPoolsResponse]{@link google.devtools.cloudbuild.v1.ListWorkerPoolsResponse}. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. * @example - * const [response] = await client.listWorkerPools(request); + * const [operation] = await client.runBuildTrigger(request); + * const [response] = await operation.promise(); */ - listWorkerPools( - request?: protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + runBuildTrigger( + request?: protos.google.devtools.cloudbuild.v1.IRunBuildTriggerRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse, - | protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest - | null - | undefined, + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse, - | protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest - | null - | undefined, + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): Promise< [ - protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse, - protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest | undefined, + LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1567,62 +1691,108 @@ export class CloudBuildClient { options = optionsOrCallback as CallOptions; } options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project_id: request.projectId || '', + name: request.name || '', + }); this.initialize(); - return this.innerApiCalls.listWorkerPools(request, options, callback); + return this.innerApiCalls.runBuildTrigger(request, options, callback); } - - createBuild( - request?: protos.google.devtools.cloudbuild.v1.ICreateBuildRequest, + /** + * Check the status of the long running operation returned by `runBuildTrigger()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkRunBuildTriggerProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkRunBuildTriggerProgress( + name: string + ): Promise< + LROperation< + protos.google.devtools.cloudbuild.v1.Build, + protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.runBuildTrigger, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.devtools.cloudbuild.v1.Build, + protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + >; + } + createWorkerPool( + request?: protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - createBuild( - request: protos.google.devtools.cloudbuild.v1.ICreateBuildRequest, + createWorkerPool( + request: protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - createBuild( - request: protos.google.devtools.cloudbuild.v1.ICreateBuildRequest, + createWorkerPool( + request: protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest, callback: Callback< LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; /** - * Starts a build with the specified configuration. - * - * This method returns a long-running `Operation`, which includes the build - * ID. Pass the build ID to `GetBuild` to determine the build status (such as - * `SUCCESS` or `FAILURE`). + * Creates a `WorkerPool`. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * The parent resource where this build will be created. - * Format: `projects/{project}/locations/{location}` - * @param {string} request.projectId - * Required. ID of the project. - * @param {google.devtools.cloudbuild.v1.Build} request.build - * Required. Build resource to create. + * Required. The parent resource where this worker pool will be created. + * Format: `projects/{project}/locations/{location}`. + * @param {google.devtools.cloudbuild.v1.WorkerPool} request.workerPool + * Required. `WorkerPool` resource to create. + * @param {string} request.workerPoolId + * Required. Immutable. The ID to use for the `WorkerPool`, which will become + * the final component of the resource name. + * + * This value should be 1-63 characters, and valid characters + * are /{@link 0-9|a-z}-/. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the response, but do not actually + * post it. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1633,25 +1803,25 @@ export class CloudBuildClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. * @example - * const [operation] = await client.createBuild(request); + * const [operation] = await client.createWorkerPool(request); * const [response] = await operation.promise(); */ - createBuild( - request?: protos.google.devtools.cloudbuild.v1.ICreateBuildRequest, + createWorkerPool( + request?: protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined >, callback?: Callback< LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined @@ -1659,8 +1829,8 @@ export class CloudBuildClient { ): Promise< [ LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined @@ -1679,14 +1849,13 @@ export class CloudBuildClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ - project_id: request.projectId || '', parent: request.parent || '', }); this.initialize(); - return this.innerApiCalls.createBuild(request, options, callback); + return this.innerApiCalls.createWorkerPool(request, options, callback); } /** - * Check the status of the long running operation returned by `createBuild()`. + * Check the status of the long running operation returned by `createWorkerPool()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -1695,17 +1864,17 @@ export class CloudBuildClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. * @example - * const decodedOperation = await checkCreateBuildProgress(name); + * const decodedOperation = await checkCreateWorkerPoolProgress(name); * console.log(decodedOperation.result); * console.log(decodedOperation.done); * console.log(decodedOperation.metadata); */ - async checkCreateBuildProgress( + async checkCreateWorkerPoolProgress( name: string ): Promise< LROperation< - protos.google.devtools.cloudbuild.v1.Build, - protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + protos.google.devtools.cloudbuild.v1.WorkerPool, + protos.google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata > > { const request = new operationsProtos.google.longrunning.GetOperationRequest( @@ -1714,88 +1883,68 @@ export class CloudBuildClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new gax.Operation( operation, - this.descriptors.longrunning.createBuild, + this.descriptors.longrunning.createWorkerPool, gax.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.devtools.cloudbuild.v1.Build, - protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + protos.google.devtools.cloudbuild.v1.WorkerPool, + protos.google.devtools.cloudbuild.v1.CreateWorkerPoolOperationMetadata >; } - retryBuild( - request?: protos.google.devtools.cloudbuild.v1.IRetryBuildRequest, + deleteWorkerPool( + request?: protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.protobuf.IEmpty, + protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - retryBuild( - request: protos.google.devtools.cloudbuild.v1.IRetryBuildRequest, + deleteWorkerPool( + request: protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.protobuf.IEmpty, + protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - retryBuild( - request: protos.google.devtools.cloudbuild.v1.IRetryBuildRequest, + deleteWorkerPool( + request: protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest, callback: Callback< LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.protobuf.IEmpty, + protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; /** - * Creates a new build based on the specified build. - * - * This method creates a new build using the original build request, which may - * or may not result in an identical build. - * - * For triggered builds: - * - * * Triggered builds resolve to a precise revision; therefore a retry of a - * triggered build will result in a build that uses the same revision. - * - * For non-triggered builds that specify `RepoSource`: - * - * * If the original build built from the tip of a branch, the retried build - * will build from the tip of that branch, which may not be the same revision - * as the original build. - * * If the original build specified a commit sha or revision ID, the retried - * build will use the identical source. - * - * For builds that specify `StorageSource`: - * - * * If the original build pulled source from Google Cloud Storage without - * specifying the generation of the object, the new build will use the current - * object, which may be different from the original build source. - * * If the original build pulled source from Cloud Storage and specified the - * generation of the object, the new build will attempt to use the same - * object, which may or may not be available depending on the bucket's - * lifecycle management settings. + * Deletes a `WorkerPool`. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * The name of the `Build` to retry. - * Format: `projects/{project}/locations/{location}/builds/{build}` - * @param {string} request.projectId - * Required. ID of the project. - * @param {string} request.id - * Required. Build ID of the original build. + * Required. The name of the `WorkerPool` to delete. + * Format: + * `projects/{project}/locations/{workerPool}/workerPools/{workerPool}`. + * @param {string} request.etag + * Optional. If this is provided, it must match the server's etag on the + * workerpool for the request to be processed. + * @param {boolean} request.allowMissing + * If set to true, and the `WorkerPool` is not found, the request will succeed + * but no action will be taken on the server. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the response, but do not actually + * post it. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1806,25 +1955,25 @@ export class CloudBuildClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. * @example - * const [operation] = await client.retryBuild(request); + * const [operation] = await client.deleteWorkerPool(request); * const [response] = await operation.promise(); */ - retryBuild( - request?: protos.google.devtools.cloudbuild.v1.IRetryBuildRequest, + deleteWorkerPool( + request?: protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.protobuf.IEmpty, + protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined >, callback?: Callback< LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.protobuf.IEmpty, + protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined @@ -1832,8 +1981,8 @@ export class CloudBuildClient { ): Promise< [ LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.protobuf.IEmpty, + protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined @@ -1852,14 +2001,13 @@ export class CloudBuildClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ - project_id: request.projectId || '', name: request.name || '', }); this.initialize(); - return this.innerApiCalls.retryBuild(request, options, callback); + return this.innerApiCalls.deleteWorkerPool(request, options, callback); } /** - * Check the status of the long running operation returned by `retryBuild()`. + * Check the status of the long running operation returned by `deleteWorkerPool()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -1868,17 +2016,17 @@ export class CloudBuildClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. * @example - * const decodedOperation = await checkRetryBuildProgress(name); + * const decodedOperation = await checkDeleteWorkerPoolProgress(name); * console.log(decodedOperation.result); * console.log(decodedOperation.done); * console.log(decodedOperation.metadata); */ - async checkRetryBuildProgress( + async checkDeleteWorkerPoolProgress( name: string ): Promise< LROperation< - protos.google.devtools.cloudbuild.v1.Build, - protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + protos.google.protobuf.Empty, + protos.google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata > > { const request = new operationsProtos.google.longrunning.GetOperationRequest( @@ -1887,64 +2035,65 @@ export class CloudBuildClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new gax.Operation( operation, - this.descriptors.longrunning.retryBuild, + this.descriptors.longrunning.deleteWorkerPool, gax.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.devtools.cloudbuild.v1.Build, - protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + protos.google.protobuf.Empty, + protos.google.devtools.cloudbuild.v1.DeleteWorkerPoolOperationMetadata >; } - runBuildTrigger( - request?: protos.google.devtools.cloudbuild.v1.IRunBuildTriggerRequest, + updateWorkerPool( + request?: protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - runBuildTrigger( - request: protos.google.devtools.cloudbuild.v1.IRunBuildTriggerRequest, + updateWorkerPool( + request: protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - runBuildTrigger( - request: protos.google.devtools.cloudbuild.v1.IRunBuildTriggerRequest, + updateWorkerPool( + request: protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest, callback: Callback< LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; /** - * Runs a `BuildTrigger` at a particular source revision. + * Updates a `WorkerPool`. * * @param {Object} request * The request object that will be sent. - * @param {string} request.name - * The name of the `Trigger` to run. - * Format: `projects/{project}/locations/{location}/triggers/{trigger}` - * @param {string} request.projectId - * Required. ID of the project. - * @param {string} request.triggerId - * Required. ID of the trigger. - * @param {google.devtools.cloudbuild.v1.RepoSource} request.source - * Source to build against this trigger. + * @param {google.devtools.cloudbuild.v1.WorkerPool} request.workerPool + * Required. The `WorkerPool` to update. + * + * The `name` field is used to identify the `WorkerPool` to update. + * Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`. + * @param {google.protobuf.FieldMask} request.updateMask + * A mask specifying which fields in `worker_pool` to update. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the response, but do not actually + * post it. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1955,25 +2104,25 @@ export class CloudBuildClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. * @example - * const [operation] = await client.runBuildTrigger(request); + * const [operation] = await client.updateWorkerPool(request); * const [response] = await operation.promise(); */ - runBuildTrigger( - request?: protos.google.devtools.cloudbuild.v1.IRunBuildTriggerRequest, + updateWorkerPool( + request?: protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined >, callback?: Callback< LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined @@ -1981,8 +2130,8 @@ export class CloudBuildClient { ): Promise< [ LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined @@ -2001,14 +2150,13 @@ export class CloudBuildClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = gax.routingHeader.fromParams({ - project_id: request.projectId || '', - name: request.name || '', + 'worker_pool.name': request.workerPool!.name || '', }); this.initialize(); - return this.innerApiCalls.runBuildTrigger(request, options, callback); + return this.innerApiCalls.updateWorkerPool(request, options, callback); } /** - * Check the status of the long running operation returned by `runBuildTrigger()`. + * Check the status of the long running operation returned by `updateWorkerPool()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -2017,17 +2165,17 @@ export class CloudBuildClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. * @example - * const decodedOperation = await checkRunBuildTriggerProgress(name); + * const decodedOperation = await checkUpdateWorkerPoolProgress(name); * console.log(decodedOperation.result); * console.log(decodedOperation.done); * console.log(decodedOperation.metadata); */ - async checkRunBuildTriggerProgress( + async checkUpdateWorkerPoolProgress( name: string ): Promise< LROperation< - protos.google.devtools.cloudbuild.v1.Build, - protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + protos.google.devtools.cloudbuild.v1.WorkerPool, + protos.google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata > > { const request = new operationsProtos.google.longrunning.GetOperationRequest( @@ -2036,12 +2184,12 @@ export class CloudBuildClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new gax.Operation( operation, - this.descriptors.longrunning.runBuildTrigger, + this.descriptors.longrunning.updateWorkerPool, gax.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.devtools.cloudbuild.v1.Build, - protos.google.devtools.cloudbuild.v1.BuildOperationMetadata + protos.google.devtools.cloudbuild.v1.WorkerPool, + protos.google.devtools.cloudbuild.v1.UpdateWorkerPoolOperationMetadata >; } listBuilds( @@ -2485,6 +2633,206 @@ export class CloudBuildClient { callSettings ) as AsyncIterable; } + listWorkerPools( + request?: protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IWorkerPool[], + protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest | null, + protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse + ] + >; + listWorkerPools( + request: protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + | protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse + | null + | undefined, + protos.google.devtools.cloudbuild.v1.IWorkerPool + > + ): void; + listWorkerPools( + request: protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + callback: PaginationCallback< + protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + | protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse + | null + | undefined, + protos.google.devtools.cloudbuild.v1.IWorkerPool + > + ): void; + /** + * Lists `WorkerPool`s. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the collection of `WorkerPools`. + * Format: `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of `WorkerPool`s to return. The service may return + * fewer than this value. If omitted, the server will use a sensible default. + * @param {string} request.pageToken + * A page token, received from a previous `ListWorkerPools` call. Provide this + * to retrieve the subsequent page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [WorkerPool]{@link google.devtools.cloudbuild.v1.WorkerPool}. + * 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 `listWorkerPoolsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkerPools( + request?: protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + | protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse + | null + | undefined, + protos.google.devtools.cloudbuild.v1.IWorkerPool + >, + callback?: PaginationCallback< + protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + | protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse + | null + | undefined, + protos.google.devtools.cloudbuild.v1.IWorkerPool + > + ): Promise< + [ + protos.google.devtools.cloudbuild.v1.IWorkerPool[], + protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest | null, + protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listWorkerPools(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the collection of `WorkerPools`. + * Format: `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of `WorkerPool`s to return. The service may return + * fewer than this value. If omitted, the server will use a sensible default. + * @param {string} request.pageToken + * A page token, received from a previous `ListWorkerPools` call. Provide this + * to retrieve the subsequent page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [WorkerPool]{@link google.devtools.cloudbuild.v1.WorkerPool} 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 `listWorkerPoolsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkerPoolsStream( + request?: protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listWorkerPools.createStream( + this.innerApiCalls.listWorkerPools as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listWorkerPools`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent of the collection of `WorkerPools`. + * Format: `projects/{project}/locations/{location}`. + * @param {number} request.pageSize + * The maximum number of `WorkerPool`s to return. The service may return + * fewer than this value. If omitted, the server will use a sensible default. + * @param {string} request.pageToken + * A page token, received from a previous `ListWorkerPools` call. Provide this + * to retrieve the subsequent page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [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 + * [WorkerPool]{@link google.devtools.cloudbuild.v1.WorkerPool}. 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.listWorkerPoolsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listWorkerPoolsAsync( + request?: protos.google.devtools.cloudbuild.v1.IListWorkerPoolsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listWorkerPools.asyncIterate( + this.innerApiCalls['listWorkerPools'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- @@ -2559,6 +2907,42 @@ export class CloudBuildClient { return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName).key; } + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + /** * Return a fully-qualified project resource name string. * @@ -2946,6 +3330,58 @@ export class CloudBuildClient { return this.pathTemplates.topicPathTemplate.match(topicName).topic; } + /** + * Return a fully-qualified workerPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} worker_pool + * @returns {string} Resource name string. + */ + workerPoolPath(project: string, location: string, workerPool: string) { + return this.pathTemplates.workerPoolPathTemplate.render({ + project: project, + location: location, + worker_pool: workerPool, + }); + } + + /** + * Parse the project from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName) + .project; + } + + /** + * Parse the location from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName) + .location; + } + + /** + * Parse the worker_pool from WorkerPool resource. + * + * @param {string} workerPoolName + * A fully-qualified path representing WorkerPool resource. + * @returns {string} A string representing the worker_pool. + */ + matchWorkerPoolFromWorkerPoolName(workerPoolName: string) { + return this.pathTemplates.workerPoolPathTemplate.match(workerPoolName) + .worker_pool; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/src/v1/gapic_metadata.json b/src/v1/gapic_metadata.json index 13b2057..254f618 100644 --- a/src/v1/gapic_metadata.json +++ b/src/v1/gapic_metadata.json @@ -45,44 +45,39 @@ "receiveTriggerWebhook" ] }, - "CreateWorkerPool": { - "methods": [ - "createWorkerPool" - ] - }, "GetWorkerPool": { "methods": [ "getWorkerPool" ] }, - "DeleteWorkerPool": { + "CreateBuild": { "methods": [ - "deleteWorkerPool" + "createBuild" ] }, - "UpdateWorkerPool": { + "RetryBuild": { "methods": [ - "updateWorkerPool" + "retryBuild" ] }, - "ListWorkerPools": { + "RunBuildTrigger": { "methods": [ - "listWorkerPools" + "runBuildTrigger" ] }, - "CreateBuild": { + "CreateWorkerPool": { "methods": [ - "createBuild" + "createWorkerPool" ] }, - "RetryBuild": { + "DeleteWorkerPool": { "methods": [ - "retryBuild" + "deleteWorkerPool" ] }, - "RunBuildTrigger": { + "UpdateWorkerPool": { "methods": [ - "runBuildTrigger" + "updateWorkerPool" ] }, "ListBuilds": { @@ -98,6 +93,13 @@ "listBuildTriggersStream", "listBuildTriggersAsync" ] + }, + "ListWorkerPools": { + "methods": [ + "listWorkerPools", + "listWorkerPoolsStream", + "listWorkerPoolsAsync" + ] } } }, @@ -139,44 +141,39 @@ "receiveTriggerWebhook" ] }, - "CreateWorkerPool": { - "methods": [ - "createWorkerPool" - ] - }, "GetWorkerPool": { "methods": [ "getWorkerPool" ] }, - "DeleteWorkerPool": { + "CreateBuild": { "methods": [ - "deleteWorkerPool" + "createBuild" ] }, - "UpdateWorkerPool": { + "RetryBuild": { "methods": [ - "updateWorkerPool" + "retryBuild" ] }, - "ListWorkerPools": { + "RunBuildTrigger": { "methods": [ - "listWorkerPools" + "runBuildTrigger" ] }, - "CreateBuild": { + "CreateWorkerPool": { "methods": [ - "createBuild" + "createWorkerPool" ] }, - "RetryBuild": { + "DeleteWorkerPool": { "methods": [ - "retryBuild" + "deleteWorkerPool" ] }, - "RunBuildTrigger": { + "UpdateWorkerPool": { "methods": [ - "runBuildTrigger" + "updateWorkerPool" ] }, "ListBuilds": { @@ -192,6 +189,13 @@ "listBuildTriggersStream", "listBuildTriggersAsync" ] + }, + "ListWorkerPools": { + "methods": [ + "listWorkerPools", + "listWorkerPoolsStream", + "listWorkerPoolsAsync" + ] } } } diff --git a/test/gapic_cloud_build_v1.ts b/test/gapic_cloud_build_v1.ts index 34f2700..40c4d45 100644 --- a/test/gapic_cloud_build_v1.ts +++ b/test/gapic_cloud_build_v1.ts @@ -1030,47 +1030,63 @@ describe('v1.CloudBuildClient', () => { }); }); - describe('createWorkerPool', () => { - it('invokes createWorkerPool without error', async () => { + describe('getWorkerPool', () => { + it('invokes getWorkerPool without error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest() + new protos.google.devtools.cloudbuild.v1.GetWorkerPoolRequest() ); - const expectedOptions = {}; + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; const expectedResponse = generateSampleMessage( new protos.google.devtools.cloudbuild.v1.WorkerPool() ); - client.innerApiCalls.createWorkerPool = stubSimpleCall(expectedResponse); - const [response] = await client.createWorkerPool(request); + client.innerApiCalls.getWorkerPool = stubSimpleCall(expectedResponse); + const [response] = await client.getWorkerPool(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.createWorkerPool as SinonStub) + (client.innerApiCalls.getWorkerPool as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes createWorkerPool without error using callback', async () => { + it('invokes getWorkerPool without error using callback', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest() + new protos.google.devtools.cloudbuild.v1.GetWorkerPoolRequest() ); - const expectedOptions = {}; + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; const expectedResponse = generateSampleMessage( new protos.google.devtools.cloudbuild.v1.WorkerPool() ); - client.innerApiCalls.createWorkerPool = + client.innerApiCalls.getWorkerPool = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createWorkerPool( + client.getWorkerPool( request, ( err?: Error | null, @@ -1087,81 +1103,111 @@ describe('v1.CloudBuildClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.createWorkerPool as SinonStub) + (client.innerApiCalls.getWorkerPool as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes createWorkerPool with error', async () => { + it('invokes getWorkerPool with error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest() + new protos.google.devtools.cloudbuild.v1.GetWorkerPoolRequest() ); - const expectedOptions = {}; + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; const expectedError = new Error('expected'); - client.innerApiCalls.createWorkerPool = stubSimpleCall( + client.innerApiCalls.getWorkerPool = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.createWorkerPool(request), expectedError); + await assert.rejects(client.getWorkerPool(request), expectedError); assert( - (client.innerApiCalls.createWorkerPool as SinonStub) + (client.innerApiCalls.getWorkerPool as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); }); - describe('getWorkerPool', () => { - it('invokes getWorkerPool without error', async () => { + describe('createBuild', () => { + it('invokes createBuild without error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.GetWorkerPoolRequest() + new protos.google.devtools.cloudbuild.v1.CreateBuildRequest() ); - const expectedOptions = {}; + request.projectId = ''; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; const expectedResponse = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.WorkerPool() + new protos.google.longrunning.Operation() ); - client.innerApiCalls.getWorkerPool = stubSimpleCall(expectedResponse); - const [response] = await client.getWorkerPool(request); + client.innerApiCalls.createBuild = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBuild(request); + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getWorkerPool as SinonStub) + (client.innerApiCalls.createBuild as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes getWorkerPool without error using callback', async () => { + it('invokes createBuild without error using callback', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.GetWorkerPoolRequest() + new protos.google.devtools.cloudbuild.v1.CreateBuildRequest() ); - const expectedOptions = {}; + request.projectId = ''; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; const expectedResponse = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.WorkerPool() + new protos.google.longrunning.Operation() ); - client.innerApiCalls.getWorkerPool = - stubSimpleCallWithCallback(expectedResponse); + client.innerApiCalls.createBuild = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.getWorkerPool( + client.createBuild( request, ( err?: Error | null, - result?: protos.google.devtools.cloudbuild.v1.IWorkerPool | null + result?: LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + > | null ) => { if (err) { reject(err); @@ -1171,171 +1217,191 @@ describe('v1.CloudBuildClient', () => { } ); }); - const response = await promise; + const operation = (await promise) as LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >; + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.getWorkerPool as SinonStub) + (client.innerApiCalls.createBuild as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes getWorkerPool with error', async () => { + it('invokes createBuild with call error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.GetWorkerPoolRequest() + new protos.google.devtools.cloudbuild.v1.CreateBuildRequest() ); - const expectedOptions = {}; + request.projectId = ''; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; const expectedError = new Error('expected'); - client.innerApiCalls.getWorkerPool = stubSimpleCall( + client.innerApiCalls.createBuild = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.getWorkerPool(request), expectedError); + await assert.rejects(client.createBuild(request), expectedError); assert( - (client.innerApiCalls.getWorkerPool as SinonStub) + (client.innerApiCalls.createBuild as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - }); - describe('deleteWorkerPool', () => { - it('invokes deleteWorkerPool without error', async () => { + it('invokes createBuild with LRO error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest() + new protos.google.devtools.cloudbuild.v1.CreateBuildRequest() ); - const expectedOptions = {}; - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() + request.projectId = ''; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createBuild = stubLongRunningCall( + undefined, + undefined, + expectedError ); - client.innerApiCalls.deleteWorkerPool = stubSimpleCall(expectedResponse); - const [response] = await client.deleteWorkerPool(request); - assert.deepStrictEqual(response, expectedResponse); + const [operation] = await client.createBuild(request); + await assert.rejects(operation.promise(), expectedError); assert( - (client.innerApiCalls.deleteWorkerPool as SinonStub) + (client.innerApiCalls.createBuild as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes deleteWorkerPool without error using callback', async () => { + it('invokes checkCreateBuildProgress without error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest() - ); - const expectedOptions = {}; const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty() + new operationsProtos.google.longrunning.Operation() ); - client.innerApiCalls.deleteWorkerPool = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteWorkerPool( - request, - ( - err?: Error | null, - result?: protos.google.protobuf.IEmpty | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteWorkerPool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateBuildProgress( + expectedResponse.name ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes deleteWorkerPool with error', async () => { + it('invokes checkCreateBuildProgress with error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest() - ); - const expectedOptions = {}; const expectedError = new Error('expected'); - client.innerApiCalls.deleteWorkerPool = stubSimpleCall( + + client.operationsClient.getOperation = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.deleteWorkerPool(request), expectedError); - assert( - (client.innerApiCalls.deleteWorkerPool as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + await assert.rejects(client.checkCreateBuildProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('updateWorkerPool', () => { - it('invokes updateWorkerPool without error', async () => { + describe('retryBuild', () => { + it('invokes retryBuild without error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest() + new protos.google.devtools.cloudbuild.v1.RetryBuildRequest() ); - const expectedOptions = {}; + request.projectId = ''; + request.name = ''; + const expectedHeaderRequestParams = 'project_id=&name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; const expectedResponse = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.WorkerPool() + new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateWorkerPool = stubSimpleCall(expectedResponse); - const [response] = await client.updateWorkerPool(request); + client.innerApiCalls.retryBuild = stubLongRunningCall(expectedResponse); + const [operation] = await client.retryBuild(request); + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateWorkerPool as SinonStub) + (client.innerApiCalls.retryBuild as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes updateWorkerPool without error using callback', async () => { + it('invokes retryBuild without error using callback', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest() + new protos.google.devtools.cloudbuild.v1.RetryBuildRequest() ); - const expectedOptions = {}; + request.projectId = ''; + request.name = ''; + const expectedHeaderRequestParams = 'project_id=&name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; const expectedResponse = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.WorkerPool() + new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateWorkerPool = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateWorkerPool( + client.innerApiCalls.retryBuild = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.retryBuild( request, ( err?: Error | null, - result?: protos.google.devtools.cloudbuild.v1.IWorkerPool | null + result?: LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + > | null ) => { if (err) { reject(err); @@ -1345,139 +1411,137 @@ describe('v1.CloudBuildClient', () => { } ); }); - const response = await promise; + const operation = (await promise) as LROperation< + protos.google.devtools.cloudbuild.v1.IBuild, + protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + >; + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.updateWorkerPool as SinonStub) + (client.innerApiCalls.retryBuild as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes updateWorkerPool with error', async () => { + it('invokes retryBuild with call error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest() + new protos.google.devtools.cloudbuild.v1.RetryBuildRequest() ); - const expectedOptions = {}; + request.projectId = ''; + request.name = ''; + const expectedHeaderRequestParams = 'project_id=&name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; const expectedError = new Error('expected'); - client.innerApiCalls.updateWorkerPool = stubSimpleCall( + client.innerApiCalls.retryBuild = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.updateWorkerPool(request), expectedError); + await assert.rejects(client.retryBuild(request), expectedError); assert( - (client.innerApiCalls.updateWorkerPool as SinonStub) + (client.innerApiCalls.retryBuild as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - }); - describe('listWorkerPools', () => { - it('invokes listWorkerPools without error', async () => { + it('invokes retryBuild with LRO error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest() + new protos.google.devtools.cloudbuild.v1.RetryBuildRequest() ); - const expectedOptions = {}; - const expectedResponse = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsResponse() + request.projectId = ''; + request.name = ''; + const expectedHeaderRequestParams = 'project_id=&name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.retryBuild = stubLongRunningCall( + undefined, + undefined, + expectedError ); - client.innerApiCalls.listWorkerPools = stubSimpleCall(expectedResponse); - const [response] = await client.listWorkerPools(request); - assert.deepStrictEqual(response, expectedResponse); + const [operation] = await client.retryBuild(request); + await assert.rejects(operation.promise(), expectedError); assert( - (client.innerApiCalls.listWorkerPools as SinonStub) + (client.innerApiCalls.retryBuild as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listWorkerPools without error using callback', async () => { + it('invokes checkRetryBuildProgress without error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest() - ); - const expectedOptions = {}; const expectedResponse = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsResponse() + new operationsProtos.google.longrunning.Operation() ); - client.innerApiCalls.listWorkerPools = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listWorkerPools( - request, - ( - err?: Error | null, - result?: protos.google.devtools.cloudbuild.v1.IListWorkerPoolsResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listWorkerPools as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRetryBuildProgress( + expectedResponse.name ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes listWorkerPools with error', async () => { + it('invokes checkRetryBuildProgress with error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest() - ); - const expectedOptions = {}; const expectedError = new Error('expected'); - client.innerApiCalls.listWorkerPools = stubSimpleCall( + + client.operationsClient.getOperation = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listWorkerPools(request), expectedError); - assert( - (client.innerApiCalls.listWorkerPools as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + await assert.rejects(client.checkRetryBuildProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('createBuild', () => { - it('invokes createBuild without error', async () => { + describe('runBuildTrigger', () => { + it('invokes runBuildTrigger without error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.CreateBuildRequest() + new protos.google.devtools.cloudbuild.v1.RunBuildTriggerRequest() ); request.projectId = ''; - request.parent = ''; - const expectedHeaderRequestParams = 'project_id=&parent='; + request.name = ''; + const expectedHeaderRequestParams = 'project_id=&name='; const expectedOptions = { otherArgs: { headers: { @@ -1488,29 +1552,30 @@ describe('v1.CloudBuildClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createBuild = stubLongRunningCall(expectedResponse); - const [operation] = await client.createBuild(request); + client.innerApiCalls.runBuildTrigger = + stubLongRunningCall(expectedResponse); + const [operation] = await client.runBuildTrigger(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.createBuild as SinonStub) + (client.innerApiCalls.runBuildTrigger as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes createBuild without error using callback', async () => { + it('invokes runBuildTrigger without error using callback', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.CreateBuildRequest() + new protos.google.devtools.cloudbuild.v1.RunBuildTriggerRequest() ); request.projectId = ''; - request.parent = ''; - const expectedHeaderRequestParams = 'project_id=&parent='; + request.name = ''; + const expectedHeaderRequestParams = 'project_id=&name='; const expectedOptions = { otherArgs: { headers: { @@ -1521,10 +1586,10 @@ describe('v1.CloudBuildClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createBuild = + client.innerApiCalls.runBuildTrigger = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createBuild( + client.runBuildTrigger( request, ( err?: Error | null, @@ -1548,24 +1613,24 @@ describe('v1.CloudBuildClient', () => { const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.createBuild as SinonStub) + (client.innerApiCalls.runBuildTrigger as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes createBuild with call error', async () => { + it('invokes runBuildTrigger with call error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.CreateBuildRequest() + new protos.google.devtools.cloudbuild.v1.RunBuildTriggerRequest() ); request.projectId = ''; - request.parent = ''; - const expectedHeaderRequestParams = 'project_id=&parent='; + request.name = ''; + const expectedHeaderRequestParams = 'project_id=&name='; const expectedOptions = { otherArgs: { headers: { @@ -1574,30 +1639,30 @@ describe('v1.CloudBuildClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.createBuild = stubLongRunningCall( + client.innerApiCalls.runBuildTrigger = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.createBuild(request), expectedError); + await assert.rejects(client.runBuildTrigger(request), expectedError); assert( - (client.innerApiCalls.createBuild as SinonStub) + (client.innerApiCalls.runBuildTrigger as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes createBuild with LRO error', async () => { + it('invokes runBuildTrigger with LRO error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.CreateBuildRequest() + new protos.google.devtools.cloudbuild.v1.RunBuildTriggerRequest() ); request.projectId = ''; - request.parent = ''; - const expectedHeaderRequestParams = 'project_id=&parent='; + request.name = ''; + const expectedHeaderRequestParams = 'project_id=&name='; const expectedOptions = { otherArgs: { headers: { @@ -1606,21 +1671,21 @@ describe('v1.CloudBuildClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.createBuild = stubLongRunningCall( + client.innerApiCalls.runBuildTrigger = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.createBuild(request); + const [operation] = await client.runBuildTrigger(request); await assert.rejects(operation.promise(), expectedError); assert( - (client.innerApiCalls.createBuild as SinonStub) + (client.innerApiCalls.runBuildTrigger as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes checkCreateBuildProgress without error', async () => { + it('invokes checkRunBuildTriggerProgress without error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1634,7 +1699,7 @@ describe('v1.CloudBuildClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateBuildProgress( + const decodedOperation = await client.checkRunBuildTriggerProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1642,7 +1707,7 @@ describe('v1.CloudBuildClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateBuildProgress with error', async () => { + it('invokes checkRunBuildTriggerProgress with error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1654,24 +1719,26 @@ describe('v1.CloudBuildClient', () => { undefined, expectedError ); - await assert.rejects(client.checkCreateBuildProgress(''), expectedError); + await assert.rejects( + client.checkRunBuildTriggerProgress(''), + expectedError + ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('retryBuild', () => { - it('invokes retryBuild without error', async () => { + describe('createWorkerPool', () => { + it('invokes createWorkerPool without error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.RetryBuildRequest() + new protos.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest() ); - request.projectId = ''; - request.name = ''; - const expectedHeaderRequestParams = 'project_id=&name='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -1682,29 +1749,29 @@ describe('v1.CloudBuildClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.retryBuild = stubLongRunningCall(expectedResponse); - const [operation] = await client.retryBuild(request); + client.innerApiCalls.createWorkerPool = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createWorkerPool(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.retryBuild as SinonStub) + (client.innerApiCalls.createWorkerPool as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes retryBuild without error using callback', async () => { + it('invokes createWorkerPool without error using callback', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.RetryBuildRequest() + new protos.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest() ); - request.projectId = ''; - request.name = ''; - const expectedHeaderRequestParams = 'project_id=&name='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -1715,16 +1782,16 @@ describe('v1.CloudBuildClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.retryBuild = + client.innerApiCalls.createWorkerPool = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.retryBuild( + client.createWorkerPool( request, ( err?: Error | null, result?: LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata > | null ) => { if (err) { @@ -1736,30 +1803,29 @@ describe('v1.CloudBuildClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.ICreateWorkerPoolOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.retryBuild as SinonStub) + (client.innerApiCalls.createWorkerPool as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes retryBuild with call error', async () => { + it('invokes createWorkerPool with call error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.RetryBuildRequest() + new protos.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest() ); - request.projectId = ''; - request.name = ''; - const expectedHeaderRequestParams = 'project_id=&name='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -1768,30 +1834,29 @@ describe('v1.CloudBuildClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.retryBuild = stubLongRunningCall( + client.innerApiCalls.createWorkerPool = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.retryBuild(request), expectedError); + await assert.rejects(client.createWorkerPool(request), expectedError); assert( - (client.innerApiCalls.retryBuild as SinonStub) + (client.innerApiCalls.createWorkerPool as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes retryBuild with LRO error', async () => { + it('invokes createWorkerPool with LRO error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.RetryBuildRequest() + new protos.google.devtools.cloudbuild.v1.CreateWorkerPoolRequest() ); - request.projectId = ''; - request.name = ''; - const expectedHeaderRequestParams = 'project_id=&name='; + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -1800,21 +1865,21 @@ describe('v1.CloudBuildClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.retryBuild = stubLongRunningCall( + client.innerApiCalls.createWorkerPool = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.retryBuild(request); + const [operation] = await client.createWorkerPool(request); await assert.rejects(operation.promise(), expectedError); assert( - (client.innerApiCalls.retryBuild as SinonStub) + (client.innerApiCalls.createWorkerPool as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes checkRetryBuildProgress without error', async () => { + it('invokes checkCreateWorkerPoolProgress without error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1828,7 +1893,7 @@ describe('v1.CloudBuildClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRetryBuildProgress( + const decodedOperation = await client.checkCreateWorkerPoolProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1836,7 +1901,7 @@ describe('v1.CloudBuildClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkRetryBuildProgress with error', async () => { + it('invokes checkCreateWorkerPoolProgress with error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1848,24 +1913,26 @@ describe('v1.CloudBuildClient', () => { undefined, expectedError ); - await assert.rejects(client.checkRetryBuildProgress(''), expectedError); + await assert.rejects( + client.checkCreateWorkerPoolProgress(''), + expectedError + ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('runBuildTrigger', () => { - it('invokes runBuildTrigger without error', async () => { - const client = new cloudbuildModule.v1.CloudBuildClient({ + describe('deleteWorkerPool', () => { + it('invokes deleteWorkerPool without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.RunBuildTriggerRequest() + new protos.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest() ); - request.projectId = ''; request.name = ''; - const expectedHeaderRequestParams = 'project_id=&name='; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1876,30 +1943,29 @@ describe('v1.CloudBuildClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.runBuildTrigger = + client.innerApiCalls.deleteWorkerPool = stubLongRunningCall(expectedResponse); - const [operation] = await client.runBuildTrigger(request); + const [operation] = await client.deleteWorkerPool(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.runBuildTrigger as SinonStub) + (client.innerApiCalls.deleteWorkerPool as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes runBuildTrigger without error using callback', async () => { + it('invokes deleteWorkerPool without error using callback', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.RunBuildTriggerRequest() + new protos.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest() ); - request.projectId = ''; request.name = ''; - const expectedHeaderRequestParams = 'project_id=&name='; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1910,16 +1976,16 @@ describe('v1.CloudBuildClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.runBuildTrigger = + client.innerApiCalls.deleteWorkerPool = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.runBuildTrigger( + client.deleteWorkerPool( request, ( err?: Error | null, result?: LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.protobuf.IEmpty, + protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata > | null ) => { if (err) { @@ -1931,30 +1997,29 @@ describe('v1.CloudBuildClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.devtools.cloudbuild.v1.IBuild, - protos.google.devtools.cloudbuild.v1.IBuildOperationMetadata + protos.google.protobuf.IEmpty, + protos.google.devtools.cloudbuild.v1.IDeleteWorkerPoolOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.runBuildTrigger as SinonStub) + (client.innerApiCalls.deleteWorkerPool as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes runBuildTrigger with call error', async () => { + it('invokes deleteWorkerPool with call error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.RunBuildTriggerRequest() + new protos.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest() ); - request.projectId = ''; request.name = ''; - const expectedHeaderRequestParams = 'project_id=&name='; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1963,30 +2028,29 @@ describe('v1.CloudBuildClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.runBuildTrigger = stubLongRunningCall( + client.innerApiCalls.deleteWorkerPool = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.runBuildTrigger(request), expectedError); + await assert.rejects(client.deleteWorkerPool(request), expectedError); assert( - (client.innerApiCalls.runBuildTrigger as SinonStub) + (client.innerApiCalls.deleteWorkerPool as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes runBuildTrigger with LRO error', async () => { + it('invokes deleteWorkerPool with LRO error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.RunBuildTriggerRequest() + new protos.google.devtools.cloudbuild.v1.DeleteWorkerPoolRequest() ); - request.projectId = ''; request.name = ''; - const expectedHeaderRequestParams = 'project_id=&name='; + const expectedHeaderRequestParams = 'name='; const expectedOptions = { otherArgs: { headers: { @@ -1995,21 +2059,21 @@ describe('v1.CloudBuildClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.runBuildTrigger = stubLongRunningCall( + client.innerApiCalls.deleteWorkerPool = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.runBuildTrigger(request); + const [operation] = await client.deleteWorkerPool(request); await assert.rejects(operation.promise(), expectedError); assert( - (client.innerApiCalls.runBuildTrigger as SinonStub) + (client.innerApiCalls.deleteWorkerPool as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes checkRunBuildTriggerProgress without error', async () => { + it('invokes checkDeleteWorkerPoolProgress without error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2023,7 +2087,7 @@ describe('v1.CloudBuildClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkRunBuildTriggerProgress( + const decodedOperation = await client.checkDeleteWorkerPoolProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -2031,7 +2095,7 @@ describe('v1.CloudBuildClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkRunBuildTriggerProgress with error', async () => { + it('invokes checkDeleteWorkerPoolProgress with error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2044,7 +2108,205 @@ describe('v1.CloudBuildClient', () => { expectedError ); await assert.rejects( - client.checkRunBuildTriggerProgress(''), + client.checkDeleteWorkerPoolProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateWorkerPool', () => { + it('invokes updateWorkerPool without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest() + ); + request.workerPool = {}; + request.workerPool.name = ''; + const expectedHeaderRequestParams = 'worker_pool.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateWorkerPool = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateWorkerPool(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateWorkerPool as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateWorkerPool without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest() + ); + request.workerPool = {}; + request.workerPool.name = ''; + const expectedHeaderRequestParams = 'worker_pool.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateWorkerPool = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateWorkerPool( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.devtools.cloudbuild.v1.IWorkerPool, + protos.google.devtools.cloudbuild.v1.IUpdateWorkerPoolOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateWorkerPool as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateWorkerPool with call error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest() + ); + request.workerPool = {}; + request.workerPool.name = ''; + const expectedHeaderRequestParams = 'worker_pool.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWorkerPool = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateWorkerPool(request), expectedError); + assert( + (client.innerApiCalls.updateWorkerPool as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateWorkerPool with LRO error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.UpdateWorkerPoolRequest() + ); + request.workerPool = {}; + request.workerPool.name = ''; + const expectedHeaderRequestParams = 'worker_pool.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWorkerPool = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateWorkerPool(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.updateWorkerPool as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkUpdateWorkerPoolProgress without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateWorkerPoolProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateWorkerPoolProgress with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateWorkerPoolProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); @@ -2237,10 +2499,320 @@ describe('v1.CloudBuildClient', () => { ); const stream = client.listBuildsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.devtools.cloudbuild.v1.Build[] = []; + const responses: protos.google.devtools.cloudbuild.v1.Build[] = []; + stream.on( + 'data', + (response: protos.google.devtools.cloudbuild.v1.Build) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listBuilds.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBuilds, request) + ); + assert.strictEqual( + (client.descriptors.page.listBuilds.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listBuilds without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildsRequest() + ); + request.projectId = ''; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), + generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), + generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), + ]; + client.descriptors.page.listBuilds.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.devtools.cloudbuild.v1.IBuild[] = []; + const iterable = client.listBuildsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBuilds.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listBuilds.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listBuilds with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildsRequest() + ); + request.projectId = ''; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listBuilds.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listBuildsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.devtools.cloudbuild.v1.IBuild[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBuilds.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listBuilds.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listBuildTriggers', () => { + it('invokes listBuildTriggers without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + ); + request.projectId = ''; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + ]; + client.innerApiCalls.listBuildTriggers = stubSimpleCall(expectedResponse); + const [response] = await client.listBuildTriggers(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listBuildTriggers as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listBuildTriggers without error using callback', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + ); + request.projectId = ''; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + ]; + client.innerApiCalls.listBuildTriggers = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBuildTriggers( + request, + ( + err?: Error | null, + result?: protos.google.devtools.cloudbuild.v1.IBuildTrigger[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listBuildTriggers as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listBuildTriggers with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + ); + request.projectId = ''; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listBuildTriggers = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listBuildTriggers(request), expectedError); + assert( + (client.innerApiCalls.listBuildTriggers as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listBuildTriggersStream without error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + ); + request.projectId = ''; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + ]; + client.descriptors.page.listBuildTriggers.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listBuildTriggersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devtools.cloudbuild.v1.BuildTrigger[] = + []; + stream.on( + 'data', + (response: protos.google.devtools.cloudbuild.v1.BuildTrigger) => { + 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.listBuildTriggers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBuildTriggers, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listBuildTriggers.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listBuildTriggersStream with error', async () => { + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + ); + request.projectId = ''; + request.parent = ''; + const expectedHeaderRequestParams = 'project_id=&parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listBuildTriggers.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listBuildTriggersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.devtools.cloudbuild.v1.BuildTrigger[] = + []; stream.on( 'data', - (response: protos.google.devtools.cloudbuild.v1.Build) => { + (response: protos.google.devtools.cloudbuild.v1.BuildTrigger) => { responses.push(response); } ); @@ -2253,109 +2825,114 @@ describe('v1.CloudBuildClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listBuilds.createStream as SinonStub) + (client.descriptors.page.listBuildTriggers.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listBuilds, request) + .calledWith(client.innerApiCalls.listBuildTriggers, request) ); assert.strictEqual( - (client.descriptors.page.listBuilds.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listBuildTriggers.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listBuilds without error', async () => { + it('uses async iteration with listBuildTriggers without error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.ListBuildsRequest() + new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() ); request.projectId = ''; request.parent = ''; const expectedHeaderRequestParams = 'project_id=&parent='; const expectedResponse = [ - generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), - generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), - generateSampleMessage(new protos.google.devtools.cloudbuild.v1.Build()), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), + generateSampleMessage( + new protos.google.devtools.cloudbuild.v1.BuildTrigger() + ), ]; - client.descriptors.page.listBuilds.asyncIterate = + client.descriptors.page.listBuildTriggers.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.devtools.cloudbuild.v1.IBuild[] = []; - const iterable = client.listBuildsAsync(request); + const responses: protos.google.devtools.cloudbuild.v1.IBuildTrigger[] = + []; + const iterable = client.listBuildTriggersAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listBuilds.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listBuildTriggers.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listBuilds.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listBuildTriggers.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listBuilds with error', async () => { + it('uses async iteration with listBuildTriggers with error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.ListBuildsRequest() + new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() ); request.projectId = ''; request.parent = ''; const expectedHeaderRequestParams = 'project_id=&parent='; const expectedError = new Error('expected'); - client.descriptors.page.listBuilds.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listBuildsAsync(request); + client.descriptors.page.listBuildTriggers.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBuildTriggersAsync(request); await assert.rejects(async () => { - const responses: protos.google.devtools.cloudbuild.v1.IBuild[] = []; + const responses: protos.google.devtools.cloudbuild.v1.IBuildTrigger[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listBuilds.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.descriptors.page.listBuildTriggers.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listBuilds.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], + ( + client.descriptors.page.listBuildTriggers.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); }); - describe('listBuildTriggers', () => { - it('invokes listBuildTriggers without error', async () => { + describe('listWorkerPools', () => { + it('invokes listWorkerPools without error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest() ); - request.projectId = ''; request.parent = ''; - const expectedHeaderRequestParams = 'project_id=&parent='; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -2365,37 +2942,36 @@ describe('v1.CloudBuildClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.BuildTrigger() + new protos.google.devtools.cloudbuild.v1.WorkerPool() ), generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.BuildTrigger() + new protos.google.devtools.cloudbuild.v1.WorkerPool() ), generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.BuildTrigger() + new protos.google.devtools.cloudbuild.v1.WorkerPool() ), ]; - client.innerApiCalls.listBuildTriggers = stubSimpleCall(expectedResponse); - const [response] = await client.listBuildTriggers(request); + client.innerApiCalls.listWorkerPools = stubSimpleCall(expectedResponse); + const [response] = await client.listWorkerPools(request); assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listBuildTriggers as SinonStub) + (client.innerApiCalls.listWorkerPools as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listBuildTriggers without error using callback', async () => { + it('invokes listWorkerPools without error using callback', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest() ); - request.projectId = ''; request.parent = ''; - const expectedHeaderRequestParams = 'project_id=&parent='; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -2405,23 +2981,23 @@ describe('v1.CloudBuildClient', () => { }; const expectedResponse = [ generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.BuildTrigger() + new protos.google.devtools.cloudbuild.v1.WorkerPool() ), generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.BuildTrigger() + new protos.google.devtools.cloudbuild.v1.WorkerPool() ), generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.BuildTrigger() + new protos.google.devtools.cloudbuild.v1.WorkerPool() ), ]; - client.innerApiCalls.listBuildTriggers = + client.innerApiCalls.listWorkerPools = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listBuildTriggers( + client.listWorkerPools( request, ( err?: Error | null, - result?: protos.google.devtools.cloudbuild.v1.IBuildTrigger[] | null + result?: protos.google.devtools.cloudbuild.v1.IWorkerPool[] | null ) => { if (err) { reject(err); @@ -2434,24 +3010,23 @@ describe('v1.CloudBuildClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); assert( - (client.innerApiCalls.listBuildTriggers as SinonStub) + (client.innerApiCalls.listWorkerPools as SinonStub) .getCall(0) .calledWith(request, expectedOptions /*, callback defined above */) ); }); - it('invokes listBuildTriggers with error', async () => { + it('invokes listWorkerPools with error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest() ); - request.projectId = ''; request.parent = ''; - const expectedHeaderRequestParams = 'project_id=&parent='; + const expectedHeaderRequestParams = 'parent='; const expectedOptions = { otherArgs: { headers: { @@ -2460,50 +3035,48 @@ describe('v1.CloudBuildClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.listBuildTriggers = stubSimpleCall( + client.innerApiCalls.listWorkerPools = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listBuildTriggers(request), expectedError); + await assert.rejects(client.listWorkerPools(request), expectedError); assert( - (client.innerApiCalls.listBuildTriggers as SinonStub) + (client.innerApiCalls.listWorkerPools as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes listBuildTriggersStream without error', async () => { + it('invokes listWorkerPoolsStream without error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest() ); - request.projectId = ''; request.parent = ''; - const expectedHeaderRequestParams = 'project_id=&parent='; + const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.BuildTrigger() + new protos.google.devtools.cloudbuild.v1.WorkerPool() ), generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.BuildTrigger() + new protos.google.devtools.cloudbuild.v1.WorkerPool() ), generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.BuildTrigger() + new protos.google.devtools.cloudbuild.v1.WorkerPool() ), ]; - client.descriptors.page.listBuildTriggers.createStream = + client.descriptors.page.listWorkerPools.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBuildTriggersStream(request); + const stream = client.listWorkerPoolsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.devtools.cloudbuild.v1.BuildTrigger[] = - []; + const responses: protos.google.devtools.cloudbuild.v1.WorkerPool[] = []; stream.on( 'data', - (response: protos.google.devtools.cloudbuild.v1.BuildTrigger) => { + (response: protos.google.devtools.cloudbuild.v1.WorkerPool) => { responses.push(response); } ); @@ -2517,40 +3090,38 @@ describe('v1.CloudBuildClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listBuildTriggers.createStream as SinonStub) + (client.descriptors.page.listWorkerPools.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listBuildTriggers, request) + .calledWith(client.innerApiCalls.listWorkerPools, request) ); assert.strictEqual( ( - client.descriptors.page.listBuildTriggers.createStream as SinonStub + client.descriptors.page.listWorkerPools.createStream as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('invokes listBuildTriggersStream with error', async () => { + it('invokes listWorkerPoolsStream with error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest() ); - request.projectId = ''; request.parent = ''; - const expectedHeaderRequestParams = 'project_id=&parent='; + const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listBuildTriggers.createStream = + client.descriptors.page.listWorkerPools.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listBuildTriggersStream(request); + const stream = client.listWorkerPoolsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.devtools.cloudbuild.v1.BuildTrigger[] = - []; + const responses: protos.google.devtools.cloudbuild.v1.WorkerPool[] = []; stream.on( 'data', - (response: protos.google.devtools.cloudbuild.v1.BuildTrigger) => { + (response: protos.google.devtools.cloudbuild.v1.WorkerPool) => { responses.push(response); } ); @@ -2563,82 +3134,79 @@ describe('v1.CloudBuildClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listBuildTriggers.createStream as SinonStub) + (client.descriptors.page.listWorkerPools.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listBuildTriggers, request) + .calledWith(client.innerApiCalls.listWorkerPools, request) ); assert.strictEqual( ( - client.descriptors.page.listBuildTriggers.createStream as SinonStub + client.descriptors.page.listWorkerPools.createStream as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listBuildTriggers without error', async () => { + it('uses async iteration with listWorkerPools without error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest() ); - request.projectId = ''; request.parent = ''; - const expectedHeaderRequestParams = 'project_id=&parent='; + const expectedHeaderRequestParams = 'parent='; const expectedResponse = [ generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.BuildTrigger() + new protos.google.devtools.cloudbuild.v1.WorkerPool() ), generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.BuildTrigger() + new protos.google.devtools.cloudbuild.v1.WorkerPool() ), generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.BuildTrigger() + new protos.google.devtools.cloudbuild.v1.WorkerPool() ), ]; - client.descriptors.page.listBuildTriggers.asyncIterate = + client.descriptors.page.listWorkerPools.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.devtools.cloudbuild.v1.IBuildTrigger[] = - []; - const iterable = client.listBuildTriggersAsync(request); + const responses: protos.google.devtools.cloudbuild.v1.IWorkerPool[] = []; + const iterable = client.listWorkerPoolsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listBuildTriggers.asyncIterate as SinonStub + client.descriptors.page.listWorkerPools.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert.strictEqual( ( - client.descriptors.page.listBuildTriggers.asyncIterate as SinonStub + client.descriptors.page.listWorkerPools.asyncIterate as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); - it('uses async iteration with listBuildTriggers with error', async () => { + it('uses async iteration with listWorkerPools with error', async () => { const client = new cloudbuildModule.v1.CloudBuildClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.devtools.cloudbuild.v1.ListBuildTriggersRequest() + new protos.google.devtools.cloudbuild.v1.ListWorkerPoolsRequest() ); - request.projectId = ''; request.parent = ''; - const expectedHeaderRequestParams = 'project_id=&parent='; + const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listBuildTriggers.asyncIterate = + client.descriptors.page.listWorkerPools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBuildTriggersAsync(request); + const iterable = client.listWorkerPoolsAsync(request); await assert.rejects(async () => { - const responses: protos.google.devtools.cloudbuild.v1.IBuildTrigger[] = + const responses: protos.google.devtools.cloudbuild.v1.IWorkerPool[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -2646,13 +3214,13 @@ describe('v1.CloudBuildClient', () => { }); assert.deepStrictEqual( ( - client.descriptors.page.listBuildTriggers.asyncIterate as SinonStub + client.descriptors.page.listWorkerPools.asyncIterate as SinonStub ).getCall(0).args[1], request ); assert.strictEqual( ( - client.descriptors.page.listBuildTriggers.asyncIterate as SinonStub + client.descriptors.page.listWorkerPools.asyncIterate as SinonStub ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); @@ -2736,6 +3304,55 @@ describe('v1.CloudBuildClient', () => { }); }); + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('project', () => { const fakePath = '/rendered/path/project'; const expectedParameters = { @@ -3249,5 +3866,69 @@ describe('v1.CloudBuildClient', () => { ); }); }); + + describe('workerPool', () => { + const fakePath = '/rendered/path/workerPool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + worker_pool: 'workerPoolValue', + }; + const client = new cloudbuildModule.v1.CloudBuildClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.workerPoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.workerPoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('workerPoolPath', () => { + const result = client.workerPoolPath( + 'projectValue', + 'locationValue', + 'workerPoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.workerPoolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromWorkerPoolName', () => { + const result = client.matchProjectFromWorkerPoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromWorkerPoolName', () => { + const result = client.matchLocationFromWorkerPoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchWorkerPoolFromWorkerPoolName', () => { + const result = client.matchWorkerPoolFromWorkerPoolName(fakePath); + assert.strictEqual(result, 'workerPoolValue'); + assert( + (client.pathTemplates.workerPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); });