From 9d2bbf07d01239b5a8b86624cd89baf3a01b09e9 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 7 Apr 2023 19:48:12 -0700 Subject: [PATCH 1/2] docs: [workstations] Adjust wording around service accounts and control planes (#4156) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add client libraries for Workstations v1 PiperOrigin-RevId: 522193471 Source-Link: https://github.com/googleapis/googleapis/commit/5cb1253fe172d0ea06734d6274a217b6273b02dd Source-Link: https://github.com/googleapis/googleapis-gen/commit/c806967c017f4f02811abaacb9c91bc2861572b1 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXdvcmtzdGF0aW9ucy8uT3dsQm90LnlhbWwiLCJoIjoiYzgwNjk2N2MwMTdmNGYwMjgxMWFiYWFjYjljOTFiYzI4NjE1NzJiMSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: Adjust wording around service accounts and control planes PiperOrigin-RevId: 522482855 Source-Link: https://github.com/googleapis/googleapis/commit/f0cec0b201737db7e99ff1bc6dac09e16ed2ce65 Source-Link: https://github.com/googleapis/googleapis-gen/commit/480b18a2766a287abb5d003bc79daa4d6bff5727 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXdvcmtzdGF0aW9ucy8uT3dsQm90LnlhbWwiLCJoIjoiNDgwYjE4YTI3NjZhMjg3YWJiNWQwMDNiYzc5ZGFhNGQ2YmZmNTcyNyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: Daniel Bankhead --- packages/google-cloud-workstations/README.md | 20 + .../cloud/workstations/v1/workstations.proto | 1163 ++ .../workstations/v1beta/workstations.proto | 9 +- .../protos/protos.d.ts | 5027 +++++++ .../protos/protos.js | 12429 ++++++++++++++++ .../protos/protos.json | 1590 ++ .../samples/README.md | 360 + ...metadata.google.cloud.workstations.v1.json | 983 ++ .../v1/workstations.create_workstation.js | 77 + ...workstations.create_workstation_cluster.js | 77 + .../workstations.create_workstation_config.js | 77 + .../v1/workstations.delete_workstation.js | 72 + ...workstations.delete_workstation_cluster.js | 77 + .../workstations.delete_workstation_config.js | 77 + .../v1/workstations.generate_access_token.js | 75 + .../v1/workstations.get_workstation.js | 61 + .../workstations.get_workstation_cluster.js | 61 + .../v1/workstations.get_workstation_config.js | 61 + ...tations.list_usable_workstation_configs.js | 71 + .../workstations.list_usable_workstations.js | 71 + .../workstations.list_workstation_clusters.js | 71 + .../workstations.list_workstation_configs.js | 71 + .../v1/workstations.list_workstations.js | 71 + .../v1/workstations.start_workstation.js | 72 + .../v1/workstations.stop_workstation.js | 72 + .../v1/workstations.update_workstation.js | 77 + ...workstations.update_workstation_cluster.js | 78 + .../workstations.update_workstation_config.js | 77 + .../google-cloud-workstations/src/index.ts | 5 +- .../src/v1/gapic_metadata.json | 243 + .../google-cloud-workstations/src/v1/index.ts | 19 + .../src/v1/workstations_client.ts | 4296 ++++++ .../src/v1/workstations_client_config.json | 138 + .../src/v1/workstations_proto_list.json | 3 + .../test/gapic_workstations_v1.ts | 5891 ++++++++ 35 files changed, 33616 insertions(+), 6 deletions(-) create mode 100644 packages/google-cloud-workstations/protos/google/cloud/workstations/v1/workstations.proto create mode 100644 packages/google-cloud-workstations/samples/generated/v1/snippet_metadata.google.cloud.workstations.v1.json create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation_cluster.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation_config.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation_cluster.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation_config.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.generate_access_token.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation_cluster.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation_config.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.list_usable_workstation_configs.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.list_usable_workstations.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstation_clusters.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstation_configs.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstations.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.start_workstation.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.stop_workstation.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation_cluster.js create mode 100644 packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation_config.js create mode 100644 packages/google-cloud-workstations/src/v1/gapic_metadata.json create mode 100644 packages/google-cloud-workstations/src/v1/index.ts create mode 100644 packages/google-cloud-workstations/src/v1/workstations_client.ts create mode 100644 packages/google-cloud-workstations/src/v1/workstations_client_config.json create mode 100644 packages/google-cloud-workstations/src/v1/workstations_proto_list.json create mode 100644 packages/google-cloud-workstations/test/gapic_workstations_v1.ts diff --git a/packages/google-cloud-workstations/README.md b/packages/google-cloud-workstations/README.md index 1dcba735be0..9348b0a6173 100644 --- a/packages/google-cloud-workstations/README.md +++ b/packages/google-cloud-workstations/README.md @@ -107,6 +107,26 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Workstations.create_workstation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation.js,samples/README.md) | +| Workstations.create_workstation_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation_cluster.js,samples/README.md) | +| Workstations.create_workstation_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation_config.js,samples/README.md) | +| Workstations.delete_workstation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation.js,samples/README.md) | +| Workstations.delete_workstation_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation_cluster.js,samples/README.md) | +| Workstations.delete_workstation_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation_config.js,samples/README.md) | +| Workstations.generate_access_token | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.generate_access_token.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.generate_access_token.js,samples/README.md) | +| Workstations.get_workstation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation.js,samples/README.md) | +| Workstations.get_workstation_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation_cluster.js,samples/README.md) | +| Workstations.get_workstation_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation_config.js,samples/README.md) | +| Workstations.list_usable_workstation_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.list_usable_workstation_configs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.list_usable_workstation_configs.js,samples/README.md) | +| Workstations.list_usable_workstations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.list_usable_workstations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.list_usable_workstations.js,samples/README.md) | +| Workstations.list_workstation_clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstation_clusters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstation_clusters.js,samples/README.md) | +| Workstations.list_workstation_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstation_configs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstation_configs.js,samples/README.md) | +| Workstations.list_workstations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstations.js,samples/README.md) | +| Workstations.start_workstation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.start_workstation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.start_workstation.js,samples/README.md) | +| Workstations.stop_workstation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.stop_workstation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.stop_workstation.js,samples/README.md) | +| Workstations.update_workstation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation.js,samples/README.md) | +| Workstations.update_workstation_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation_cluster.js,samples/README.md) | +| Workstations.update_workstation_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation_config.js,samples/README.md) | | Workstations.create_workstation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1beta/workstations.create_workstation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1beta/workstations.create_workstation.js,samples/README.md) | | Workstations.create_workstation_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1beta/workstations.create_workstation_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1beta/workstations.create_workstation_cluster.js,samples/README.md) | | Workstations.create_workstation_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1beta/workstations.create_workstation_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1beta/workstations.create_workstation_config.js,samples/README.md) | diff --git a/packages/google-cloud-workstations/protos/google/cloud/workstations/v1/workstations.proto b/packages/google-cloud-workstations/protos/google/cloud/workstations/v1/workstations.proto new file mode 100644 index 00000000000..7425dd67ea0 --- /dev/null +++ b/packages/google-cloud-workstations/protos/google/cloud/workstations/v1/workstations.proto @@ -0,0 +1,1163 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.workstations.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option go_package = "cloud.google.com/go/workstations/apiv1/workstationspb;workstationspb"; +option java_multiple_files = true; +option java_outer_classname = "WorkstationsProto"; +option java_package = "com.google.cloud.workstations.v1"; + +// Service for interacting with Cloud Workstations. +service Workstations { + option (google.api.default_host) = "workstations.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Returns the requested workstation cluster. + rpc GetWorkstationCluster(GetWorkstationClusterRequest) + returns (WorkstationCluster) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/workstationClusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns all workstation clusters in the specified location. + rpc ListWorkstationClusters(ListWorkstationClustersRequest) + returns (ListWorkstationClustersResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/workstationClusters" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new workstation cluster. + rpc CreateWorkstationCluster(CreateWorkstationClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/workstationClusters" + body: "workstation_cluster" + }; + option (google.api.method_signature) = + "parent,workstation_cluster,workstation_cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "WorkstationCluster" + metadata_type: "OperationMetadata" + }; + } + + // Updates an existing workstation cluster. + rpc UpdateWorkstationCluster(UpdateWorkstationClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{workstation_cluster.name=projects/*/locations/*/workstationClusters/*}" + body: "workstation_cluster" + }; + option (google.api.method_signature) = "workstation_cluster,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "WorkstationCluster" + metadata_type: "OperationMetadata" + }; + } + + // Deletes the specified workstation cluster. + rpc DeleteWorkstationCluster(DeleteWorkstationClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/workstationClusters/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "WorkstationCluster" + metadata_type: "OperationMetadata" + }; + } + + // Returns the requested workstation configuration. + rpc GetWorkstationConfig(GetWorkstationConfigRequest) + returns (WorkstationConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns all WorkstationConfigs in the specified cluster. + rpc ListWorkstationConfigs(ListWorkstationConfigsRequest) + returns (ListWorkstationConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns all workstation configurations in the specified cluster on which + // the caller has the "workstations.workstation.create" permission. + rpc ListUsableWorkstationConfigs(ListUsableWorkstationConfigsRequest) + returns (ListUsableWorkstationConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs:listUsable" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new workstation configuration. + rpc CreateWorkstationConfig(CreateWorkstationConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs" + body: "workstation_config" + }; + option (google.api.method_signature) = + "parent,workstation_config,workstation_config_id"; + option (google.longrunning.operation_info) = { + response_type: "WorkstationConfig" + metadata_type: "OperationMetadata" + }; + } + + // Updates an existing workstation configuration. + rpc UpdateWorkstationConfig(UpdateWorkstationConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{workstation_config.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}" + body: "workstation_config" + }; + option (google.api.method_signature) = "workstation_config,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "WorkstationConfig" + metadata_type: "OperationMetadata" + }; + } + + // Deletes the specified workstation configuration. + rpc DeleteWorkstationConfig(DeleteWorkstationConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "WorkstationConfig" + metadata_type: "OperationMetadata" + }; + } + + // Returns the requested workstation. + rpc GetWorkstation(GetWorkstationRequest) returns (Workstation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Returns all Workstations using the specified config. + rpc ListWorkstations(ListWorkstationsRequest) + returns (ListWorkstationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations" + }; + option (google.api.method_signature) = "parent"; + } + + // Returns all Workstations using the specified config on which the caller has + // the "workstations.workstations.use" permission. + rpc ListUsableWorkstations(ListUsableWorkstationsRequest) + returns (ListUsableWorkstationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations:listUsable" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new workstation. + rpc CreateWorkstation(CreateWorkstationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations" + body: "workstation" + }; + option (google.api.method_signature) = "parent,workstation,workstation_id"; + option (google.longrunning.operation_info) = { + response_type: "Workstation" + metadata_type: "OperationMetadata" + }; + } + + // Updates an existing workstation. + rpc UpdateWorkstation(UpdateWorkstationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{workstation.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}" + body: "workstation" + }; + option (google.api.method_signature) = "workstation,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Workstation" + metadata_type: "OperationMetadata" + }; + } + + // Deletes the specified workstation. + rpc DeleteWorkstation(DeleteWorkstationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Workstation" + metadata_type: "OperationMetadata" + }; + } + + // Starts running a workstation so that users can connect to it. + rpc StartWorkstation(StartWorkstationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:start" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Workstation" + metadata_type: "OperationMetadata" + }; + } + + // Stops running a workstation, reducing costs. + rpc StopWorkstation(StopWorkstationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:stop" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Workstation" + metadata_type: "OperationMetadata" + }; + } + + // Returns a short-lived credential that can be used to send authenticated and + // authorized traffic to a workstation. + rpc GenerateAccessToken(GenerateAccessTokenRequest) + returns (GenerateAccessTokenResponse) { + option (google.api.http) = { + post: "/v1/{workstation=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:generateAccessToken" + body: "*" + }; + option (google.api.method_signature) = "workstation"; + } +} + +// A grouping of workstation configurations and the associated workstations +// in that region. +message WorkstationCluster { + option (google.api.resource) = { + type: "workstations.googleapis.com/WorkstationCluster" + pattern: "projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}" + style: DECLARATIVE_FRIENDLY + }; + + // Configuration options for private clusters. + message PrivateClusterConfig { + // Immutable. Whether Workstations endpoint is private. + bool enable_private_endpoint = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. Hostname for the workstation cluster. This field will be + // populated only when private endpoint is enabled. To access workstations + // in the cluster, create a new DNS zone mapping this domain name to an + // internal IP address and a forwarding rule mapping that address to the + // service attachment. + string cluster_hostname = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Service attachment URI for the workstation cluster. The + // service attachemnt is created when private endpoint is enabled. To access + // workstations in the cluster, configure access to the managed service + // using [Private Service + // Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services). + string service_attachment_uri = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Additional projects that are allowed to attach to the workstation + // cluster's service attachment. By default, the workstation cluster's + // project and the VPC host project (if different) are allowed. + repeated string allowed_projects = 4; + } + + // Full name of this resource. + string name = 1; + + // Human-readable name for this resource. + string display_name = 2; + + // Output only. A system-assigned unique identified for this resource. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates whether this resource is currently being updated to + // match its intended state. + bool reconciling = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Client-specified annotations. + map annotations = 5; + + // Client-specified labels that are applied to the resource and that are also + // propagated to the underlying Compute Engine resources. + map labels = 15; + + // Output only. Time when this resource was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when this resource was most recently updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when this resource was soft-deleted. + google.protobuf.Timestamp delete_time = 8 + [(google.api.field_behavior) = 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 = 9; + + // Immutable. Name of the Compute Engine network in which instances associated + // with this cluster will be created. + string network = 10 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Name of the Compute Engine subnetwork in which instances + // associated with this cluster will be created. Must be part of the + // subnetwork specified for this cluster. + string subnetwork = 11 [(google.api.field_behavior) = IMMUTABLE]; + + // Configuration for private cluster. + PrivateClusterConfig private_cluster_config = 12; + + // Output only. Whether this resource is in degraded mode, in which case it + // may require user action to restore full functionality. Details can be found + // in the `conditions` field. + bool degraded = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Status conditions describing the current resource state. + repeated google.rpc.Status conditions = 14 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A set of configuration options describing how a workstation will be run. +// Workstation configurations are intended to be shared across multiple +// workstations. +message WorkstationConfig { + option (google.api.resource) = { + type: "workstations.googleapis.com/WorkstationConfig" + pattern: "projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}" + style: DECLARATIVE_FRIENDLY + }; + + // Runtime host for a workstation. + message Host { + // A runtime using a Compute Engine instance. + message GceInstance { + // A set of Compute Engine Shielded instance options. + message GceShieldedInstanceConfig { + // Whether the instance has Secure Boot enabled. + bool enable_secure_boot = 1; + + // Whether the instance has the vTPM enabled. + bool enable_vtpm = 2; + + // Whether the instance has integrity monitoring enabled. + bool enable_integrity_monitoring = 3; + } + + // A set of Compute Engine Confidential VM instance options. + message GceConfidentialInstanceConfig { + // Whether the instance has confidential compute enabled. + bool enable_confidential_compute = 1; + } + + // The name of a Compute Engine machine type. + string machine_type = 1; + + // Email address of the service account that will be used on VM instances + // used to support this config. If not set, VMs will run with a + // Google-managed service account. This service account must have + // permission to pull the specified container image, otherwise the image + // must be publicly accessible. + string service_account = 2; + + // Network tags to add to the Compute Engine machines backing the + // Workstations. + repeated string tags = 4; + + // Number of instances to pool for faster workstation starup. + int32 pool_size = 5; + + // Whether instances have no public IP address. + bool disable_public_ip_addresses = 6; + + // Whether to enable nested virtualization on instances. + bool enable_nested_virtualization = 7; + + // A set of Compute Engine Shielded instance options. + GceShieldedInstanceConfig shielded_instance_config = 8; + + // A set of Compute Engine Confidential VM instance options. + GceConfidentialInstanceConfig confidential_instance_config = 10; + + // Size of the boot disk in GB. Defaults to 50. + int32 boot_disk_size_gb = 9; + } + + // Type of host that will be used for the workstation's runtime. + oneof config { + // Specifies a Compute Engine instance as the host. + GceInstance gce_instance = 1; + } + } + + // A directory to persist across workstation sessions. + message PersistentDirectory { + // A PersistentDirectory backed by a Compute Engine regional persistent + // disk. + message GceRegionalPersistentDisk { + // Value representing what should happen to the disk after the workstation + // is deleted. + enum ReclaimPolicy { + // Do not use. + RECLAIM_POLICY_UNSPECIFIED = 0; + + // The persistent disk will be deleted with the workstation. + DELETE = 1; + + // The persistent disk will be remain after the workstation is deleted, + // and the administrator must manually delete the disk. + RETAIN = 2; + } + + // Size of the disk in GB. Must be empty if source_snapshot is set. + // Defaults to 200. + int32 size_gb = 1; + + // Type of file system that the disk should be formatted with. The + // workstation image must support this file system type. Must be empty + // if source_snapshot is set. Defaults to ext4. + string fs_type = 2; + + // Type of the disk to use. Defaults to pd-standard. + string disk_type = 3; + + // Name of the snapshot to use as the source for the disk. If set, + // size_gb and fs_type must be empty. + string source_snapshot = 5; + + // What should happen to the disk after the workstation is deleted. + // Defaults to DELETE. + ReclaimPolicy reclaim_policy = 4; + } + + // How a persistent directory should be implemented. + oneof directory_type { + // A PersistentDirectory backed by a Compute Engine persistent disk. + GceRegionalPersistentDisk gce_pd = 2; + } + + // Location of this directory in the running workstation. + string mount_path = 1; + } + + // A Docker container. + message Container { + // Docker image defining the container. This image must be accessible by the + // config's service account. + string image = 1; + + // If set, overrides the default ENTRYPOINT specified by the image. + repeated string command = 2; + + // Arguments passed to the entrypoint. + repeated string args = 3; + + // Environment variables passed to the container. + map env = 4; + + // If set, overrides the default DIR specified by the image. + string working_dir = 5; + + // If set, overrides the USER specified in the image with the given uid. + int32 run_as_user = 6; + } + + // A customer-managed encryption key for the Compute Engine resources + // of this workstation configuration. + message CustomerEncryptionKey { + // The name of the Google Cloud KMS encryption key. For example, + // `projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME`. + string kms_key = 1; + + // The service account to use with the specified + // KMS key. We recommend that you use a separate service account + // and follow KMS best practices. For more information, see + // [Separation of + // duties](https://cloud.google.com/kms/docs/separation-of-duties) and + // `gcloud kms keys add-iam-policy-binding` + // [`--member`](https://cloud.google.com/sdk/gcloud/reference/kms/keys/add-iam-policy-binding#--member). + string kms_key_service_account = 2; + } + + // Full name of this resource. + string name = 1; + + // Human-readable name for this resource. + string display_name = 2; + + // Output only. A system-assigned unique identified for this resource. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates whether this resource is currently being updated to + // match its intended state. + bool reconciling = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Client-specified annotations. + map annotations = 5; + + // Client-specified labels that are applied to the resource and that are also + // propagated to the underlying Compute Engine resources. + map labels = 18; + + // Output only. Time when this resource was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when this resource was most recently updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when this resource was soft-deleted. + google.protobuf.Timestamp delete_time = 8 + [(google.api.field_behavior) = 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 = 9; + + // How long to wait before automatically stopping an instance that hasn't + // received any user traffic. A value of 0 indicates that this instance + // should never time out due to idleness. Defaults to 20 minutes. + google.protobuf.Duration idle_timeout = 10; + + // How long to wait before automatically stopping a workstation after it + // started. A value of 0 indicates that workstations using this configuration + // should never time out. Must be greater than 0 and less than 24 hours if + // encryption_key is set. Defaults to 12 hours. + google.protobuf.Duration running_timeout = 11; + + // Runtime host for the workstation. + Host host = 12; + + // Directories to persist across workstation sessions. + repeated PersistentDirectory persistent_directories = 13; + + // Container that will be run for each workstation using this configuration + // when that workstation is started. + Container container = 14; + + // Encrypts resources of this workstation configuration using a + // customer-managed encryption key. + // + // If specified, the boot disk of the Compute Engine instance and the + // persistent disk are encrypted using this encryption key. If + // this field is not set, the disks are encrypted using a generated + // key. Customer-managed encryption keys do not protect disk metadata. + // + // If the customer-managed encryption key is rotated, when the workstation + // instance is stopped, the system attempts to recreate the + // persistent disk with the new version of the key. Be sure to keep + // older versions of the key until the persistent disk is recreated. + // Otherwise, data on the persistent disk will be lost. + // + // If the encryption key is revoked, the workstation session will + // automatically be stopped within 7 hours. + CustomerEncryptionKey encryption_key = 17; + + // Output only. Whether this resource is degraded, in which case it may + // require user action to restore full functionality. See also the + // `conditions` field. + bool degraded = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Status conditions describing the current resource state. + repeated google.rpc.Status conditions = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A single instance of a developer workstation with its own persistent storage. +message Workstation { + option (google.api.resource) = { + type: "workstations.googleapis.com/Workstation" + pattern: "projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}" + style: DECLARATIVE_FRIENDLY + }; + + // Whether a workstation is running and ready to receive user requests. + enum State { + // Do not use. + STATE_UNSPECIFIED = 0; + + // The workstation is not yet ready to accept requests from users but will + // be soon. + STATE_STARTING = 1; + + // The workstation is ready to accept requests from users. + STATE_RUNNING = 2; + + // The workstation is being stopped. + STATE_STOPPING = 3; + + // The workstation is stopped and will not be able to receive requests until + // it is started. + STATE_STOPPED = 4; + } + + // Full name of this resource. + string name = 1; + + // Human-readable name for this resource. + string display_name = 2; + + // Output only. A system-assigned unique identified for this resource. + string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Indicates whether this resource is currently being updated to + // match its intended state. + bool reconciling = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Client-specified annotations. + map annotations = 5; + + // Client-specified labels that are applied to the resource and that are also + // propagated to the underlying Compute Engine resources. + map labels = 13; + + // Output only. Time when this resource was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when this resource was most recently updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when this resource was soft-deleted. + google.protobuf.Timestamp delete_time = 8 + [(google.api.field_behavior) = 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 = 9; + + // Output only. Current state of the workstation. + State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Host to which clients can send HTTPS traffic that will be + // received by the workstation. Authorized traffic will be received to the + // workstation as HTTP on port 80. To send traffic to a different port, + // clients may prefix the host with the destination port in the format + // `{port}-{host}`. + string host = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for GetWorkstationCluster. +message GetWorkstationClusterRequest { + // Required. Name of the requested resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationCluster" + } + ]; +} + +// Request message for ListWorkstationClusters. +message ListWorkstationClustersRequest { + // Required. Parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "workstations.googleapis.com/WorkstationCluster" + } + ]; + + // Maximum number of items to return. + int32 page_size = 2; + + // next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// Response message for ListWorkstationClusters. +message ListWorkstationClustersResponse { + // The requested workstation clusters. + repeated WorkstationCluster workstation_clusters = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Unreachable resources. + repeated string unreachable = 3; +} + +// Message for creating a CreateWorkstationCluster. +message CreateWorkstationClusterRequest { + // Required. Parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "workstations.googleapis.com/WorkstationCluster" + } + ]; + + // Required. ID to use for the workstation cluster. + string workstation_cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Workstation cluster to create. + WorkstationCluster workstation_cluster = 3 + [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 4; +} + +// Request message for UpdateWorkstationCluster. +message UpdateWorkstationClusterRequest { + // Required. Workstation cluster to update. + WorkstationCluster workstation_cluster = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask that specifies which fields in the workstation cluster + // should be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 3; + + // If set, and the workstation cluster is not found, a new workstation + // cluster will be created. In this situation, update_mask is ignored. + bool allow_missing = 4; +} + +// Message for deleting a workstation cluster. +message DeleteWorkstationClusterRequest { + // Required. Name of the workstation cluster to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationCluster" + } + ]; + + // If set, validate the request and preview the review, but do not apply it. + bool validate_only = 2; + + // If set, the request will be rejected if the latest version of the + // workstation cluster on the server does not have this etag. + string etag = 3; + + // If set, any workstation configurations and workstations in the + // workstation cluster are also deleted. Otherwise, the request only + // works if the workstation cluster has no configurations or workstations. + bool force = 4; +} + +// Request message for GetWorkstationConfig. +message GetWorkstationConfigRequest { + // Required. Name of the requested resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationConfig" + } + ]; +} + +// Request message for ListWorkstationConfigs. +message ListWorkstationConfigsRequest { + // Required. Parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationCluster" + } + ]; + + // Maximum number of items to return. + int32 page_size = 2; + + // next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// Response message for ListWorkstationConfigs. +message ListWorkstationConfigsResponse { + // The requested configs. + repeated WorkstationConfig workstation_configs = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Unreachable resources. + repeated string unreachable = 3; +} + +// Request message for ListUsableWorkstationConfigs. +message ListUsableWorkstationConfigsRequest { + // Required. Parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationCluster" + } + ]; + + // Maximum number of items to return. + int32 page_size = 2; + + // next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// Response message for ListUsableWorkstationConfigs. +message ListUsableWorkstationConfigsResponse { + // The requested configs. + repeated WorkstationConfig workstation_configs = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Unreachable resources. + repeated string unreachable = 3; +} + +// Message for creating a CreateWorkstationConfig. +message CreateWorkstationConfigRequest { + // Required. Parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationCluster" + } + ]; + + // Required. ID to use for the config. + string workstation_config_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Config to create. + WorkstationConfig workstation_config = 3 + [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 4; +} + +// Request message for UpdateWorkstationConfig. +message UpdateWorkstationConfigRequest { + // Required. Config to update. + WorkstationConfig workstation_config = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask specifying which fields in the config should be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 3; + + // If set, and the config is not found, a new config will be created. + // In this situation, update_mask is ignored. + bool allow_missing = 4; +} + +// Message for deleting a workstation configuration. +message DeleteWorkstationConfigRequest { + // Required. Name of the config to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationConfig" + } + ]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 2; + + // If set, the request will be rejected if the latest version of the config on + // the server does not have this etag. + string etag = 3; + + // If set, any Workstations in the config will also be deleted. Otherwise, + // the request will work only if the config has no workstations. + bool force = 4; +} + +// Request message for GetWorkstation. +message GetWorkstationRequest { + // Required. Name of the requested resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/Workstation" + } + ]; +} + +// Request message for ListWorkstations. +message ListWorkstationsRequest { + // Required. Parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationConfig" + } + ]; + + // Maximum number of items to return. + int32 page_size = 2; + + // next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// Response message for ListWorkstations. +message ListWorkstationsResponse { + // The requested workstations. + repeated Workstation workstations = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Unreachable resources. + repeated string unreachable = 3; +} + +// Request message for ListUsableWorkstations. +message ListUsableWorkstationsRequest { + // Required. Parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationConfig" + } + ]; + + // Maximum number of items to return. + int32 page_size = 2; + + // next_page_token value returned from a previous List request, if any. + string page_token = 3; +} + +// Response message for ListUsableWorkstations. +message ListUsableWorkstationsResponse { + // The requested workstations. + repeated Workstation workstations = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Unreachable resources. + repeated string unreachable = 3; +} + +// Message for creating a CreateWorkstation. +message CreateWorkstationRequest { + // Required. Parent resource name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/WorkstationConfig" + } + ]; + + // Required. ID to use for the workstation. + string workstation_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Workstation to create. + Workstation workstation = 3 [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 4; +} + +// Request message for UpdateWorkstation. +message UpdateWorkstationRequest { + // Required. Workstation to update. + Workstation workstation = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask specifying which fields in the config should be updated. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 3; + + // If set, and the config is not found, a new config will be created. + // In this situation, update_mask is ignored. + bool allow_missing = 4; +} + +// Request message for DeleteWorkstation. +message DeleteWorkstationRequest { + // Required. Name of the workstation to delete. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/Workstation" + } + ]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 2; + + // If set, the request will be rejected if the latest version of the + // workstation on the server does not have this etag. + string etag = 3; +} + +// Request message for StartWorkstation. +message StartWorkstationRequest { + // Required. Name of the workstation to start. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/Workstation" + } + ]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 2; + + // If set, the request will be rejected if the latest version of the + // workstation on the server does not have this etag. + string etag = 3; +} + +// Request message for StopWorkstation. +message StopWorkstationRequest { + // Required. Name of the workstation to stop. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/Workstation" + } + ]; + + // If set, validate the request and preview the review, but do not actually + // apply it. + bool validate_only = 2; + + // If set, the request will be rejected if the latest version of the + // workstation on the server does not have this etag. + string etag = 3; +} + +// Request message for GenerateAccessToken. +message GenerateAccessTokenRequest { + // Desired expiration or lifetime of the access token. + oneof expiration { + // Desired expiration time of the access token. This value must + // be at most 24 hours in the future. If a value is not specified, the + // token's expiration time will be set to a default value of 1 hour in the + // future. + google.protobuf.Timestamp expire_time = 2; + + // Desired lifetime duration of the access token. This value must + // be at most 24 hours. If a value is not specified, the token's lifetime + // will be set to a default value of 1 hour. + google.protobuf.Duration ttl = 3; + } + + // Required. Name of the workstation for which the access token should be + // generated. + string workstation = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "workstations.googleapis.com/Workstation" + } + ]; +} + +// Response message for GenerateAccessToken. +message GenerateAccessTokenResponse { + // The generated bearer access token. To use this token, include it in an + // Authorization header of an HTTP request sent to the associated + // workstation's hostname, for example, `Authorization: Bearer + // `. + string access_token = 1; + + // Time at which the generated token will expire. + google.protobuf.Timestamp expire_time = 2; +} + +// Metadata for long-running operations. +message OperationMetadata { + // Output only. Time that the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time that the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-workstations/protos/google/cloud/workstations/v1beta/workstations.proto b/packages/google-cloud-workstations/protos/google/cloud/workstations/v1beta/workstations.proto index 2849f45bcaf..772092c8e92 100644 --- a/packages/google-cloud-workstations/protos/google/cloud/workstations/v1beta/workstations.proto +++ b/packages/google-cloud-workstations/protos/google/cloud/workstations/v1beta/workstations.proto @@ -403,10 +403,11 @@ message WorkstationConfig { // The name of a Compute Engine machine type. string machine_type = 1; - // Email address of the service account that will be used on VM instances - // used to support this config. This service account must have permission - // to pull the specified container image. If not set, VMs will run without - // a service account, in which case the image must be publicly accessible. + // Email address of the service account used on VM instances + // used to support this configuration. If not set, VMs run with a + // Google-managed service account. This service account must have + // permission to pull the specified container image; otherwise, the image + // must be publicly accessible. string service_account = 2; // Network tags to add to the Compute Engine machines backing the diff --git a/packages/google-cloud-workstations/protos/protos.d.ts b/packages/google-cloud-workstations/protos/protos.d.ts index a9f284d1a68..9c643b1f223 100644 --- a/packages/google-cloud-workstations/protos/protos.d.ts +++ b/packages/google-cloud-workstations/protos/protos.d.ts @@ -23,6 +23,5033 @@ export namespace google { /** Namespace workstations. */ namespace workstations { + /** Namespace v1. */ + namespace v1 { + + /** Represents a Workstations */ + class Workstations extends $protobuf.rpc.Service { + + /** + * Constructs a new Workstations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Workstations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Workstations; + + /** + * Calls GetWorkstationCluster. + * @param request GetWorkstationClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and WorkstationCluster + */ + public getWorkstationCluster(request: google.cloud.workstations.v1.IGetWorkstationClusterRequest, callback: google.cloud.workstations.v1.Workstations.GetWorkstationClusterCallback): void; + + /** + * Calls GetWorkstationCluster. + * @param request GetWorkstationClusterRequest message or plain object + * @returns Promise + */ + public getWorkstationCluster(request: google.cloud.workstations.v1.IGetWorkstationClusterRequest): Promise; + + /** + * Calls ListWorkstationClusters. + * @param request ListWorkstationClustersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListWorkstationClustersResponse + */ + public listWorkstationClusters(request: google.cloud.workstations.v1.IListWorkstationClustersRequest, callback: google.cloud.workstations.v1.Workstations.ListWorkstationClustersCallback): void; + + /** + * Calls ListWorkstationClusters. + * @param request ListWorkstationClustersRequest message or plain object + * @returns Promise + */ + public listWorkstationClusters(request: google.cloud.workstations.v1.IListWorkstationClustersRequest): Promise; + + /** + * Calls CreateWorkstationCluster. + * @param request CreateWorkstationClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createWorkstationCluster(request: google.cloud.workstations.v1.ICreateWorkstationClusterRequest, callback: google.cloud.workstations.v1.Workstations.CreateWorkstationClusterCallback): void; + + /** + * Calls CreateWorkstationCluster. + * @param request CreateWorkstationClusterRequest message or plain object + * @returns Promise + */ + public createWorkstationCluster(request: google.cloud.workstations.v1.ICreateWorkstationClusterRequest): Promise; + + /** + * Calls UpdateWorkstationCluster. + * @param request UpdateWorkstationClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateWorkstationCluster(request: google.cloud.workstations.v1.IUpdateWorkstationClusterRequest, callback: google.cloud.workstations.v1.Workstations.UpdateWorkstationClusterCallback): void; + + /** + * Calls UpdateWorkstationCluster. + * @param request UpdateWorkstationClusterRequest message or plain object + * @returns Promise + */ + public updateWorkstationCluster(request: google.cloud.workstations.v1.IUpdateWorkstationClusterRequest): Promise; + + /** + * Calls DeleteWorkstationCluster. + * @param request DeleteWorkstationClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteWorkstationCluster(request: google.cloud.workstations.v1.IDeleteWorkstationClusterRequest, callback: google.cloud.workstations.v1.Workstations.DeleteWorkstationClusterCallback): void; + + /** + * Calls DeleteWorkstationCluster. + * @param request DeleteWorkstationClusterRequest message or plain object + * @returns Promise + */ + public deleteWorkstationCluster(request: google.cloud.workstations.v1.IDeleteWorkstationClusterRequest): Promise; + + /** + * Calls GetWorkstationConfig. + * @param request GetWorkstationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and WorkstationConfig + */ + public getWorkstationConfig(request: google.cloud.workstations.v1.IGetWorkstationConfigRequest, callback: google.cloud.workstations.v1.Workstations.GetWorkstationConfigCallback): void; + + /** + * Calls GetWorkstationConfig. + * @param request GetWorkstationConfigRequest message or plain object + * @returns Promise + */ + public getWorkstationConfig(request: google.cloud.workstations.v1.IGetWorkstationConfigRequest): Promise; + + /** + * Calls ListWorkstationConfigs. + * @param request ListWorkstationConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListWorkstationConfigsResponse + */ + public listWorkstationConfigs(request: google.cloud.workstations.v1.IListWorkstationConfigsRequest, callback: google.cloud.workstations.v1.Workstations.ListWorkstationConfigsCallback): void; + + /** + * Calls ListWorkstationConfigs. + * @param request ListWorkstationConfigsRequest message or plain object + * @returns Promise + */ + public listWorkstationConfigs(request: google.cloud.workstations.v1.IListWorkstationConfigsRequest): Promise; + + /** + * Calls ListUsableWorkstationConfigs. + * @param request ListUsableWorkstationConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListUsableWorkstationConfigsResponse + */ + public listUsableWorkstationConfigs(request: google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest, callback: google.cloud.workstations.v1.Workstations.ListUsableWorkstationConfigsCallback): void; + + /** + * Calls ListUsableWorkstationConfigs. + * @param request ListUsableWorkstationConfigsRequest message or plain object + * @returns Promise + */ + public listUsableWorkstationConfigs(request: google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest): Promise; + + /** + * Calls CreateWorkstationConfig. + * @param request CreateWorkstationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createWorkstationConfig(request: google.cloud.workstations.v1.ICreateWorkstationConfigRequest, callback: google.cloud.workstations.v1.Workstations.CreateWorkstationConfigCallback): void; + + /** + * Calls CreateWorkstationConfig. + * @param request CreateWorkstationConfigRequest message or plain object + * @returns Promise + */ + public createWorkstationConfig(request: google.cloud.workstations.v1.ICreateWorkstationConfigRequest): Promise; + + /** + * Calls UpdateWorkstationConfig. + * @param request UpdateWorkstationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateWorkstationConfig(request: google.cloud.workstations.v1.IUpdateWorkstationConfigRequest, callback: google.cloud.workstations.v1.Workstations.UpdateWorkstationConfigCallback): void; + + /** + * Calls UpdateWorkstationConfig. + * @param request UpdateWorkstationConfigRequest message or plain object + * @returns Promise + */ + public updateWorkstationConfig(request: google.cloud.workstations.v1.IUpdateWorkstationConfigRequest): Promise; + + /** + * Calls DeleteWorkstationConfig. + * @param request DeleteWorkstationConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteWorkstationConfig(request: google.cloud.workstations.v1.IDeleteWorkstationConfigRequest, callback: google.cloud.workstations.v1.Workstations.DeleteWorkstationConfigCallback): void; + + /** + * Calls DeleteWorkstationConfig. + * @param request DeleteWorkstationConfigRequest message or plain object + * @returns Promise + */ + public deleteWorkstationConfig(request: google.cloud.workstations.v1.IDeleteWorkstationConfigRequest): Promise; + + /** + * Calls GetWorkstation. + * @param request GetWorkstationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Workstation + */ + public getWorkstation(request: google.cloud.workstations.v1.IGetWorkstationRequest, callback: google.cloud.workstations.v1.Workstations.GetWorkstationCallback): void; + + /** + * Calls GetWorkstation. + * @param request GetWorkstationRequest message or plain object + * @returns Promise + */ + public getWorkstation(request: google.cloud.workstations.v1.IGetWorkstationRequest): Promise; + + /** + * Calls ListWorkstations. + * @param request ListWorkstationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListWorkstationsResponse + */ + public listWorkstations(request: google.cloud.workstations.v1.IListWorkstationsRequest, callback: google.cloud.workstations.v1.Workstations.ListWorkstationsCallback): void; + + /** + * Calls ListWorkstations. + * @param request ListWorkstationsRequest message or plain object + * @returns Promise + */ + public listWorkstations(request: google.cloud.workstations.v1.IListWorkstationsRequest): Promise; + + /** + * Calls ListUsableWorkstations. + * @param request ListUsableWorkstationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListUsableWorkstationsResponse + */ + public listUsableWorkstations(request: google.cloud.workstations.v1.IListUsableWorkstationsRequest, callback: google.cloud.workstations.v1.Workstations.ListUsableWorkstationsCallback): void; + + /** + * Calls ListUsableWorkstations. + * @param request ListUsableWorkstationsRequest message or plain object + * @returns Promise + */ + public listUsableWorkstations(request: google.cloud.workstations.v1.IListUsableWorkstationsRequest): Promise; + + /** + * Calls CreateWorkstation. + * @param request CreateWorkstationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createWorkstation(request: google.cloud.workstations.v1.ICreateWorkstationRequest, callback: google.cloud.workstations.v1.Workstations.CreateWorkstationCallback): void; + + /** + * Calls CreateWorkstation. + * @param request CreateWorkstationRequest message or plain object + * @returns Promise + */ + public createWorkstation(request: google.cloud.workstations.v1.ICreateWorkstationRequest): Promise; + + /** + * Calls UpdateWorkstation. + * @param request UpdateWorkstationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateWorkstation(request: google.cloud.workstations.v1.IUpdateWorkstationRequest, callback: google.cloud.workstations.v1.Workstations.UpdateWorkstationCallback): void; + + /** + * Calls UpdateWorkstation. + * @param request UpdateWorkstationRequest message or plain object + * @returns Promise + */ + public updateWorkstation(request: google.cloud.workstations.v1.IUpdateWorkstationRequest): Promise; + + /** + * Calls DeleteWorkstation. + * @param request DeleteWorkstationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteWorkstation(request: google.cloud.workstations.v1.IDeleteWorkstationRequest, callback: google.cloud.workstations.v1.Workstations.DeleteWorkstationCallback): void; + + /** + * Calls DeleteWorkstation. + * @param request DeleteWorkstationRequest message or plain object + * @returns Promise + */ + public deleteWorkstation(request: google.cloud.workstations.v1.IDeleteWorkstationRequest): Promise; + + /** + * Calls StartWorkstation. + * @param request StartWorkstationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public startWorkstation(request: google.cloud.workstations.v1.IStartWorkstationRequest, callback: google.cloud.workstations.v1.Workstations.StartWorkstationCallback): void; + + /** + * Calls StartWorkstation. + * @param request StartWorkstationRequest message or plain object + * @returns Promise + */ + public startWorkstation(request: google.cloud.workstations.v1.IStartWorkstationRequest): Promise; + + /** + * Calls StopWorkstation. + * @param request StopWorkstationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public stopWorkstation(request: google.cloud.workstations.v1.IStopWorkstationRequest, callback: google.cloud.workstations.v1.Workstations.StopWorkstationCallback): void; + + /** + * Calls StopWorkstation. + * @param request StopWorkstationRequest message or plain object + * @returns Promise + */ + public stopWorkstation(request: google.cloud.workstations.v1.IStopWorkstationRequest): Promise; + + /** + * Calls GenerateAccessToken. + * @param request GenerateAccessTokenRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateAccessTokenResponse + */ + public generateAccessToken(request: google.cloud.workstations.v1.IGenerateAccessTokenRequest, callback: google.cloud.workstations.v1.Workstations.GenerateAccessTokenCallback): void; + + /** + * Calls GenerateAccessToken. + * @param request GenerateAccessTokenRequest message or plain object + * @returns Promise + */ + public generateAccessToken(request: google.cloud.workstations.v1.IGenerateAccessTokenRequest): Promise; + } + + namespace Workstations { + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|getWorkstationCluster}. + * @param error Error, if any + * @param [response] WorkstationCluster + */ + type GetWorkstationClusterCallback = (error: (Error|null), response?: google.cloud.workstations.v1.WorkstationCluster) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|listWorkstationClusters}. + * @param error Error, if any + * @param [response] ListWorkstationClustersResponse + */ + type ListWorkstationClustersCallback = (error: (Error|null), response?: google.cloud.workstations.v1.ListWorkstationClustersResponse) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|createWorkstationCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateWorkstationClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|updateWorkstationCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateWorkstationClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|deleteWorkstationCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteWorkstationClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|getWorkstationConfig}. + * @param error Error, if any + * @param [response] WorkstationConfig + */ + type GetWorkstationConfigCallback = (error: (Error|null), response?: google.cloud.workstations.v1.WorkstationConfig) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|listWorkstationConfigs}. + * @param error Error, if any + * @param [response] ListWorkstationConfigsResponse + */ + type ListWorkstationConfigsCallback = (error: (Error|null), response?: google.cloud.workstations.v1.ListWorkstationConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|listUsableWorkstationConfigs}. + * @param error Error, if any + * @param [response] ListUsableWorkstationConfigsResponse + */ + type ListUsableWorkstationConfigsCallback = (error: (Error|null), response?: google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|createWorkstationConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateWorkstationConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|updateWorkstationConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateWorkstationConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|deleteWorkstationConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteWorkstationConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|getWorkstation}. + * @param error Error, if any + * @param [response] Workstation + */ + type GetWorkstationCallback = (error: (Error|null), response?: google.cloud.workstations.v1.Workstation) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|listWorkstations}. + * @param error Error, if any + * @param [response] ListWorkstationsResponse + */ + type ListWorkstationsCallback = (error: (Error|null), response?: google.cloud.workstations.v1.ListWorkstationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|listUsableWorkstations}. + * @param error Error, if any + * @param [response] ListUsableWorkstationsResponse + */ + type ListUsableWorkstationsCallback = (error: (Error|null), response?: google.cloud.workstations.v1.ListUsableWorkstationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|createWorkstation}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateWorkstationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|updateWorkstation}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateWorkstationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|deleteWorkstation}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteWorkstationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|startWorkstation}. + * @param error Error, if any + * @param [response] Operation + */ + type StartWorkstationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|stopWorkstation}. + * @param error Error, if any + * @param [response] Operation + */ + type StopWorkstationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|generateAccessToken}. + * @param error Error, if any + * @param [response] GenerateAccessTokenResponse + */ + type GenerateAccessTokenCallback = (error: (Error|null), response?: google.cloud.workstations.v1.GenerateAccessTokenResponse) => void; + } + + /** Properties of a WorkstationCluster. */ + interface IWorkstationCluster { + + /** WorkstationCluster name */ + name?: (string|null); + + /** WorkstationCluster displayName */ + displayName?: (string|null); + + /** WorkstationCluster uid */ + uid?: (string|null); + + /** WorkstationCluster reconciling */ + reconciling?: (boolean|null); + + /** WorkstationCluster annotations */ + annotations?: ({ [k: string]: string }|null); + + /** WorkstationCluster labels */ + labels?: ({ [k: string]: string }|null); + + /** WorkstationCluster createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** WorkstationCluster updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** WorkstationCluster deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** WorkstationCluster etag */ + etag?: (string|null); + + /** WorkstationCluster network */ + network?: (string|null); + + /** WorkstationCluster subnetwork */ + subnetwork?: (string|null); + + /** WorkstationCluster privateClusterConfig */ + privateClusterConfig?: (google.cloud.workstations.v1.WorkstationCluster.IPrivateClusterConfig|null); + + /** WorkstationCluster degraded */ + degraded?: (boolean|null); + + /** WorkstationCluster conditions */ + conditions?: (google.rpc.IStatus[]|null); + } + + /** Represents a WorkstationCluster. */ + class WorkstationCluster implements IWorkstationCluster { + + /** + * Constructs a new WorkstationCluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IWorkstationCluster); + + /** WorkstationCluster name. */ + public name: string; + + /** WorkstationCluster displayName. */ + public displayName: string; + + /** WorkstationCluster uid. */ + public uid: string; + + /** WorkstationCluster reconciling. */ + public reconciling: boolean; + + /** WorkstationCluster annotations. */ + public annotations: { [k: string]: string }; + + /** WorkstationCluster labels. */ + public labels: { [k: string]: string }; + + /** WorkstationCluster createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** WorkstationCluster updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** WorkstationCluster deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** WorkstationCluster etag. */ + public etag: string; + + /** WorkstationCluster network. */ + public network: string; + + /** WorkstationCluster subnetwork. */ + public subnetwork: string; + + /** WorkstationCluster privateClusterConfig. */ + public privateClusterConfig?: (google.cloud.workstations.v1.WorkstationCluster.IPrivateClusterConfig|null); + + /** WorkstationCluster degraded. */ + public degraded: boolean; + + /** WorkstationCluster conditions. */ + public conditions: google.rpc.IStatus[]; + + /** + * Creates a new WorkstationCluster instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkstationCluster instance + */ + public static create(properties?: google.cloud.workstations.v1.IWorkstationCluster): google.cloud.workstations.v1.WorkstationCluster; + + /** + * Encodes the specified WorkstationCluster message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationCluster.verify|verify} messages. + * @param message WorkstationCluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IWorkstationCluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkstationCluster message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationCluster.verify|verify} messages. + * @param message WorkstationCluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IWorkstationCluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkstationCluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkstationCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.WorkstationCluster; + + /** + * Decodes a WorkstationCluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkstationCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.WorkstationCluster; + + /** + * Verifies a WorkstationCluster message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkstationCluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkstationCluster + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.WorkstationCluster; + + /** + * Creates a plain object from a WorkstationCluster message. Also converts values to other types if specified. + * @param message WorkstationCluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.WorkstationCluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkstationCluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkstationCluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WorkstationCluster { + + /** Properties of a PrivateClusterConfig. */ + interface IPrivateClusterConfig { + + /** PrivateClusterConfig enablePrivateEndpoint */ + enablePrivateEndpoint?: (boolean|null); + + /** PrivateClusterConfig clusterHostname */ + clusterHostname?: (string|null); + + /** PrivateClusterConfig serviceAttachmentUri */ + serviceAttachmentUri?: (string|null); + + /** PrivateClusterConfig allowedProjects */ + allowedProjects?: (string[]|null); + } + + /** Represents a PrivateClusterConfig. */ + class PrivateClusterConfig implements IPrivateClusterConfig { + + /** + * Constructs a new PrivateClusterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.WorkstationCluster.IPrivateClusterConfig); + + /** PrivateClusterConfig enablePrivateEndpoint. */ + public enablePrivateEndpoint: boolean; + + /** PrivateClusterConfig clusterHostname. */ + public clusterHostname: string; + + /** PrivateClusterConfig serviceAttachmentUri. */ + public serviceAttachmentUri: string; + + /** PrivateClusterConfig allowedProjects. */ + public allowedProjects: string[]; + + /** + * Creates a new PrivateClusterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PrivateClusterConfig instance + */ + public static create(properties?: google.cloud.workstations.v1.WorkstationCluster.IPrivateClusterConfig): google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig; + + /** + * Encodes the specified PrivateClusterConfig message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig.verify|verify} messages. + * @param message PrivateClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.WorkstationCluster.IPrivateClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrivateClusterConfig message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig.verify|verify} messages. + * @param message PrivateClusterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.WorkstationCluster.IPrivateClusterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrivateClusterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrivateClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig; + + /** + * Decodes a PrivateClusterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrivateClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig; + + /** + * Verifies a PrivateClusterConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrivateClusterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrivateClusterConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig; + + /** + * Creates a plain object from a PrivateClusterConfig message. Also converts values to other types if specified. + * @param message PrivateClusterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrivateClusterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrivateClusterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a WorkstationConfig. */ + interface IWorkstationConfig { + + /** WorkstationConfig name */ + name?: (string|null); + + /** WorkstationConfig displayName */ + displayName?: (string|null); + + /** WorkstationConfig uid */ + uid?: (string|null); + + /** WorkstationConfig reconciling */ + reconciling?: (boolean|null); + + /** WorkstationConfig annotations */ + annotations?: ({ [k: string]: string }|null); + + /** WorkstationConfig labels */ + labels?: ({ [k: string]: string }|null); + + /** WorkstationConfig createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** WorkstationConfig updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** WorkstationConfig deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** WorkstationConfig etag */ + etag?: (string|null); + + /** WorkstationConfig idleTimeout */ + idleTimeout?: (google.protobuf.IDuration|null); + + /** WorkstationConfig runningTimeout */ + runningTimeout?: (google.protobuf.IDuration|null); + + /** WorkstationConfig host */ + host?: (google.cloud.workstations.v1.WorkstationConfig.IHost|null); + + /** WorkstationConfig persistentDirectories */ + persistentDirectories?: (google.cloud.workstations.v1.WorkstationConfig.IPersistentDirectory[]|null); + + /** WorkstationConfig container */ + container?: (google.cloud.workstations.v1.WorkstationConfig.IContainer|null); + + /** WorkstationConfig encryptionKey */ + encryptionKey?: (google.cloud.workstations.v1.WorkstationConfig.ICustomerEncryptionKey|null); + + /** WorkstationConfig degraded */ + degraded?: (boolean|null); + + /** WorkstationConfig conditions */ + conditions?: (google.rpc.IStatus[]|null); + } + + /** Represents a WorkstationConfig. */ + class WorkstationConfig implements IWorkstationConfig { + + /** + * Constructs a new WorkstationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IWorkstationConfig); + + /** WorkstationConfig name. */ + public name: string; + + /** WorkstationConfig displayName. */ + public displayName: string; + + /** WorkstationConfig uid. */ + public uid: string; + + /** WorkstationConfig reconciling. */ + public reconciling: boolean; + + /** WorkstationConfig annotations. */ + public annotations: { [k: string]: string }; + + /** WorkstationConfig labels. */ + public labels: { [k: string]: string }; + + /** WorkstationConfig createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** WorkstationConfig updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** WorkstationConfig deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** WorkstationConfig etag. */ + public etag: string; + + /** WorkstationConfig idleTimeout. */ + public idleTimeout?: (google.protobuf.IDuration|null); + + /** WorkstationConfig runningTimeout. */ + public runningTimeout?: (google.protobuf.IDuration|null); + + /** WorkstationConfig host. */ + public host?: (google.cloud.workstations.v1.WorkstationConfig.IHost|null); + + /** WorkstationConfig persistentDirectories. */ + public persistentDirectories: google.cloud.workstations.v1.WorkstationConfig.IPersistentDirectory[]; + + /** WorkstationConfig container. */ + public container?: (google.cloud.workstations.v1.WorkstationConfig.IContainer|null); + + /** WorkstationConfig encryptionKey. */ + public encryptionKey?: (google.cloud.workstations.v1.WorkstationConfig.ICustomerEncryptionKey|null); + + /** WorkstationConfig degraded. */ + public degraded: boolean; + + /** WorkstationConfig conditions. */ + public conditions: google.rpc.IStatus[]; + + /** + * Creates a new WorkstationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkstationConfig instance + */ + public static create(properties?: google.cloud.workstations.v1.IWorkstationConfig): google.cloud.workstations.v1.WorkstationConfig; + + /** + * Encodes the specified WorkstationConfig message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.verify|verify} messages. + * @param message WorkstationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IWorkstationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkstationConfig message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.verify|verify} messages. + * @param message WorkstationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IWorkstationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkstationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkstationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.WorkstationConfig; + + /** + * Decodes a WorkstationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkstationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.WorkstationConfig; + + /** + * Verifies a WorkstationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkstationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkstationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.WorkstationConfig; + + /** + * Creates a plain object from a WorkstationConfig message. Also converts values to other types if specified. + * @param message WorkstationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.WorkstationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkstationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkstationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WorkstationConfig { + + /** Properties of a Host. */ + interface IHost { + + /** Host gceInstance */ + gceInstance?: (google.cloud.workstations.v1.WorkstationConfig.Host.IGceInstance|null); + } + + /** Represents a Host. */ + class Host implements IHost { + + /** + * Constructs a new Host. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.WorkstationConfig.IHost); + + /** Host gceInstance. */ + public gceInstance?: (google.cloud.workstations.v1.WorkstationConfig.Host.IGceInstance|null); + + /** Host config. */ + public config?: "gceInstance"; + + /** + * Creates a new Host instance using the specified properties. + * @param [properties] Properties to set + * @returns Host instance + */ + public static create(properties?: google.cloud.workstations.v1.WorkstationConfig.IHost): google.cloud.workstations.v1.WorkstationConfig.Host; + + /** + * Encodes the specified Host message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Host.verify|verify} messages. + * @param message Host message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.WorkstationConfig.IHost, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Host message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Host.verify|verify} messages. + * @param message Host message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.WorkstationConfig.IHost, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Host message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Host + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.WorkstationConfig.Host; + + /** + * Decodes a Host message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Host + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.WorkstationConfig.Host; + + /** + * Verifies a Host message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Host message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Host + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.WorkstationConfig.Host; + + /** + * Creates a plain object from a Host message. Also converts values to other types if specified. + * @param message Host + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.WorkstationConfig.Host, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Host to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Host + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Host { + + /** Properties of a GceInstance. */ + interface IGceInstance { + + /** GceInstance machineType */ + machineType?: (string|null); + + /** GceInstance serviceAccount */ + serviceAccount?: (string|null); + + /** GceInstance tags */ + tags?: (string[]|null); + + /** GceInstance poolSize */ + poolSize?: (number|null); + + /** GceInstance disablePublicIpAddresses */ + disablePublicIpAddresses?: (boolean|null); + + /** GceInstance enableNestedVirtualization */ + enableNestedVirtualization?: (boolean|null); + + /** GceInstance shieldedInstanceConfig */ + shieldedInstanceConfig?: (google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceShieldedInstanceConfig|null); + + /** GceInstance confidentialInstanceConfig */ + confidentialInstanceConfig?: (google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceConfidentialInstanceConfig|null); + + /** GceInstance bootDiskSizeGb */ + bootDiskSizeGb?: (number|null); + } + + /** Represents a GceInstance. */ + class GceInstance implements IGceInstance { + + /** + * Constructs a new GceInstance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.WorkstationConfig.Host.IGceInstance); + + /** GceInstance machineType. */ + public machineType: string; + + /** GceInstance serviceAccount. */ + public serviceAccount: string; + + /** GceInstance tags. */ + public tags: string[]; + + /** GceInstance poolSize. */ + public poolSize: number; + + /** GceInstance disablePublicIpAddresses. */ + public disablePublicIpAddresses: boolean; + + /** GceInstance enableNestedVirtualization. */ + public enableNestedVirtualization: boolean; + + /** GceInstance shieldedInstanceConfig. */ + public shieldedInstanceConfig?: (google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceShieldedInstanceConfig|null); + + /** GceInstance confidentialInstanceConfig. */ + public confidentialInstanceConfig?: (google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceConfidentialInstanceConfig|null); + + /** GceInstance bootDiskSizeGb. */ + public bootDiskSizeGb: number; + + /** + * Creates a new GceInstance instance using the specified properties. + * @param [properties] Properties to set + * @returns GceInstance instance + */ + public static create(properties?: google.cloud.workstations.v1.WorkstationConfig.Host.IGceInstance): google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance; + + /** + * Encodes the specified GceInstance message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.verify|verify} messages. + * @param message GceInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.WorkstationConfig.Host.IGceInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GceInstance message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.verify|verify} messages. + * @param message GceInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.WorkstationConfig.Host.IGceInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GceInstance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GceInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance; + + /** + * Decodes a GceInstance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GceInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance; + + /** + * Verifies a GceInstance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GceInstance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GceInstance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance; + + /** + * Creates a plain object from a GceInstance message. Also converts values to other types if specified. + * @param message GceInstance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GceInstance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GceInstance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GceInstance { + + /** Properties of a GceShieldedInstanceConfig. */ + interface IGceShieldedInstanceConfig { + + /** GceShieldedInstanceConfig enableSecureBoot */ + enableSecureBoot?: (boolean|null); + + /** GceShieldedInstanceConfig enableVtpm */ + enableVtpm?: (boolean|null); + + /** GceShieldedInstanceConfig enableIntegrityMonitoring */ + enableIntegrityMonitoring?: (boolean|null); + } + + /** Represents a GceShieldedInstanceConfig. */ + class GceShieldedInstanceConfig implements IGceShieldedInstanceConfig { + + /** + * Constructs a new GceShieldedInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceShieldedInstanceConfig); + + /** GceShieldedInstanceConfig enableSecureBoot. */ + public enableSecureBoot: boolean; + + /** GceShieldedInstanceConfig enableVtpm. */ + public enableVtpm: boolean; + + /** GceShieldedInstanceConfig enableIntegrityMonitoring. */ + public enableIntegrityMonitoring: boolean; + + /** + * Creates a new GceShieldedInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GceShieldedInstanceConfig instance + */ + public static create(properties?: google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceShieldedInstanceConfig): google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig; + + /** + * Encodes the specified GceShieldedInstanceConfig message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig.verify|verify} messages. + * @param message GceShieldedInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceShieldedInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GceShieldedInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig.verify|verify} messages. + * @param message GceShieldedInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceShieldedInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GceShieldedInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GceShieldedInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig; + + /** + * Decodes a GceShieldedInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GceShieldedInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig; + + /** + * Verifies a GceShieldedInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GceShieldedInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GceShieldedInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig; + + /** + * Creates a plain object from a GceShieldedInstanceConfig message. Also converts values to other types if specified. + * @param message GceShieldedInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GceShieldedInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GceShieldedInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GceConfidentialInstanceConfig. */ + interface IGceConfidentialInstanceConfig { + + /** GceConfidentialInstanceConfig enableConfidentialCompute */ + enableConfidentialCompute?: (boolean|null); + } + + /** Represents a GceConfidentialInstanceConfig. */ + class GceConfidentialInstanceConfig implements IGceConfidentialInstanceConfig { + + /** + * Constructs a new GceConfidentialInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceConfidentialInstanceConfig); + + /** GceConfidentialInstanceConfig enableConfidentialCompute. */ + public enableConfidentialCompute: boolean; + + /** + * Creates a new GceConfidentialInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GceConfidentialInstanceConfig instance + */ + public static create(properties?: google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceConfidentialInstanceConfig): google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig; + + /** + * Encodes the specified GceConfidentialInstanceConfig message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig.verify|verify} messages. + * @param message GceConfidentialInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceConfidentialInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GceConfidentialInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig.verify|verify} messages. + * @param message GceConfidentialInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceConfidentialInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GceConfidentialInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GceConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig; + + /** + * Decodes a GceConfidentialInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GceConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig; + + /** + * Verifies a GceConfidentialInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GceConfidentialInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GceConfidentialInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig; + + /** + * Creates a plain object from a GceConfidentialInstanceConfig message. Also converts values to other types if specified. + * @param message GceConfidentialInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GceConfidentialInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GceConfidentialInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a PersistentDirectory. */ + interface IPersistentDirectory { + + /** PersistentDirectory gcePd */ + gcePd?: (google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.IGceRegionalPersistentDisk|null); + + /** PersistentDirectory mountPath */ + mountPath?: (string|null); + } + + /** Represents a PersistentDirectory. */ + class PersistentDirectory implements IPersistentDirectory { + + /** + * Constructs a new PersistentDirectory. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.WorkstationConfig.IPersistentDirectory); + + /** PersistentDirectory gcePd. */ + public gcePd?: (google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.IGceRegionalPersistentDisk|null); + + /** PersistentDirectory mountPath. */ + public mountPath: string; + + /** PersistentDirectory directoryType. */ + public directoryType?: "gcePd"; + + /** + * Creates a new PersistentDirectory instance using the specified properties. + * @param [properties] Properties to set + * @returns PersistentDirectory instance + */ + public static create(properties?: google.cloud.workstations.v1.WorkstationConfig.IPersistentDirectory): google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory; + + /** + * Encodes the specified PersistentDirectory message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.verify|verify} messages. + * @param message PersistentDirectory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.WorkstationConfig.IPersistentDirectory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PersistentDirectory message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.verify|verify} messages. + * @param message PersistentDirectory message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.WorkstationConfig.IPersistentDirectory, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PersistentDirectory message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PersistentDirectory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory; + + /** + * Decodes a PersistentDirectory message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PersistentDirectory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory; + + /** + * Verifies a PersistentDirectory message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PersistentDirectory message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PersistentDirectory + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory; + + /** + * Creates a plain object from a PersistentDirectory message. Also converts values to other types if specified. + * @param message PersistentDirectory + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PersistentDirectory to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PersistentDirectory + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PersistentDirectory { + + /** Properties of a GceRegionalPersistentDisk. */ + interface IGceRegionalPersistentDisk { + + /** GceRegionalPersistentDisk sizeGb */ + sizeGb?: (number|null); + + /** GceRegionalPersistentDisk fsType */ + fsType?: (string|null); + + /** GceRegionalPersistentDisk diskType */ + diskType?: (string|null); + + /** GceRegionalPersistentDisk sourceSnapshot */ + sourceSnapshot?: (string|null); + + /** GceRegionalPersistentDisk reclaimPolicy */ + reclaimPolicy?: (google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy|keyof typeof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy|null); + } + + /** Represents a GceRegionalPersistentDisk. */ + class GceRegionalPersistentDisk implements IGceRegionalPersistentDisk { + + /** + * Constructs a new GceRegionalPersistentDisk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.IGceRegionalPersistentDisk); + + /** GceRegionalPersistentDisk sizeGb. */ + public sizeGb: number; + + /** GceRegionalPersistentDisk fsType. */ + public fsType: string; + + /** GceRegionalPersistentDisk diskType. */ + public diskType: string; + + /** GceRegionalPersistentDisk sourceSnapshot. */ + public sourceSnapshot: string; + + /** GceRegionalPersistentDisk reclaimPolicy. */ + public reclaimPolicy: (google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy|keyof typeof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy); + + /** + * Creates a new GceRegionalPersistentDisk instance using the specified properties. + * @param [properties] Properties to set + * @returns GceRegionalPersistentDisk instance + */ + public static create(properties?: google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.IGceRegionalPersistentDisk): google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk; + + /** + * Encodes the specified GceRegionalPersistentDisk message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.verify|verify} messages. + * @param message GceRegionalPersistentDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.IGceRegionalPersistentDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GceRegionalPersistentDisk message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.verify|verify} messages. + * @param message GceRegionalPersistentDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.IGceRegionalPersistentDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GceRegionalPersistentDisk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GceRegionalPersistentDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk; + + /** + * Decodes a GceRegionalPersistentDisk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GceRegionalPersistentDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk; + + /** + * Verifies a GceRegionalPersistentDisk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GceRegionalPersistentDisk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GceRegionalPersistentDisk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk; + + /** + * Creates a plain object from a GceRegionalPersistentDisk message. Also converts values to other types if specified. + * @param message GceRegionalPersistentDisk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GceRegionalPersistentDisk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GceRegionalPersistentDisk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GceRegionalPersistentDisk { + + /** ReclaimPolicy enum. */ + enum ReclaimPolicy { + RECLAIM_POLICY_UNSPECIFIED = 0, + DELETE = 1, + RETAIN = 2 + } + } + } + + /** Properties of a Container. */ + interface IContainer { + + /** Container image */ + image?: (string|null); + + /** Container command */ + command?: (string[]|null); + + /** Container args */ + args?: (string[]|null); + + /** Container env */ + env?: ({ [k: string]: string }|null); + + /** Container workingDir */ + workingDir?: (string|null); + + /** Container runAsUser */ + runAsUser?: (number|null); + } + + /** Represents a Container. */ + class Container implements IContainer { + + /** + * Constructs a new Container. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.WorkstationConfig.IContainer); + + /** Container image. */ + public image: string; + + /** Container command. */ + public command: string[]; + + /** Container args. */ + public args: string[]; + + /** Container env. */ + public env: { [k: string]: string }; + + /** Container workingDir. */ + public workingDir: string; + + /** Container runAsUser. */ + public runAsUser: number; + + /** + * Creates a new Container instance using the specified properties. + * @param [properties] Properties to set + * @returns Container instance + */ + public static create(properties?: google.cloud.workstations.v1.WorkstationConfig.IContainer): google.cloud.workstations.v1.WorkstationConfig.Container; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Container.verify|verify} messages. + * @param message Container message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.WorkstationConfig.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Container.verify|verify} messages. + * @param message Container message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.WorkstationConfig.IContainer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Container message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.WorkstationConfig.Container; + + /** + * Decodes a Container message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.WorkstationConfig.Container; + + /** + * Verifies a Container message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Container message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Container + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.WorkstationConfig.Container; + + /** + * Creates a plain object from a Container message. Also converts values to other types if specified. + * @param message Container + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.WorkstationConfig.Container, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Container to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Container + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomerEncryptionKey. */ + interface ICustomerEncryptionKey { + + /** CustomerEncryptionKey kmsKey */ + kmsKey?: (string|null); + + /** CustomerEncryptionKey kmsKeyServiceAccount */ + kmsKeyServiceAccount?: (string|null); + } + + /** Represents a CustomerEncryptionKey. */ + class CustomerEncryptionKey implements ICustomerEncryptionKey { + + /** + * Constructs a new CustomerEncryptionKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.WorkstationConfig.ICustomerEncryptionKey); + + /** CustomerEncryptionKey kmsKey. */ + public kmsKey: string; + + /** CustomerEncryptionKey kmsKeyServiceAccount. */ + public kmsKeyServiceAccount: string; + + /** + * Creates a new CustomerEncryptionKey instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomerEncryptionKey instance + */ + public static create(properties?: google.cloud.workstations.v1.WorkstationConfig.ICustomerEncryptionKey): google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey; + + /** + * Encodes the specified CustomerEncryptionKey message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey.verify|verify} messages. + * @param message CustomerEncryptionKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.WorkstationConfig.ICustomerEncryptionKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomerEncryptionKey message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey.verify|verify} messages. + * @param message CustomerEncryptionKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.WorkstationConfig.ICustomerEncryptionKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey; + + /** + * Verifies a CustomerEncryptionKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomerEncryptionKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomerEncryptionKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey; + + /** + * Creates a plain object from a CustomerEncryptionKey message. Also converts values to other types if specified. + * @param message CustomerEncryptionKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomerEncryptionKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomerEncryptionKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a Workstation. */ + interface IWorkstation { + + /** Workstation name */ + name?: (string|null); + + /** Workstation displayName */ + displayName?: (string|null); + + /** Workstation uid */ + uid?: (string|null); + + /** Workstation reconciling */ + reconciling?: (boolean|null); + + /** Workstation annotations */ + annotations?: ({ [k: string]: string }|null); + + /** Workstation labels */ + labels?: ({ [k: string]: string }|null); + + /** Workstation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Workstation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Workstation deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Workstation etag */ + etag?: (string|null); + + /** Workstation state */ + state?: (google.cloud.workstations.v1.Workstation.State|keyof typeof google.cloud.workstations.v1.Workstation.State|null); + + /** Workstation host */ + host?: (string|null); + } + + /** Represents a Workstation. */ + class Workstation implements IWorkstation { + + /** + * Constructs a new Workstation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IWorkstation); + + /** Workstation name. */ + public name: string; + + /** Workstation displayName. */ + public displayName: string; + + /** Workstation uid. */ + public uid: string; + + /** Workstation reconciling. */ + public reconciling: boolean; + + /** Workstation annotations. */ + public annotations: { [k: string]: string }; + + /** Workstation labels. */ + public labels: { [k: string]: string }; + + /** Workstation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Workstation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Workstation deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Workstation etag. */ + public etag: string; + + /** Workstation state. */ + public state: (google.cloud.workstations.v1.Workstation.State|keyof typeof google.cloud.workstations.v1.Workstation.State); + + /** Workstation host. */ + public host: string; + + /** + * Creates a new Workstation instance using the specified properties. + * @param [properties] Properties to set + * @returns Workstation instance + */ + public static create(properties?: google.cloud.workstations.v1.IWorkstation): google.cloud.workstations.v1.Workstation; + + /** + * Encodes the specified Workstation message. Does not implicitly {@link google.cloud.workstations.v1.Workstation.verify|verify} messages. + * @param message Workstation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IWorkstation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Workstation message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.Workstation.verify|verify} messages. + * @param message Workstation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IWorkstation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Workstation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Workstation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.Workstation; + + /** + * Decodes a Workstation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Workstation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.Workstation; + + /** + * Verifies a Workstation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Workstation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Workstation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.Workstation; + + /** + * Creates a plain object from a Workstation message. Also converts values to other types if specified. + * @param message Workstation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.Workstation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Workstation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Workstation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Workstation { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + STATE_STARTING = 1, + STATE_RUNNING = 2, + STATE_STOPPING = 3, + STATE_STOPPED = 4 + } + } + + /** Properties of a GetWorkstationClusterRequest. */ + interface IGetWorkstationClusterRequest { + + /** GetWorkstationClusterRequest name */ + name?: (string|null); + } + + /** Represents a GetWorkstationClusterRequest. */ + class GetWorkstationClusterRequest implements IGetWorkstationClusterRequest { + + /** + * Constructs a new GetWorkstationClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IGetWorkstationClusterRequest); + + /** GetWorkstationClusterRequest name. */ + public name: string; + + /** + * Creates a new GetWorkstationClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetWorkstationClusterRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.IGetWorkstationClusterRequest): google.cloud.workstations.v1.GetWorkstationClusterRequest; + + /** + * Encodes the specified GetWorkstationClusterRequest message. Does not implicitly {@link google.cloud.workstations.v1.GetWorkstationClusterRequest.verify|verify} messages. + * @param message GetWorkstationClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IGetWorkstationClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetWorkstationClusterRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.GetWorkstationClusterRequest.verify|verify} messages. + * @param message GetWorkstationClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IGetWorkstationClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetWorkstationClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetWorkstationClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.GetWorkstationClusterRequest; + + /** + * Decodes a GetWorkstationClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetWorkstationClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.GetWorkstationClusterRequest; + + /** + * Verifies a GetWorkstationClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetWorkstationClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetWorkstationClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.GetWorkstationClusterRequest; + + /** + * Creates a plain object from a GetWorkstationClusterRequest message. Also converts values to other types if specified. + * @param message GetWorkstationClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.GetWorkstationClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetWorkstationClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetWorkstationClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListWorkstationClustersRequest. */ + interface IListWorkstationClustersRequest { + + /** ListWorkstationClustersRequest parent */ + parent?: (string|null); + + /** ListWorkstationClustersRequest pageSize */ + pageSize?: (number|null); + + /** ListWorkstationClustersRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListWorkstationClustersRequest. */ + class ListWorkstationClustersRequest implements IListWorkstationClustersRequest { + + /** + * Constructs a new ListWorkstationClustersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IListWorkstationClustersRequest); + + /** ListWorkstationClustersRequest parent. */ + public parent: string; + + /** ListWorkstationClustersRequest pageSize. */ + public pageSize: number; + + /** ListWorkstationClustersRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListWorkstationClustersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWorkstationClustersRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.IListWorkstationClustersRequest): google.cloud.workstations.v1.ListWorkstationClustersRequest; + + /** + * Encodes the specified ListWorkstationClustersRequest message. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationClustersRequest.verify|verify} messages. + * @param message ListWorkstationClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IListWorkstationClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWorkstationClustersRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationClustersRequest.verify|verify} messages. + * @param message ListWorkstationClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IListWorkstationClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWorkstationClustersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWorkstationClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.ListWorkstationClustersRequest; + + /** + * Decodes a ListWorkstationClustersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWorkstationClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.ListWorkstationClustersRequest; + + /** + * Verifies a ListWorkstationClustersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListWorkstationClustersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWorkstationClustersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.ListWorkstationClustersRequest; + + /** + * Creates a plain object from a ListWorkstationClustersRequest message. Also converts values to other types if specified. + * @param message ListWorkstationClustersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.ListWorkstationClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWorkstationClustersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWorkstationClustersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListWorkstationClustersResponse. */ + interface IListWorkstationClustersResponse { + + /** ListWorkstationClustersResponse workstationClusters */ + workstationClusters?: (google.cloud.workstations.v1.IWorkstationCluster[]|null); + + /** ListWorkstationClustersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListWorkstationClustersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListWorkstationClustersResponse. */ + class ListWorkstationClustersResponse implements IListWorkstationClustersResponse { + + /** + * Constructs a new ListWorkstationClustersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IListWorkstationClustersResponse); + + /** ListWorkstationClustersResponse workstationClusters. */ + public workstationClusters: google.cloud.workstations.v1.IWorkstationCluster[]; + + /** ListWorkstationClustersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListWorkstationClustersResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListWorkstationClustersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWorkstationClustersResponse instance + */ + public static create(properties?: google.cloud.workstations.v1.IListWorkstationClustersResponse): google.cloud.workstations.v1.ListWorkstationClustersResponse; + + /** + * Encodes the specified ListWorkstationClustersResponse message. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationClustersResponse.verify|verify} messages. + * @param message ListWorkstationClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IListWorkstationClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWorkstationClustersResponse message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationClustersResponse.verify|verify} messages. + * @param message ListWorkstationClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IListWorkstationClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWorkstationClustersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWorkstationClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.ListWorkstationClustersResponse; + + /** + * Decodes a ListWorkstationClustersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWorkstationClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.ListWorkstationClustersResponse; + + /** + * Verifies a ListWorkstationClustersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListWorkstationClustersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWorkstationClustersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.ListWorkstationClustersResponse; + + /** + * Creates a plain object from a ListWorkstationClustersResponse message. Also converts values to other types if specified. + * @param message ListWorkstationClustersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.ListWorkstationClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWorkstationClustersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWorkstationClustersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateWorkstationClusterRequest. */ + interface ICreateWorkstationClusterRequest { + + /** CreateWorkstationClusterRequest parent */ + parent?: (string|null); + + /** CreateWorkstationClusterRequest workstationClusterId */ + workstationClusterId?: (string|null); + + /** CreateWorkstationClusterRequest workstationCluster */ + workstationCluster?: (google.cloud.workstations.v1.IWorkstationCluster|null); + + /** CreateWorkstationClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateWorkstationClusterRequest. */ + class CreateWorkstationClusterRequest implements ICreateWorkstationClusterRequest { + + /** + * Constructs a new CreateWorkstationClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.ICreateWorkstationClusterRequest); + + /** CreateWorkstationClusterRequest parent. */ + public parent: string; + + /** CreateWorkstationClusterRequest workstationClusterId. */ + public workstationClusterId: string; + + /** CreateWorkstationClusterRequest workstationCluster. */ + public workstationCluster?: (google.cloud.workstations.v1.IWorkstationCluster|null); + + /** CreateWorkstationClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateWorkstationClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateWorkstationClusterRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.ICreateWorkstationClusterRequest): google.cloud.workstations.v1.CreateWorkstationClusterRequest; + + /** + * Encodes the specified CreateWorkstationClusterRequest message. Does not implicitly {@link google.cloud.workstations.v1.CreateWorkstationClusterRequest.verify|verify} messages. + * @param message CreateWorkstationClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.ICreateWorkstationClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateWorkstationClusterRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.CreateWorkstationClusterRequest.verify|verify} messages. + * @param message CreateWorkstationClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.ICreateWorkstationClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateWorkstationClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateWorkstationClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.CreateWorkstationClusterRequest; + + /** + * Decodes a CreateWorkstationClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateWorkstationClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.CreateWorkstationClusterRequest; + + /** + * Verifies a CreateWorkstationClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateWorkstationClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateWorkstationClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.CreateWorkstationClusterRequest; + + /** + * Creates a plain object from a CreateWorkstationClusterRequest message. Also converts values to other types if specified. + * @param message CreateWorkstationClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.CreateWorkstationClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateWorkstationClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateWorkstationClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateWorkstationClusterRequest. */ + interface IUpdateWorkstationClusterRequest { + + /** UpdateWorkstationClusterRequest workstationCluster */ + workstationCluster?: (google.cloud.workstations.v1.IWorkstationCluster|null); + + /** UpdateWorkstationClusterRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateWorkstationClusterRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateWorkstationClusterRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateWorkstationClusterRequest. */ + class UpdateWorkstationClusterRequest implements IUpdateWorkstationClusterRequest { + + /** + * Constructs a new UpdateWorkstationClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IUpdateWorkstationClusterRequest); + + /** UpdateWorkstationClusterRequest workstationCluster. */ + public workstationCluster?: (google.cloud.workstations.v1.IWorkstationCluster|null); + + /** UpdateWorkstationClusterRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateWorkstationClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateWorkstationClusterRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateWorkstationClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateWorkstationClusterRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.IUpdateWorkstationClusterRequest): google.cloud.workstations.v1.UpdateWorkstationClusterRequest; + + /** + * Encodes the specified UpdateWorkstationClusterRequest message. Does not implicitly {@link google.cloud.workstations.v1.UpdateWorkstationClusterRequest.verify|verify} messages. + * @param message UpdateWorkstationClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IUpdateWorkstationClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateWorkstationClusterRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.UpdateWorkstationClusterRequest.verify|verify} messages. + * @param message UpdateWorkstationClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IUpdateWorkstationClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateWorkstationClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateWorkstationClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.UpdateWorkstationClusterRequest; + + /** + * Decodes an UpdateWorkstationClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateWorkstationClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.UpdateWorkstationClusterRequest; + + /** + * Verifies an UpdateWorkstationClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateWorkstationClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateWorkstationClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.UpdateWorkstationClusterRequest; + + /** + * Creates a plain object from an UpdateWorkstationClusterRequest message. Also converts values to other types if specified. + * @param message UpdateWorkstationClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.UpdateWorkstationClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateWorkstationClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateWorkstationClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteWorkstationClusterRequest. */ + interface IDeleteWorkstationClusterRequest { + + /** DeleteWorkstationClusterRequest name */ + name?: (string|null); + + /** DeleteWorkstationClusterRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteWorkstationClusterRequest etag */ + etag?: (string|null); + + /** DeleteWorkstationClusterRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteWorkstationClusterRequest. */ + class DeleteWorkstationClusterRequest implements IDeleteWorkstationClusterRequest { + + /** + * Constructs a new DeleteWorkstationClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IDeleteWorkstationClusterRequest); + + /** DeleteWorkstationClusterRequest name. */ + public name: string; + + /** DeleteWorkstationClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteWorkstationClusterRequest etag. */ + public etag: string; + + /** DeleteWorkstationClusterRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteWorkstationClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteWorkstationClusterRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.IDeleteWorkstationClusterRequest): google.cloud.workstations.v1.DeleteWorkstationClusterRequest; + + /** + * Encodes the specified DeleteWorkstationClusterRequest message. Does not implicitly {@link google.cloud.workstations.v1.DeleteWorkstationClusterRequest.verify|verify} messages. + * @param message DeleteWorkstationClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IDeleteWorkstationClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteWorkstationClusterRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.DeleteWorkstationClusterRequest.verify|verify} messages. + * @param message DeleteWorkstationClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IDeleteWorkstationClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteWorkstationClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteWorkstationClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.DeleteWorkstationClusterRequest; + + /** + * Decodes a DeleteWorkstationClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteWorkstationClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.DeleteWorkstationClusterRequest; + + /** + * Verifies a DeleteWorkstationClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteWorkstationClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteWorkstationClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.DeleteWorkstationClusterRequest; + + /** + * Creates a plain object from a DeleteWorkstationClusterRequest message. Also converts values to other types if specified. + * @param message DeleteWorkstationClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.DeleteWorkstationClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteWorkstationClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteWorkstationClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetWorkstationConfigRequest. */ + interface IGetWorkstationConfigRequest { + + /** GetWorkstationConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetWorkstationConfigRequest. */ + class GetWorkstationConfigRequest implements IGetWorkstationConfigRequest { + + /** + * Constructs a new GetWorkstationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IGetWorkstationConfigRequest); + + /** GetWorkstationConfigRequest name. */ + public name: string; + + /** + * Creates a new GetWorkstationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetWorkstationConfigRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.IGetWorkstationConfigRequest): google.cloud.workstations.v1.GetWorkstationConfigRequest; + + /** + * Encodes the specified GetWorkstationConfigRequest message. Does not implicitly {@link google.cloud.workstations.v1.GetWorkstationConfigRequest.verify|verify} messages. + * @param message GetWorkstationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IGetWorkstationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetWorkstationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.GetWorkstationConfigRequest.verify|verify} messages. + * @param message GetWorkstationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IGetWorkstationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetWorkstationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetWorkstationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.GetWorkstationConfigRequest; + + /** + * Decodes a GetWorkstationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetWorkstationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.GetWorkstationConfigRequest; + + /** + * Verifies a GetWorkstationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetWorkstationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetWorkstationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.GetWorkstationConfigRequest; + + /** + * Creates a plain object from a GetWorkstationConfigRequest message. Also converts values to other types if specified. + * @param message GetWorkstationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.GetWorkstationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetWorkstationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetWorkstationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListWorkstationConfigsRequest. */ + interface IListWorkstationConfigsRequest { + + /** ListWorkstationConfigsRequest parent */ + parent?: (string|null); + + /** ListWorkstationConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListWorkstationConfigsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListWorkstationConfigsRequest. */ + class ListWorkstationConfigsRequest implements IListWorkstationConfigsRequest { + + /** + * Constructs a new ListWorkstationConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IListWorkstationConfigsRequest); + + /** ListWorkstationConfigsRequest parent. */ + public parent: string; + + /** ListWorkstationConfigsRequest pageSize. */ + public pageSize: number; + + /** ListWorkstationConfigsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListWorkstationConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWorkstationConfigsRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.IListWorkstationConfigsRequest): google.cloud.workstations.v1.ListWorkstationConfigsRequest; + + /** + * Encodes the specified ListWorkstationConfigsRequest message. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationConfigsRequest.verify|verify} messages. + * @param message ListWorkstationConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IListWorkstationConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWorkstationConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationConfigsRequest.verify|verify} messages. + * @param message ListWorkstationConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IListWorkstationConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWorkstationConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWorkstationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.ListWorkstationConfigsRequest; + + /** + * Decodes a ListWorkstationConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWorkstationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.ListWorkstationConfigsRequest; + + /** + * Verifies a ListWorkstationConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListWorkstationConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWorkstationConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.ListWorkstationConfigsRequest; + + /** + * Creates a plain object from a ListWorkstationConfigsRequest message. Also converts values to other types if specified. + * @param message ListWorkstationConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.ListWorkstationConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWorkstationConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWorkstationConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListWorkstationConfigsResponse. */ + interface IListWorkstationConfigsResponse { + + /** ListWorkstationConfigsResponse workstationConfigs */ + workstationConfigs?: (google.cloud.workstations.v1.IWorkstationConfig[]|null); + + /** ListWorkstationConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListWorkstationConfigsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListWorkstationConfigsResponse. */ + class ListWorkstationConfigsResponse implements IListWorkstationConfigsResponse { + + /** + * Constructs a new ListWorkstationConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IListWorkstationConfigsResponse); + + /** ListWorkstationConfigsResponse workstationConfigs. */ + public workstationConfigs: google.cloud.workstations.v1.IWorkstationConfig[]; + + /** ListWorkstationConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListWorkstationConfigsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListWorkstationConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWorkstationConfigsResponse instance + */ + public static create(properties?: google.cloud.workstations.v1.IListWorkstationConfigsResponse): google.cloud.workstations.v1.ListWorkstationConfigsResponse; + + /** + * Encodes the specified ListWorkstationConfigsResponse message. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationConfigsResponse.verify|verify} messages. + * @param message ListWorkstationConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IListWorkstationConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWorkstationConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationConfigsResponse.verify|verify} messages. + * @param message ListWorkstationConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IListWorkstationConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWorkstationConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWorkstationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.ListWorkstationConfigsResponse; + + /** + * Decodes a ListWorkstationConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWorkstationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.ListWorkstationConfigsResponse; + + /** + * Verifies a ListWorkstationConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListWorkstationConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWorkstationConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.ListWorkstationConfigsResponse; + + /** + * Creates a plain object from a ListWorkstationConfigsResponse message. Also converts values to other types if specified. + * @param message ListWorkstationConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.ListWorkstationConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWorkstationConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWorkstationConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUsableWorkstationConfigsRequest. */ + interface IListUsableWorkstationConfigsRequest { + + /** ListUsableWorkstationConfigsRequest parent */ + parent?: (string|null); + + /** ListUsableWorkstationConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListUsableWorkstationConfigsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListUsableWorkstationConfigsRequest. */ + class ListUsableWorkstationConfigsRequest implements IListUsableWorkstationConfigsRequest { + + /** + * Constructs a new ListUsableWorkstationConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest); + + /** ListUsableWorkstationConfigsRequest parent. */ + public parent: string; + + /** ListUsableWorkstationConfigsRequest pageSize. */ + public pageSize: number; + + /** ListUsableWorkstationConfigsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListUsableWorkstationConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUsableWorkstationConfigsRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest): google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest; + + /** + * Encodes the specified ListUsableWorkstationConfigsRequest message. Does not implicitly {@link google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest.verify|verify} messages. + * @param message ListUsableWorkstationConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUsableWorkstationConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest.verify|verify} messages. + * @param message ListUsableWorkstationConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUsableWorkstationConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUsableWorkstationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest; + + /** + * Decodes a ListUsableWorkstationConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUsableWorkstationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest; + + /** + * Verifies a ListUsableWorkstationConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUsableWorkstationConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUsableWorkstationConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest; + + /** + * Creates a plain object from a ListUsableWorkstationConfigsRequest message. Also converts values to other types if specified. + * @param message ListUsableWorkstationConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUsableWorkstationConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUsableWorkstationConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUsableWorkstationConfigsResponse. */ + interface IListUsableWorkstationConfigsResponse { + + /** ListUsableWorkstationConfigsResponse workstationConfigs */ + workstationConfigs?: (google.cloud.workstations.v1.IWorkstationConfig[]|null); + + /** ListUsableWorkstationConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListUsableWorkstationConfigsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListUsableWorkstationConfigsResponse. */ + class ListUsableWorkstationConfigsResponse implements IListUsableWorkstationConfigsResponse { + + /** + * Constructs a new ListUsableWorkstationConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IListUsableWorkstationConfigsResponse); + + /** ListUsableWorkstationConfigsResponse workstationConfigs. */ + public workstationConfigs: google.cloud.workstations.v1.IWorkstationConfig[]; + + /** ListUsableWorkstationConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListUsableWorkstationConfigsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListUsableWorkstationConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUsableWorkstationConfigsResponse instance + */ + public static create(properties?: google.cloud.workstations.v1.IListUsableWorkstationConfigsResponse): google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse; + + /** + * Encodes the specified ListUsableWorkstationConfigsResponse message. Does not implicitly {@link google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse.verify|verify} messages. + * @param message ListUsableWorkstationConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IListUsableWorkstationConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUsableWorkstationConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse.verify|verify} messages. + * @param message ListUsableWorkstationConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IListUsableWorkstationConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUsableWorkstationConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUsableWorkstationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse; + + /** + * Decodes a ListUsableWorkstationConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUsableWorkstationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse; + + /** + * Verifies a ListUsableWorkstationConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUsableWorkstationConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUsableWorkstationConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse; + + /** + * Creates a plain object from a ListUsableWorkstationConfigsResponse message. Also converts values to other types if specified. + * @param message ListUsableWorkstationConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUsableWorkstationConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUsableWorkstationConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateWorkstationConfigRequest. */ + interface ICreateWorkstationConfigRequest { + + /** CreateWorkstationConfigRequest parent */ + parent?: (string|null); + + /** CreateWorkstationConfigRequest workstationConfigId */ + workstationConfigId?: (string|null); + + /** CreateWorkstationConfigRequest workstationConfig */ + workstationConfig?: (google.cloud.workstations.v1.IWorkstationConfig|null); + + /** CreateWorkstationConfigRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateWorkstationConfigRequest. */ + class CreateWorkstationConfigRequest implements ICreateWorkstationConfigRequest { + + /** + * Constructs a new CreateWorkstationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.ICreateWorkstationConfigRequest); + + /** CreateWorkstationConfigRequest parent. */ + public parent: string; + + /** CreateWorkstationConfigRequest workstationConfigId. */ + public workstationConfigId: string; + + /** CreateWorkstationConfigRequest workstationConfig. */ + public workstationConfig?: (google.cloud.workstations.v1.IWorkstationConfig|null); + + /** CreateWorkstationConfigRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateWorkstationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateWorkstationConfigRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.ICreateWorkstationConfigRequest): google.cloud.workstations.v1.CreateWorkstationConfigRequest; + + /** + * Encodes the specified CreateWorkstationConfigRequest message. Does not implicitly {@link google.cloud.workstations.v1.CreateWorkstationConfigRequest.verify|verify} messages. + * @param message CreateWorkstationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.ICreateWorkstationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateWorkstationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.CreateWorkstationConfigRequest.verify|verify} messages. + * @param message CreateWorkstationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.ICreateWorkstationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateWorkstationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateWorkstationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.CreateWorkstationConfigRequest; + + /** + * Decodes a CreateWorkstationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateWorkstationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.CreateWorkstationConfigRequest; + + /** + * Verifies a CreateWorkstationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateWorkstationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateWorkstationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.CreateWorkstationConfigRequest; + + /** + * Creates a plain object from a CreateWorkstationConfigRequest message. Also converts values to other types if specified. + * @param message CreateWorkstationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.CreateWorkstationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateWorkstationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateWorkstationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateWorkstationConfigRequest. */ + interface IUpdateWorkstationConfigRequest { + + /** UpdateWorkstationConfigRequest workstationConfig */ + workstationConfig?: (google.cloud.workstations.v1.IWorkstationConfig|null); + + /** UpdateWorkstationConfigRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateWorkstationConfigRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateWorkstationConfigRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateWorkstationConfigRequest. */ + class UpdateWorkstationConfigRequest implements IUpdateWorkstationConfigRequest { + + /** + * Constructs a new UpdateWorkstationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IUpdateWorkstationConfigRequest); + + /** UpdateWorkstationConfigRequest workstationConfig. */ + public workstationConfig?: (google.cloud.workstations.v1.IWorkstationConfig|null); + + /** UpdateWorkstationConfigRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateWorkstationConfigRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateWorkstationConfigRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateWorkstationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateWorkstationConfigRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.IUpdateWorkstationConfigRequest): google.cloud.workstations.v1.UpdateWorkstationConfigRequest; + + /** + * Encodes the specified UpdateWorkstationConfigRequest message. Does not implicitly {@link google.cloud.workstations.v1.UpdateWorkstationConfigRequest.verify|verify} messages. + * @param message UpdateWorkstationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IUpdateWorkstationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateWorkstationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.UpdateWorkstationConfigRequest.verify|verify} messages. + * @param message UpdateWorkstationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IUpdateWorkstationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateWorkstationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateWorkstationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.UpdateWorkstationConfigRequest; + + /** + * Decodes an UpdateWorkstationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateWorkstationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.UpdateWorkstationConfigRequest; + + /** + * Verifies an UpdateWorkstationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateWorkstationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateWorkstationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.UpdateWorkstationConfigRequest; + + /** + * Creates a plain object from an UpdateWorkstationConfigRequest message. Also converts values to other types if specified. + * @param message UpdateWorkstationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.UpdateWorkstationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateWorkstationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateWorkstationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteWorkstationConfigRequest. */ + interface IDeleteWorkstationConfigRequest { + + /** DeleteWorkstationConfigRequest name */ + name?: (string|null); + + /** DeleteWorkstationConfigRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteWorkstationConfigRequest etag */ + etag?: (string|null); + + /** DeleteWorkstationConfigRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteWorkstationConfigRequest. */ + class DeleteWorkstationConfigRequest implements IDeleteWorkstationConfigRequest { + + /** + * Constructs a new DeleteWorkstationConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IDeleteWorkstationConfigRequest); + + /** DeleteWorkstationConfigRequest name. */ + public name: string; + + /** DeleteWorkstationConfigRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteWorkstationConfigRequest etag. */ + public etag: string; + + /** DeleteWorkstationConfigRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteWorkstationConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteWorkstationConfigRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.IDeleteWorkstationConfigRequest): google.cloud.workstations.v1.DeleteWorkstationConfigRequest; + + /** + * Encodes the specified DeleteWorkstationConfigRequest message. Does not implicitly {@link google.cloud.workstations.v1.DeleteWorkstationConfigRequest.verify|verify} messages. + * @param message DeleteWorkstationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IDeleteWorkstationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteWorkstationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.DeleteWorkstationConfigRequest.verify|verify} messages. + * @param message DeleteWorkstationConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IDeleteWorkstationConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteWorkstationConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteWorkstationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.DeleteWorkstationConfigRequest; + + /** + * Decodes a DeleteWorkstationConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteWorkstationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.DeleteWorkstationConfigRequest; + + /** + * Verifies a DeleteWorkstationConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteWorkstationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteWorkstationConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.DeleteWorkstationConfigRequest; + + /** + * Creates a plain object from a DeleteWorkstationConfigRequest message. Also converts values to other types if specified. + * @param message DeleteWorkstationConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.DeleteWorkstationConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteWorkstationConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteWorkstationConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetWorkstationRequest. */ + interface IGetWorkstationRequest { + + /** GetWorkstationRequest name */ + name?: (string|null); + } + + /** Represents a GetWorkstationRequest. */ + class GetWorkstationRequest implements IGetWorkstationRequest { + + /** + * Constructs a new GetWorkstationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IGetWorkstationRequest); + + /** GetWorkstationRequest name. */ + public name: string; + + /** + * Creates a new GetWorkstationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetWorkstationRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.IGetWorkstationRequest): google.cloud.workstations.v1.GetWorkstationRequest; + + /** + * Encodes the specified GetWorkstationRequest message. Does not implicitly {@link google.cloud.workstations.v1.GetWorkstationRequest.verify|verify} messages. + * @param message GetWorkstationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IGetWorkstationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetWorkstationRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.GetWorkstationRequest.verify|verify} messages. + * @param message GetWorkstationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IGetWorkstationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetWorkstationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.GetWorkstationRequest; + + /** + * Decodes a GetWorkstationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.GetWorkstationRequest; + + /** + * Verifies a GetWorkstationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetWorkstationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetWorkstationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.GetWorkstationRequest; + + /** + * Creates a plain object from a GetWorkstationRequest message. Also converts values to other types if specified. + * @param message GetWorkstationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.GetWorkstationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetWorkstationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetWorkstationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListWorkstationsRequest. */ + interface IListWorkstationsRequest { + + /** ListWorkstationsRequest parent */ + parent?: (string|null); + + /** ListWorkstationsRequest pageSize */ + pageSize?: (number|null); + + /** ListWorkstationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListWorkstationsRequest. */ + class ListWorkstationsRequest implements IListWorkstationsRequest { + + /** + * Constructs a new ListWorkstationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IListWorkstationsRequest); + + /** ListWorkstationsRequest parent. */ + public parent: string; + + /** ListWorkstationsRequest pageSize. */ + public pageSize: number; + + /** ListWorkstationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListWorkstationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWorkstationsRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.IListWorkstationsRequest): google.cloud.workstations.v1.ListWorkstationsRequest; + + /** + * Encodes the specified ListWorkstationsRequest message. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationsRequest.verify|verify} messages. + * @param message ListWorkstationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IListWorkstationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWorkstationsRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationsRequest.verify|verify} messages. + * @param message ListWorkstationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IListWorkstationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWorkstationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWorkstationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.ListWorkstationsRequest; + + /** + * Decodes a ListWorkstationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWorkstationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.ListWorkstationsRequest; + + /** + * Verifies a ListWorkstationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListWorkstationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWorkstationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.ListWorkstationsRequest; + + /** + * Creates a plain object from a ListWorkstationsRequest message. Also converts values to other types if specified. + * @param message ListWorkstationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.ListWorkstationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWorkstationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWorkstationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListWorkstationsResponse. */ + interface IListWorkstationsResponse { + + /** ListWorkstationsResponse workstations */ + workstations?: (google.cloud.workstations.v1.IWorkstation[]|null); + + /** ListWorkstationsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListWorkstationsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListWorkstationsResponse. */ + class ListWorkstationsResponse implements IListWorkstationsResponse { + + /** + * Constructs a new ListWorkstationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IListWorkstationsResponse); + + /** ListWorkstationsResponse workstations. */ + public workstations: google.cloud.workstations.v1.IWorkstation[]; + + /** ListWorkstationsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListWorkstationsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListWorkstationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListWorkstationsResponse instance + */ + public static create(properties?: google.cloud.workstations.v1.IListWorkstationsResponse): google.cloud.workstations.v1.ListWorkstationsResponse; + + /** + * Encodes the specified ListWorkstationsResponse message. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationsResponse.verify|verify} messages. + * @param message ListWorkstationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IListWorkstationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListWorkstationsResponse message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationsResponse.verify|verify} messages. + * @param message ListWorkstationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IListWorkstationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListWorkstationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListWorkstationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.ListWorkstationsResponse; + + /** + * Decodes a ListWorkstationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListWorkstationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.ListWorkstationsResponse; + + /** + * Verifies a ListWorkstationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListWorkstationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListWorkstationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.ListWorkstationsResponse; + + /** + * Creates a plain object from a ListWorkstationsResponse message. Also converts values to other types if specified. + * @param message ListWorkstationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.ListWorkstationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListWorkstationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListWorkstationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUsableWorkstationsRequest. */ + interface IListUsableWorkstationsRequest { + + /** ListUsableWorkstationsRequest parent */ + parent?: (string|null); + + /** ListUsableWorkstationsRequest pageSize */ + pageSize?: (number|null); + + /** ListUsableWorkstationsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListUsableWorkstationsRequest. */ + class ListUsableWorkstationsRequest implements IListUsableWorkstationsRequest { + + /** + * Constructs a new ListUsableWorkstationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IListUsableWorkstationsRequest); + + /** ListUsableWorkstationsRequest parent. */ + public parent: string; + + /** ListUsableWorkstationsRequest pageSize. */ + public pageSize: number; + + /** ListUsableWorkstationsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListUsableWorkstationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUsableWorkstationsRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.IListUsableWorkstationsRequest): google.cloud.workstations.v1.ListUsableWorkstationsRequest; + + /** + * Encodes the specified ListUsableWorkstationsRequest message. Does not implicitly {@link google.cloud.workstations.v1.ListUsableWorkstationsRequest.verify|verify} messages. + * @param message ListUsableWorkstationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IListUsableWorkstationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUsableWorkstationsRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListUsableWorkstationsRequest.verify|verify} messages. + * @param message ListUsableWorkstationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IListUsableWorkstationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUsableWorkstationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUsableWorkstationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.ListUsableWorkstationsRequest; + + /** + * Decodes a ListUsableWorkstationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUsableWorkstationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.ListUsableWorkstationsRequest; + + /** + * Verifies a ListUsableWorkstationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUsableWorkstationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUsableWorkstationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.ListUsableWorkstationsRequest; + + /** + * Creates a plain object from a ListUsableWorkstationsRequest message. Also converts values to other types if specified. + * @param message ListUsableWorkstationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.ListUsableWorkstationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUsableWorkstationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUsableWorkstationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListUsableWorkstationsResponse. */ + interface IListUsableWorkstationsResponse { + + /** ListUsableWorkstationsResponse workstations */ + workstations?: (google.cloud.workstations.v1.IWorkstation[]|null); + + /** ListUsableWorkstationsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListUsableWorkstationsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListUsableWorkstationsResponse. */ + class ListUsableWorkstationsResponse implements IListUsableWorkstationsResponse { + + /** + * Constructs a new ListUsableWorkstationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IListUsableWorkstationsResponse); + + /** ListUsableWorkstationsResponse workstations. */ + public workstations: google.cloud.workstations.v1.IWorkstation[]; + + /** ListUsableWorkstationsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListUsableWorkstationsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListUsableWorkstationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListUsableWorkstationsResponse instance + */ + public static create(properties?: google.cloud.workstations.v1.IListUsableWorkstationsResponse): google.cloud.workstations.v1.ListUsableWorkstationsResponse; + + /** + * Encodes the specified ListUsableWorkstationsResponse message. Does not implicitly {@link google.cloud.workstations.v1.ListUsableWorkstationsResponse.verify|verify} messages. + * @param message ListUsableWorkstationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IListUsableWorkstationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListUsableWorkstationsResponse message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListUsableWorkstationsResponse.verify|verify} messages. + * @param message ListUsableWorkstationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IListUsableWorkstationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListUsableWorkstationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListUsableWorkstationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.ListUsableWorkstationsResponse; + + /** + * Decodes a ListUsableWorkstationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListUsableWorkstationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.ListUsableWorkstationsResponse; + + /** + * Verifies a ListUsableWorkstationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListUsableWorkstationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListUsableWorkstationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.ListUsableWorkstationsResponse; + + /** + * Creates a plain object from a ListUsableWorkstationsResponse message. Also converts values to other types if specified. + * @param message ListUsableWorkstationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.ListUsableWorkstationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListUsableWorkstationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListUsableWorkstationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateWorkstationRequest. */ + interface ICreateWorkstationRequest { + + /** CreateWorkstationRequest parent */ + parent?: (string|null); + + /** CreateWorkstationRequest workstationId */ + workstationId?: (string|null); + + /** CreateWorkstationRequest workstation */ + workstation?: (google.cloud.workstations.v1.IWorkstation|null); + + /** CreateWorkstationRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateWorkstationRequest. */ + class CreateWorkstationRequest implements ICreateWorkstationRequest { + + /** + * Constructs a new CreateWorkstationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.ICreateWorkstationRequest); + + /** CreateWorkstationRequest parent. */ + public parent: string; + + /** CreateWorkstationRequest workstationId. */ + public workstationId: string; + + /** CreateWorkstationRequest workstation. */ + public workstation?: (google.cloud.workstations.v1.IWorkstation|null); + + /** CreateWorkstationRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateWorkstationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateWorkstationRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.ICreateWorkstationRequest): google.cloud.workstations.v1.CreateWorkstationRequest; + + /** + * Encodes the specified CreateWorkstationRequest message. Does not implicitly {@link google.cloud.workstations.v1.CreateWorkstationRequest.verify|verify} messages. + * @param message CreateWorkstationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.ICreateWorkstationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateWorkstationRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.CreateWorkstationRequest.verify|verify} messages. + * @param message CreateWorkstationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.ICreateWorkstationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateWorkstationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.CreateWorkstationRequest; + + /** + * Decodes a CreateWorkstationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.CreateWorkstationRequest; + + /** + * Verifies a CreateWorkstationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateWorkstationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateWorkstationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.CreateWorkstationRequest; + + /** + * Creates a plain object from a CreateWorkstationRequest message. Also converts values to other types if specified. + * @param message CreateWorkstationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.CreateWorkstationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateWorkstationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateWorkstationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateWorkstationRequest. */ + interface IUpdateWorkstationRequest { + + /** UpdateWorkstationRequest workstation */ + workstation?: (google.cloud.workstations.v1.IWorkstation|null); + + /** UpdateWorkstationRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateWorkstationRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateWorkstationRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateWorkstationRequest. */ + class UpdateWorkstationRequest implements IUpdateWorkstationRequest { + + /** + * Constructs a new UpdateWorkstationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IUpdateWorkstationRequest); + + /** UpdateWorkstationRequest workstation. */ + public workstation?: (google.cloud.workstations.v1.IWorkstation|null); + + /** UpdateWorkstationRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateWorkstationRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateWorkstationRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateWorkstationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateWorkstationRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.IUpdateWorkstationRequest): google.cloud.workstations.v1.UpdateWorkstationRequest; + + /** + * Encodes the specified UpdateWorkstationRequest message. Does not implicitly {@link google.cloud.workstations.v1.UpdateWorkstationRequest.verify|verify} messages. + * @param message UpdateWorkstationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IUpdateWorkstationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateWorkstationRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.UpdateWorkstationRequest.verify|verify} messages. + * @param message UpdateWorkstationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IUpdateWorkstationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateWorkstationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.UpdateWorkstationRequest; + + /** + * Decodes an UpdateWorkstationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.UpdateWorkstationRequest; + + /** + * Verifies an UpdateWorkstationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateWorkstationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateWorkstationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.UpdateWorkstationRequest; + + /** + * Creates a plain object from an UpdateWorkstationRequest message. Also converts values to other types if specified. + * @param message UpdateWorkstationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.UpdateWorkstationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateWorkstationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateWorkstationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteWorkstationRequest. */ + interface IDeleteWorkstationRequest { + + /** DeleteWorkstationRequest name */ + name?: (string|null); + + /** DeleteWorkstationRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteWorkstationRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteWorkstationRequest. */ + class DeleteWorkstationRequest implements IDeleteWorkstationRequest { + + /** + * Constructs a new DeleteWorkstationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IDeleteWorkstationRequest); + + /** DeleteWorkstationRequest name. */ + public name: string; + + /** DeleteWorkstationRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteWorkstationRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteWorkstationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteWorkstationRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.IDeleteWorkstationRequest): google.cloud.workstations.v1.DeleteWorkstationRequest; + + /** + * Encodes the specified DeleteWorkstationRequest message. Does not implicitly {@link google.cloud.workstations.v1.DeleteWorkstationRequest.verify|verify} messages. + * @param message DeleteWorkstationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IDeleteWorkstationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteWorkstationRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.DeleteWorkstationRequest.verify|verify} messages. + * @param message DeleteWorkstationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IDeleteWorkstationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteWorkstationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.DeleteWorkstationRequest; + + /** + * Decodes a DeleteWorkstationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.DeleteWorkstationRequest; + + /** + * Verifies a DeleteWorkstationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteWorkstationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteWorkstationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.DeleteWorkstationRequest; + + /** + * Creates a plain object from a DeleteWorkstationRequest message. Also converts values to other types if specified. + * @param message DeleteWorkstationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.DeleteWorkstationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteWorkstationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteWorkstationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StartWorkstationRequest. */ + interface IStartWorkstationRequest { + + /** StartWorkstationRequest name */ + name?: (string|null); + + /** StartWorkstationRequest validateOnly */ + validateOnly?: (boolean|null); + + /** StartWorkstationRequest etag */ + etag?: (string|null); + } + + /** Represents a StartWorkstationRequest. */ + class StartWorkstationRequest implements IStartWorkstationRequest { + + /** + * Constructs a new StartWorkstationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IStartWorkstationRequest); + + /** StartWorkstationRequest name. */ + public name: string; + + /** StartWorkstationRequest validateOnly. */ + public validateOnly: boolean; + + /** StartWorkstationRequest etag. */ + public etag: string; + + /** + * Creates a new StartWorkstationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StartWorkstationRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.IStartWorkstationRequest): google.cloud.workstations.v1.StartWorkstationRequest; + + /** + * Encodes the specified StartWorkstationRequest message. Does not implicitly {@link google.cloud.workstations.v1.StartWorkstationRequest.verify|verify} messages. + * @param message StartWorkstationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IStartWorkstationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StartWorkstationRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.StartWorkstationRequest.verify|verify} messages. + * @param message StartWorkstationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IStartWorkstationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StartWorkstationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StartWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.StartWorkstationRequest; + + /** + * Decodes a StartWorkstationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StartWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.StartWorkstationRequest; + + /** + * Verifies a StartWorkstationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StartWorkstationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StartWorkstationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.StartWorkstationRequest; + + /** + * Creates a plain object from a StartWorkstationRequest message. Also converts values to other types if specified. + * @param message StartWorkstationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.StartWorkstationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StartWorkstationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StartWorkstationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StopWorkstationRequest. */ + interface IStopWorkstationRequest { + + /** StopWorkstationRequest name */ + name?: (string|null); + + /** StopWorkstationRequest validateOnly */ + validateOnly?: (boolean|null); + + /** StopWorkstationRequest etag */ + etag?: (string|null); + } + + /** Represents a StopWorkstationRequest. */ + class StopWorkstationRequest implements IStopWorkstationRequest { + + /** + * Constructs a new StopWorkstationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IStopWorkstationRequest); + + /** StopWorkstationRequest name. */ + public name: string; + + /** StopWorkstationRequest validateOnly. */ + public validateOnly: boolean; + + /** StopWorkstationRequest etag. */ + public etag: string; + + /** + * Creates a new StopWorkstationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StopWorkstationRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.IStopWorkstationRequest): google.cloud.workstations.v1.StopWorkstationRequest; + + /** + * Encodes the specified StopWorkstationRequest message. Does not implicitly {@link google.cloud.workstations.v1.StopWorkstationRequest.verify|verify} messages. + * @param message StopWorkstationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IStopWorkstationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StopWorkstationRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.StopWorkstationRequest.verify|verify} messages. + * @param message StopWorkstationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IStopWorkstationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StopWorkstationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StopWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.StopWorkstationRequest; + + /** + * Decodes a StopWorkstationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StopWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.StopWorkstationRequest; + + /** + * Verifies a StopWorkstationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StopWorkstationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StopWorkstationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.StopWorkstationRequest; + + /** + * Creates a plain object from a StopWorkstationRequest message. Also converts values to other types if specified. + * @param message StopWorkstationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.StopWorkstationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StopWorkstationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StopWorkstationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateAccessTokenRequest. */ + interface IGenerateAccessTokenRequest { + + /** GenerateAccessTokenRequest expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** GenerateAccessTokenRequest ttl */ + ttl?: (google.protobuf.IDuration|null); + + /** GenerateAccessTokenRequest workstation */ + workstation?: (string|null); + } + + /** Represents a GenerateAccessTokenRequest. */ + class GenerateAccessTokenRequest implements IGenerateAccessTokenRequest { + + /** + * Constructs a new GenerateAccessTokenRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IGenerateAccessTokenRequest); + + /** GenerateAccessTokenRequest expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** GenerateAccessTokenRequest ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** GenerateAccessTokenRequest workstation. */ + public workstation: string; + + /** GenerateAccessTokenRequest expiration. */ + public expiration?: ("expireTime"|"ttl"); + + /** + * Creates a new GenerateAccessTokenRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateAccessTokenRequest instance + */ + public static create(properties?: google.cloud.workstations.v1.IGenerateAccessTokenRequest): google.cloud.workstations.v1.GenerateAccessTokenRequest; + + /** + * Encodes the specified GenerateAccessTokenRequest message. Does not implicitly {@link google.cloud.workstations.v1.GenerateAccessTokenRequest.verify|verify} messages. + * @param message GenerateAccessTokenRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IGenerateAccessTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateAccessTokenRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.GenerateAccessTokenRequest.verify|verify} messages. + * @param message GenerateAccessTokenRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IGenerateAccessTokenRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateAccessTokenRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateAccessTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.GenerateAccessTokenRequest; + + /** + * Decodes a GenerateAccessTokenRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateAccessTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.GenerateAccessTokenRequest; + + /** + * Verifies a GenerateAccessTokenRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateAccessTokenRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateAccessTokenRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.GenerateAccessTokenRequest; + + /** + * Creates a plain object from a GenerateAccessTokenRequest message. Also converts values to other types if specified. + * @param message GenerateAccessTokenRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.GenerateAccessTokenRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateAccessTokenRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateAccessTokenRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateAccessTokenResponse. */ + interface IGenerateAccessTokenResponse { + + /** GenerateAccessTokenResponse accessToken */ + accessToken?: (string|null); + + /** GenerateAccessTokenResponse expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a GenerateAccessTokenResponse. */ + class GenerateAccessTokenResponse implements IGenerateAccessTokenResponse { + + /** + * Constructs a new GenerateAccessTokenResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IGenerateAccessTokenResponse); + + /** GenerateAccessTokenResponse accessToken. */ + public accessToken: string; + + /** GenerateAccessTokenResponse expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new GenerateAccessTokenResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateAccessTokenResponse instance + */ + public static create(properties?: google.cloud.workstations.v1.IGenerateAccessTokenResponse): google.cloud.workstations.v1.GenerateAccessTokenResponse; + + /** + * Encodes the specified GenerateAccessTokenResponse message. Does not implicitly {@link google.cloud.workstations.v1.GenerateAccessTokenResponse.verify|verify} messages. + * @param message GenerateAccessTokenResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IGenerateAccessTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateAccessTokenResponse message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.GenerateAccessTokenResponse.verify|verify} messages. + * @param message GenerateAccessTokenResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IGenerateAccessTokenResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateAccessTokenResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateAccessTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.GenerateAccessTokenResponse; + + /** + * Decodes a GenerateAccessTokenResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateAccessTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.GenerateAccessTokenResponse; + + /** + * Verifies a GenerateAccessTokenResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateAccessTokenResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateAccessTokenResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.GenerateAccessTokenResponse; + + /** + * Creates a plain object from a GenerateAccessTokenResponse message. Also converts values to other types if specified. + * @param message GenerateAccessTokenResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.GenerateAccessTokenResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateAccessTokenResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateAccessTokenResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.workstations.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.workstations.v1.IOperationMetadata): google.cloud.workstations.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.workstations.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.workstations.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.workstations.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.workstations.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.workstations.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.workstations.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.workstations.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Namespace v1beta. */ namespace v1beta { diff --git a/packages/google-cloud-workstations/protos/protos.js b/packages/google-cloud-workstations/protos/protos.js index 206cbdf8a49..00bec04bc0b 100644 --- a/packages/google-cloud-workstations/protos/protos.js +++ b/packages/google-cloud-workstations/protos/protos.js @@ -57,6 +57,12435 @@ */ var workstations = {}; + workstations.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.workstations + * @namespace + */ + var v1 = {}; + + v1.Workstations = (function() { + + /** + * Constructs a new Workstations service. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a Workstations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Workstations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Workstations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Workstations; + + /** + * Creates new Workstations service using the specified rpc implementation. + * @function create + * @memberof google.cloud.workstations.v1.Workstations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Workstations} RPC service. Useful where requests and/or responses are streamed. + */ + Workstations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|getWorkstationCluster}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef GetWorkstationClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.workstations.v1.WorkstationCluster} [response] WorkstationCluster + */ + + /** + * Calls GetWorkstationCluster. + * @function getWorkstationCluster + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IGetWorkstationClusterRequest} request GetWorkstationClusterRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.GetWorkstationClusterCallback} callback Node-style callback called with the error, if any, and WorkstationCluster + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.getWorkstationCluster = function getWorkstationCluster(request, callback) { + return this.rpcCall(getWorkstationCluster, $root.google.cloud.workstations.v1.GetWorkstationClusterRequest, $root.google.cloud.workstations.v1.WorkstationCluster, request, callback); + }, "name", { value: "GetWorkstationCluster" }); + + /** + * Calls GetWorkstationCluster. + * @function getWorkstationCluster + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IGetWorkstationClusterRequest} request GetWorkstationClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|listWorkstationClusters}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef ListWorkstationClustersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.workstations.v1.ListWorkstationClustersResponse} [response] ListWorkstationClustersResponse + */ + + /** + * Calls ListWorkstationClusters. + * @function listWorkstationClusters + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IListWorkstationClustersRequest} request ListWorkstationClustersRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.ListWorkstationClustersCallback} callback Node-style callback called with the error, if any, and ListWorkstationClustersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.listWorkstationClusters = function listWorkstationClusters(request, callback) { + return this.rpcCall(listWorkstationClusters, $root.google.cloud.workstations.v1.ListWorkstationClustersRequest, $root.google.cloud.workstations.v1.ListWorkstationClustersResponse, request, callback); + }, "name", { value: "ListWorkstationClusters" }); + + /** + * Calls ListWorkstationClusters. + * @function listWorkstationClusters + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IListWorkstationClustersRequest} request ListWorkstationClustersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|createWorkstationCluster}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef CreateWorkstationClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateWorkstationCluster. + * @function createWorkstationCluster + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.ICreateWorkstationClusterRequest} request CreateWorkstationClusterRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.CreateWorkstationClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.createWorkstationCluster = function createWorkstationCluster(request, callback) { + return this.rpcCall(createWorkstationCluster, $root.google.cloud.workstations.v1.CreateWorkstationClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateWorkstationCluster" }); + + /** + * Calls CreateWorkstationCluster. + * @function createWorkstationCluster + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.ICreateWorkstationClusterRequest} request CreateWorkstationClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|updateWorkstationCluster}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef UpdateWorkstationClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateWorkstationCluster. + * @function updateWorkstationCluster + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IUpdateWorkstationClusterRequest} request UpdateWorkstationClusterRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.UpdateWorkstationClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.updateWorkstationCluster = function updateWorkstationCluster(request, callback) { + return this.rpcCall(updateWorkstationCluster, $root.google.cloud.workstations.v1.UpdateWorkstationClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateWorkstationCluster" }); + + /** + * Calls UpdateWorkstationCluster. + * @function updateWorkstationCluster + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IUpdateWorkstationClusterRequest} request UpdateWorkstationClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|deleteWorkstationCluster}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef DeleteWorkstationClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteWorkstationCluster. + * @function deleteWorkstationCluster + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IDeleteWorkstationClusterRequest} request DeleteWorkstationClusterRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.DeleteWorkstationClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.deleteWorkstationCluster = function deleteWorkstationCluster(request, callback) { + return this.rpcCall(deleteWorkstationCluster, $root.google.cloud.workstations.v1.DeleteWorkstationClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteWorkstationCluster" }); + + /** + * Calls DeleteWorkstationCluster. + * @function deleteWorkstationCluster + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IDeleteWorkstationClusterRequest} request DeleteWorkstationClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|getWorkstationConfig}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef GetWorkstationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.workstations.v1.WorkstationConfig} [response] WorkstationConfig + */ + + /** + * Calls GetWorkstationConfig. + * @function getWorkstationConfig + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IGetWorkstationConfigRequest} request GetWorkstationConfigRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.GetWorkstationConfigCallback} callback Node-style callback called with the error, if any, and WorkstationConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.getWorkstationConfig = function getWorkstationConfig(request, callback) { + return this.rpcCall(getWorkstationConfig, $root.google.cloud.workstations.v1.GetWorkstationConfigRequest, $root.google.cloud.workstations.v1.WorkstationConfig, request, callback); + }, "name", { value: "GetWorkstationConfig" }); + + /** + * Calls GetWorkstationConfig. + * @function getWorkstationConfig + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IGetWorkstationConfigRequest} request GetWorkstationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|listWorkstationConfigs}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef ListWorkstationConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.workstations.v1.ListWorkstationConfigsResponse} [response] ListWorkstationConfigsResponse + */ + + /** + * Calls ListWorkstationConfigs. + * @function listWorkstationConfigs + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IListWorkstationConfigsRequest} request ListWorkstationConfigsRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.ListWorkstationConfigsCallback} callback Node-style callback called with the error, if any, and ListWorkstationConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.listWorkstationConfigs = function listWorkstationConfigs(request, callback) { + return this.rpcCall(listWorkstationConfigs, $root.google.cloud.workstations.v1.ListWorkstationConfigsRequest, $root.google.cloud.workstations.v1.ListWorkstationConfigsResponse, request, callback); + }, "name", { value: "ListWorkstationConfigs" }); + + /** + * Calls ListWorkstationConfigs. + * @function listWorkstationConfigs + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IListWorkstationConfigsRequest} request ListWorkstationConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|listUsableWorkstationConfigs}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef ListUsableWorkstationConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse} [response] ListUsableWorkstationConfigsResponse + */ + + /** + * Calls ListUsableWorkstationConfigs. + * @function listUsableWorkstationConfigs + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest} request ListUsableWorkstationConfigsRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.ListUsableWorkstationConfigsCallback} callback Node-style callback called with the error, if any, and ListUsableWorkstationConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.listUsableWorkstationConfigs = function listUsableWorkstationConfigs(request, callback) { + return this.rpcCall(listUsableWorkstationConfigs, $root.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest, $root.google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse, request, callback); + }, "name", { value: "ListUsableWorkstationConfigs" }); + + /** + * Calls ListUsableWorkstationConfigs. + * @function listUsableWorkstationConfigs + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest} request ListUsableWorkstationConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|createWorkstationConfig}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef CreateWorkstationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateWorkstationConfig. + * @function createWorkstationConfig + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.ICreateWorkstationConfigRequest} request CreateWorkstationConfigRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.CreateWorkstationConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.createWorkstationConfig = function createWorkstationConfig(request, callback) { + return this.rpcCall(createWorkstationConfig, $root.google.cloud.workstations.v1.CreateWorkstationConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateWorkstationConfig" }); + + /** + * Calls CreateWorkstationConfig. + * @function createWorkstationConfig + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.ICreateWorkstationConfigRequest} request CreateWorkstationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|updateWorkstationConfig}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef UpdateWorkstationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateWorkstationConfig. + * @function updateWorkstationConfig + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IUpdateWorkstationConfigRequest} request UpdateWorkstationConfigRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.UpdateWorkstationConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.updateWorkstationConfig = function updateWorkstationConfig(request, callback) { + return this.rpcCall(updateWorkstationConfig, $root.google.cloud.workstations.v1.UpdateWorkstationConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateWorkstationConfig" }); + + /** + * Calls UpdateWorkstationConfig. + * @function updateWorkstationConfig + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IUpdateWorkstationConfigRequest} request UpdateWorkstationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|deleteWorkstationConfig}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef DeleteWorkstationConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteWorkstationConfig. + * @function deleteWorkstationConfig + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IDeleteWorkstationConfigRequest} request DeleteWorkstationConfigRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.DeleteWorkstationConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.deleteWorkstationConfig = function deleteWorkstationConfig(request, callback) { + return this.rpcCall(deleteWorkstationConfig, $root.google.cloud.workstations.v1.DeleteWorkstationConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteWorkstationConfig" }); + + /** + * Calls DeleteWorkstationConfig. + * @function deleteWorkstationConfig + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IDeleteWorkstationConfigRequest} request DeleteWorkstationConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|getWorkstation}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef GetWorkstationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.workstations.v1.Workstation} [response] Workstation + */ + + /** + * Calls GetWorkstation. + * @function getWorkstation + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IGetWorkstationRequest} request GetWorkstationRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.GetWorkstationCallback} callback Node-style callback called with the error, if any, and Workstation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.getWorkstation = function getWorkstation(request, callback) { + return this.rpcCall(getWorkstation, $root.google.cloud.workstations.v1.GetWorkstationRequest, $root.google.cloud.workstations.v1.Workstation, request, callback); + }, "name", { value: "GetWorkstation" }); + + /** + * Calls GetWorkstation. + * @function getWorkstation + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IGetWorkstationRequest} request GetWorkstationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|listWorkstations}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef ListWorkstationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.workstations.v1.ListWorkstationsResponse} [response] ListWorkstationsResponse + */ + + /** + * Calls ListWorkstations. + * @function listWorkstations + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IListWorkstationsRequest} request ListWorkstationsRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.ListWorkstationsCallback} callback Node-style callback called with the error, if any, and ListWorkstationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.listWorkstations = function listWorkstations(request, callback) { + return this.rpcCall(listWorkstations, $root.google.cloud.workstations.v1.ListWorkstationsRequest, $root.google.cloud.workstations.v1.ListWorkstationsResponse, request, callback); + }, "name", { value: "ListWorkstations" }); + + /** + * Calls ListWorkstations. + * @function listWorkstations + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IListWorkstationsRequest} request ListWorkstationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|listUsableWorkstations}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef ListUsableWorkstationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.workstations.v1.ListUsableWorkstationsResponse} [response] ListUsableWorkstationsResponse + */ + + /** + * Calls ListUsableWorkstations. + * @function listUsableWorkstations + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IListUsableWorkstationsRequest} request ListUsableWorkstationsRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.ListUsableWorkstationsCallback} callback Node-style callback called with the error, if any, and ListUsableWorkstationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.listUsableWorkstations = function listUsableWorkstations(request, callback) { + return this.rpcCall(listUsableWorkstations, $root.google.cloud.workstations.v1.ListUsableWorkstationsRequest, $root.google.cloud.workstations.v1.ListUsableWorkstationsResponse, request, callback); + }, "name", { value: "ListUsableWorkstations" }); + + /** + * Calls ListUsableWorkstations. + * @function listUsableWorkstations + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IListUsableWorkstationsRequest} request ListUsableWorkstationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|createWorkstation}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef CreateWorkstationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateWorkstation. + * @function createWorkstation + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.ICreateWorkstationRequest} request CreateWorkstationRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.CreateWorkstationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.createWorkstation = function createWorkstation(request, callback) { + return this.rpcCall(createWorkstation, $root.google.cloud.workstations.v1.CreateWorkstationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateWorkstation" }); + + /** + * Calls CreateWorkstation. + * @function createWorkstation + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.ICreateWorkstationRequest} request CreateWorkstationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|updateWorkstation}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef UpdateWorkstationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateWorkstation. + * @function updateWorkstation + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IUpdateWorkstationRequest} request UpdateWorkstationRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.UpdateWorkstationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.updateWorkstation = function updateWorkstation(request, callback) { + return this.rpcCall(updateWorkstation, $root.google.cloud.workstations.v1.UpdateWorkstationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateWorkstation" }); + + /** + * Calls UpdateWorkstation. + * @function updateWorkstation + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IUpdateWorkstationRequest} request UpdateWorkstationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|deleteWorkstation}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef DeleteWorkstationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteWorkstation. + * @function deleteWorkstation + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IDeleteWorkstationRequest} request DeleteWorkstationRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.DeleteWorkstationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.deleteWorkstation = function deleteWorkstation(request, callback) { + return this.rpcCall(deleteWorkstation, $root.google.cloud.workstations.v1.DeleteWorkstationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteWorkstation" }); + + /** + * Calls DeleteWorkstation. + * @function deleteWorkstation + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IDeleteWorkstationRequest} request DeleteWorkstationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|startWorkstation}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef StartWorkstationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls StartWorkstation. + * @function startWorkstation + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IStartWorkstationRequest} request StartWorkstationRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.StartWorkstationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.startWorkstation = function startWorkstation(request, callback) { + return this.rpcCall(startWorkstation, $root.google.cloud.workstations.v1.StartWorkstationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StartWorkstation" }); + + /** + * Calls StartWorkstation. + * @function startWorkstation + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IStartWorkstationRequest} request StartWorkstationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|stopWorkstation}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef StopWorkstationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls StopWorkstation. + * @function stopWorkstation + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IStopWorkstationRequest} request StopWorkstationRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.StopWorkstationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.stopWorkstation = function stopWorkstation(request, callback) { + return this.rpcCall(stopWorkstation, $root.google.cloud.workstations.v1.StopWorkstationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "StopWorkstation" }); + + /** + * Calls StopWorkstation. + * @function stopWorkstation + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IStopWorkstationRequest} request StopWorkstationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.workstations.v1.Workstations|generateAccessToken}. + * @memberof google.cloud.workstations.v1.Workstations + * @typedef GenerateAccessTokenCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.workstations.v1.GenerateAccessTokenResponse} [response] GenerateAccessTokenResponse + */ + + /** + * Calls GenerateAccessToken. + * @function generateAccessToken + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IGenerateAccessTokenRequest} request GenerateAccessTokenRequest message or plain object + * @param {google.cloud.workstations.v1.Workstations.GenerateAccessTokenCallback} callback Node-style callback called with the error, if any, and GenerateAccessTokenResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Workstations.prototype.generateAccessToken = function generateAccessToken(request, callback) { + return this.rpcCall(generateAccessToken, $root.google.cloud.workstations.v1.GenerateAccessTokenRequest, $root.google.cloud.workstations.v1.GenerateAccessTokenResponse, request, callback); + }, "name", { value: "GenerateAccessToken" }); + + /** + * Calls GenerateAccessToken. + * @function generateAccessToken + * @memberof google.cloud.workstations.v1.Workstations + * @instance + * @param {google.cloud.workstations.v1.IGenerateAccessTokenRequest} request GenerateAccessTokenRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Workstations; + })(); + + v1.WorkstationCluster = (function() { + + /** + * Properties of a WorkstationCluster. + * @memberof google.cloud.workstations.v1 + * @interface IWorkstationCluster + * @property {string|null} [name] WorkstationCluster name + * @property {string|null} [displayName] WorkstationCluster displayName + * @property {string|null} [uid] WorkstationCluster uid + * @property {boolean|null} [reconciling] WorkstationCluster reconciling + * @property {Object.|null} [annotations] WorkstationCluster annotations + * @property {Object.|null} [labels] WorkstationCluster labels + * @property {google.protobuf.ITimestamp|null} [createTime] WorkstationCluster createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] WorkstationCluster updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] WorkstationCluster deleteTime + * @property {string|null} [etag] WorkstationCluster etag + * @property {string|null} [network] WorkstationCluster network + * @property {string|null} [subnetwork] WorkstationCluster subnetwork + * @property {google.cloud.workstations.v1.WorkstationCluster.IPrivateClusterConfig|null} [privateClusterConfig] WorkstationCluster privateClusterConfig + * @property {boolean|null} [degraded] WorkstationCluster degraded + * @property {Array.|null} [conditions] WorkstationCluster conditions + */ + + /** + * Constructs a new WorkstationCluster. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a WorkstationCluster. + * @implements IWorkstationCluster + * @constructor + * @param {google.cloud.workstations.v1.IWorkstationCluster=} [properties] Properties to set + */ + function WorkstationCluster(properties) { + this.annotations = {}; + this.labels = {}; + this.conditions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkstationCluster name. + * @member {string} name + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @instance + */ + WorkstationCluster.prototype.name = ""; + + /** + * WorkstationCluster displayName. + * @member {string} displayName + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @instance + */ + WorkstationCluster.prototype.displayName = ""; + + /** + * WorkstationCluster uid. + * @member {string} uid + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @instance + */ + WorkstationCluster.prototype.uid = ""; + + /** + * WorkstationCluster reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @instance + */ + WorkstationCluster.prototype.reconciling = false; + + /** + * WorkstationCluster annotations. + * @member {Object.} annotations + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @instance + */ + WorkstationCluster.prototype.annotations = $util.emptyObject; + + /** + * WorkstationCluster labels. + * @member {Object.} labels + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @instance + */ + WorkstationCluster.prototype.labels = $util.emptyObject; + + /** + * WorkstationCluster createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @instance + */ + WorkstationCluster.prototype.createTime = null; + + /** + * WorkstationCluster updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @instance + */ + WorkstationCluster.prototype.updateTime = null; + + /** + * WorkstationCluster deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @instance + */ + WorkstationCluster.prototype.deleteTime = null; + + /** + * WorkstationCluster etag. + * @member {string} etag + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @instance + */ + WorkstationCluster.prototype.etag = ""; + + /** + * WorkstationCluster network. + * @member {string} network + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @instance + */ + WorkstationCluster.prototype.network = ""; + + /** + * WorkstationCluster subnetwork. + * @member {string} subnetwork + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @instance + */ + WorkstationCluster.prototype.subnetwork = ""; + + /** + * WorkstationCluster privateClusterConfig. + * @member {google.cloud.workstations.v1.WorkstationCluster.IPrivateClusterConfig|null|undefined} privateClusterConfig + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @instance + */ + WorkstationCluster.prototype.privateClusterConfig = null; + + /** + * WorkstationCluster degraded. + * @member {boolean} degraded + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @instance + */ + WorkstationCluster.prototype.degraded = false; + + /** + * WorkstationCluster conditions. + * @member {Array.} conditions + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @instance + */ + WorkstationCluster.prototype.conditions = $util.emptyArray; + + /** + * Creates a new WorkstationCluster instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @static + * @param {google.cloud.workstations.v1.IWorkstationCluster=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.WorkstationCluster} WorkstationCluster instance + */ + WorkstationCluster.create = function create(properties) { + return new WorkstationCluster(properties); + }; + + /** + * Encodes the specified WorkstationCluster message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationCluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @static + * @param {google.cloud.workstations.v1.IWorkstationCluster} message WorkstationCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkstationCluster.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.reconciling); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.network); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.subnetwork); + if (message.privateClusterConfig != null && Object.hasOwnProperty.call(message, "privateClusterConfig")) + $root.google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig.encode(message.privateClusterConfig, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.degraded != null && Object.hasOwnProperty.call(message, "degraded")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.degraded); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.rpc.Status.encode(message.conditions[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified WorkstationCluster message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationCluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @static + * @param {google.cloud.workstations.v1.IWorkstationCluster} message WorkstationCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkstationCluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkstationCluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.WorkstationCluster} WorkstationCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkstationCluster.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.WorkstationCluster(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.reconciling = reader.bool(); + break; + } + case 5: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 15: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.etag = reader.string(); + break; + } + case 10: { + message.network = reader.string(); + break; + } + case 11: { + message.subnetwork = reader.string(); + break; + } + case 12: { + message.privateClusterConfig = $root.google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig.decode(reader, reader.uint32()); + break; + } + case 13: { + message.degraded = reader.bool(); + break; + } + case 14: { + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkstationCluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.WorkstationCluster} WorkstationCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkstationCluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkstationCluster message. + * @function verify + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkstationCluster.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.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.privateClusterConfig != null && message.hasOwnProperty("privateClusterConfig")) { + var error = $root.google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig.verify(message.privateClusterConfig); + if (error) + return "privateClusterConfig." + error; + } + if (message.degraded != null && message.hasOwnProperty("degraded")) + if (typeof message.degraded !== "boolean") + return "degraded: boolean expected"; + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.rpc.Status.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + return null; + }; + + /** + * Creates a WorkstationCluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.WorkstationCluster} WorkstationCluster + */ + WorkstationCluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.WorkstationCluster) + return object; + var message = new $root.google.cloud.workstations.v1.WorkstationCluster(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationCluster.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationCluster.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationCluster.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationCluster.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationCluster.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.network != null) + message.network = String(object.network); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.privateClusterConfig != null) { + if (typeof object.privateClusterConfig !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationCluster.privateClusterConfig: object expected"); + message.privateClusterConfig = $root.google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig.fromObject(object.privateClusterConfig); + } + if (object.degraded != null) + message.degraded = Boolean(object.degraded); + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.cloud.workstations.v1.WorkstationCluster.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationCluster.conditions: object expected"); + message.conditions[i] = $root.google.rpc.Status.fromObject(object.conditions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WorkstationCluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @static + * @param {google.cloud.workstations.v1.WorkstationCluster} message WorkstationCluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkstationCluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conditions = []; + if (options.objects || options.defaults) { + object.annotations = {}; + object.labels = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.reconciling = false; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.etag = ""; + object.network = ""; + object.subnetwork = ""; + object.privateClusterConfig = null; + object.degraded = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + 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.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) + object.subnetwork = message.subnetwork; + if (message.privateClusterConfig != null && message.hasOwnProperty("privateClusterConfig")) + object.privateClusterConfig = $root.google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig.toObject(message.privateClusterConfig, options); + if (message.degraded != null && message.hasOwnProperty("degraded")) + object.degraded = message.degraded; + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.rpc.Status.toObject(message.conditions[j], options); + } + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this WorkstationCluster to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @instance + * @returns {Object.} JSON object + */ + WorkstationCluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkstationCluster + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkstationCluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.WorkstationCluster"; + }; + + WorkstationCluster.PrivateClusterConfig = (function() { + + /** + * Properties of a PrivateClusterConfig. + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @interface IPrivateClusterConfig + * @property {boolean|null} [enablePrivateEndpoint] PrivateClusterConfig enablePrivateEndpoint + * @property {string|null} [clusterHostname] PrivateClusterConfig clusterHostname + * @property {string|null} [serviceAttachmentUri] PrivateClusterConfig serviceAttachmentUri + * @property {Array.|null} [allowedProjects] PrivateClusterConfig allowedProjects + */ + + /** + * Constructs a new PrivateClusterConfig. + * @memberof google.cloud.workstations.v1.WorkstationCluster + * @classdesc Represents a PrivateClusterConfig. + * @implements IPrivateClusterConfig + * @constructor + * @param {google.cloud.workstations.v1.WorkstationCluster.IPrivateClusterConfig=} [properties] Properties to set + */ + function PrivateClusterConfig(properties) { + this.allowedProjects = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrivateClusterConfig enablePrivateEndpoint. + * @member {boolean} enablePrivateEndpoint + * @memberof google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig + * @instance + */ + PrivateClusterConfig.prototype.enablePrivateEndpoint = false; + + /** + * PrivateClusterConfig clusterHostname. + * @member {string} clusterHostname + * @memberof google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig + * @instance + */ + PrivateClusterConfig.prototype.clusterHostname = ""; + + /** + * PrivateClusterConfig serviceAttachmentUri. + * @member {string} serviceAttachmentUri + * @memberof google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig + * @instance + */ + PrivateClusterConfig.prototype.serviceAttachmentUri = ""; + + /** + * PrivateClusterConfig allowedProjects. + * @member {Array.} allowedProjects + * @memberof google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig + * @instance + */ + PrivateClusterConfig.prototype.allowedProjects = $util.emptyArray; + + /** + * Creates a new PrivateClusterConfig instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig + * @static + * @param {google.cloud.workstations.v1.WorkstationCluster.IPrivateClusterConfig=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig} PrivateClusterConfig instance + */ + PrivateClusterConfig.create = function create(properties) { + return new PrivateClusterConfig(properties); + }; + + /** + * Encodes the specified PrivateClusterConfig message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig + * @static + * @param {google.cloud.workstations.v1.WorkstationCluster.IPrivateClusterConfig} message PrivateClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateClusterConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enablePrivateEndpoint != null && Object.hasOwnProperty.call(message, "enablePrivateEndpoint")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enablePrivateEndpoint); + if (message.clusterHostname != null && Object.hasOwnProperty.call(message, "clusterHostname")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterHostname); + if (message.serviceAttachmentUri != null && Object.hasOwnProperty.call(message, "serviceAttachmentUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.serviceAttachmentUri); + if (message.allowedProjects != null && message.allowedProjects.length) + for (var i = 0; i < message.allowedProjects.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.allowedProjects[i]); + return writer; + }; + + /** + * Encodes the specified PrivateClusterConfig message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig + * @static + * @param {google.cloud.workstations.v1.WorkstationCluster.IPrivateClusterConfig} message PrivateClusterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateClusterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrivateClusterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig} PrivateClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateClusterConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enablePrivateEndpoint = reader.bool(); + break; + } + case 2: { + message.clusterHostname = reader.string(); + break; + } + case 3: { + message.serviceAttachmentUri = reader.string(); + break; + } + case 4: { + if (!(message.allowedProjects && message.allowedProjects.length)) + message.allowedProjects = []; + message.allowedProjects.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrivateClusterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig} PrivateClusterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateClusterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrivateClusterConfig message. + * @function verify + * @memberof google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrivateClusterConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enablePrivateEndpoint != null && message.hasOwnProperty("enablePrivateEndpoint")) + if (typeof message.enablePrivateEndpoint !== "boolean") + return "enablePrivateEndpoint: boolean expected"; + if (message.clusterHostname != null && message.hasOwnProperty("clusterHostname")) + if (!$util.isString(message.clusterHostname)) + return "clusterHostname: string expected"; + if (message.serviceAttachmentUri != null && message.hasOwnProperty("serviceAttachmentUri")) + if (!$util.isString(message.serviceAttachmentUri)) + return "serviceAttachmentUri: string expected"; + if (message.allowedProjects != null && message.hasOwnProperty("allowedProjects")) { + if (!Array.isArray(message.allowedProjects)) + return "allowedProjects: array expected"; + for (var i = 0; i < message.allowedProjects.length; ++i) + if (!$util.isString(message.allowedProjects[i])) + return "allowedProjects: string[] expected"; + } + return null; + }; + + /** + * Creates a PrivateClusterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig} PrivateClusterConfig + */ + PrivateClusterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig) + return object; + var message = new $root.google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig(); + if (object.enablePrivateEndpoint != null) + message.enablePrivateEndpoint = Boolean(object.enablePrivateEndpoint); + if (object.clusterHostname != null) + message.clusterHostname = String(object.clusterHostname); + if (object.serviceAttachmentUri != null) + message.serviceAttachmentUri = String(object.serviceAttachmentUri); + if (object.allowedProjects) { + if (!Array.isArray(object.allowedProjects)) + throw TypeError(".google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig.allowedProjects: array expected"); + message.allowedProjects = []; + for (var i = 0; i < object.allowedProjects.length; ++i) + message.allowedProjects[i] = String(object.allowedProjects[i]); + } + return message; + }; + + /** + * Creates a plain object from a PrivateClusterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig + * @static + * @param {google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig} message PrivateClusterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivateClusterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedProjects = []; + if (options.defaults) { + object.enablePrivateEndpoint = false; + object.clusterHostname = ""; + object.serviceAttachmentUri = ""; + } + if (message.enablePrivateEndpoint != null && message.hasOwnProperty("enablePrivateEndpoint")) + object.enablePrivateEndpoint = message.enablePrivateEndpoint; + if (message.clusterHostname != null && message.hasOwnProperty("clusterHostname")) + object.clusterHostname = message.clusterHostname; + if (message.serviceAttachmentUri != null && message.hasOwnProperty("serviceAttachmentUri")) + object.serviceAttachmentUri = message.serviceAttachmentUri; + if (message.allowedProjects && message.allowedProjects.length) { + object.allowedProjects = []; + for (var j = 0; j < message.allowedProjects.length; ++j) + object.allowedProjects[j] = message.allowedProjects[j]; + } + return object; + }; + + /** + * Converts this PrivateClusterConfig to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig + * @instance + * @returns {Object.} JSON object + */ + PrivateClusterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrivateClusterConfig + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrivateClusterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig"; + }; + + return PrivateClusterConfig; + })(); + + return WorkstationCluster; + })(); + + v1.WorkstationConfig = (function() { + + /** + * Properties of a WorkstationConfig. + * @memberof google.cloud.workstations.v1 + * @interface IWorkstationConfig + * @property {string|null} [name] WorkstationConfig name + * @property {string|null} [displayName] WorkstationConfig displayName + * @property {string|null} [uid] WorkstationConfig uid + * @property {boolean|null} [reconciling] WorkstationConfig reconciling + * @property {Object.|null} [annotations] WorkstationConfig annotations + * @property {Object.|null} [labels] WorkstationConfig labels + * @property {google.protobuf.ITimestamp|null} [createTime] WorkstationConfig createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] WorkstationConfig updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] WorkstationConfig deleteTime + * @property {string|null} [etag] WorkstationConfig etag + * @property {google.protobuf.IDuration|null} [idleTimeout] WorkstationConfig idleTimeout + * @property {google.protobuf.IDuration|null} [runningTimeout] WorkstationConfig runningTimeout + * @property {google.cloud.workstations.v1.WorkstationConfig.IHost|null} [host] WorkstationConfig host + * @property {Array.|null} [persistentDirectories] WorkstationConfig persistentDirectories + * @property {google.cloud.workstations.v1.WorkstationConfig.IContainer|null} [container] WorkstationConfig container + * @property {google.cloud.workstations.v1.WorkstationConfig.ICustomerEncryptionKey|null} [encryptionKey] WorkstationConfig encryptionKey + * @property {boolean|null} [degraded] WorkstationConfig degraded + * @property {Array.|null} [conditions] WorkstationConfig conditions + */ + + /** + * Constructs a new WorkstationConfig. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a WorkstationConfig. + * @implements IWorkstationConfig + * @constructor + * @param {google.cloud.workstations.v1.IWorkstationConfig=} [properties] Properties to set + */ + function WorkstationConfig(properties) { + this.annotations = {}; + this.labels = {}; + this.persistentDirectories = []; + this.conditions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkstationConfig name. + * @member {string} name + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + */ + WorkstationConfig.prototype.name = ""; + + /** + * WorkstationConfig displayName. + * @member {string} displayName + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + */ + WorkstationConfig.prototype.displayName = ""; + + /** + * WorkstationConfig uid. + * @member {string} uid + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + */ + WorkstationConfig.prototype.uid = ""; + + /** + * WorkstationConfig reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + */ + WorkstationConfig.prototype.reconciling = false; + + /** + * WorkstationConfig annotations. + * @member {Object.} annotations + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + */ + WorkstationConfig.prototype.annotations = $util.emptyObject; + + /** + * WorkstationConfig labels. + * @member {Object.} labels + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + */ + WorkstationConfig.prototype.labels = $util.emptyObject; + + /** + * WorkstationConfig createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + */ + WorkstationConfig.prototype.createTime = null; + + /** + * WorkstationConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + */ + WorkstationConfig.prototype.updateTime = null; + + /** + * WorkstationConfig deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + */ + WorkstationConfig.prototype.deleteTime = null; + + /** + * WorkstationConfig etag. + * @member {string} etag + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + */ + WorkstationConfig.prototype.etag = ""; + + /** + * WorkstationConfig idleTimeout. + * @member {google.protobuf.IDuration|null|undefined} idleTimeout + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + */ + WorkstationConfig.prototype.idleTimeout = null; + + /** + * WorkstationConfig runningTimeout. + * @member {google.protobuf.IDuration|null|undefined} runningTimeout + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + */ + WorkstationConfig.prototype.runningTimeout = null; + + /** + * WorkstationConfig host. + * @member {google.cloud.workstations.v1.WorkstationConfig.IHost|null|undefined} host + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + */ + WorkstationConfig.prototype.host = null; + + /** + * WorkstationConfig persistentDirectories. + * @member {Array.} persistentDirectories + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + */ + WorkstationConfig.prototype.persistentDirectories = $util.emptyArray; + + /** + * WorkstationConfig container. + * @member {google.cloud.workstations.v1.WorkstationConfig.IContainer|null|undefined} container + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + */ + WorkstationConfig.prototype.container = null; + + /** + * WorkstationConfig encryptionKey. + * @member {google.cloud.workstations.v1.WorkstationConfig.ICustomerEncryptionKey|null|undefined} encryptionKey + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + */ + WorkstationConfig.prototype.encryptionKey = null; + + /** + * WorkstationConfig degraded. + * @member {boolean} degraded + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + */ + WorkstationConfig.prototype.degraded = false; + + /** + * WorkstationConfig conditions. + * @member {Array.} conditions + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + */ + WorkstationConfig.prototype.conditions = $util.emptyArray; + + /** + * Creates a new WorkstationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @static + * @param {google.cloud.workstations.v1.IWorkstationConfig=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.WorkstationConfig} WorkstationConfig instance + */ + WorkstationConfig.create = function create(properties) { + return new WorkstationConfig(properties); + }; + + /** + * Encodes the specified WorkstationConfig message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @static + * @param {google.cloud.workstations.v1.IWorkstationConfig} message WorkstationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkstationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.reconciling); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + if (message.idleTimeout != null && Object.hasOwnProperty.call(message, "idleTimeout")) + $root.google.protobuf.Duration.encode(message.idleTimeout, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.runningTimeout != null && Object.hasOwnProperty.call(message, "runningTimeout")) + $root.google.protobuf.Duration.encode(message.runningTimeout, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + $root.google.cloud.workstations.v1.WorkstationConfig.Host.encode(message.host, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.persistentDirectories != null && message.persistentDirectories.length) + for (var i = 0; i < message.persistentDirectories.length; ++i) + $root.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.encode(message.persistentDirectories[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.container != null && Object.hasOwnProperty.call(message, "container")) + $root.google.cloud.workstations.v1.WorkstationConfig.Container.encode(message.container, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.degraded != null && Object.hasOwnProperty.call(message, "degraded")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.degraded); + if (message.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.rpc.Status.encode(message.conditions[i], writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.encryptionKey != null && Object.hasOwnProperty.call(message, "encryptionKey")) + $root.google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey.encode(message.encryptionKey, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 18, wireType 2 =*/146).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified WorkstationConfig message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @static + * @param {google.cloud.workstations.v1.IWorkstationConfig} message WorkstationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkstationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkstationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.WorkstationConfig} WorkstationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkstationConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.WorkstationConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.reconciling = reader.bool(); + break; + } + case 5: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 18: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.etag = reader.string(); + break; + } + case 10: { + message.idleTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 11: { + message.runningTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 12: { + message.host = $root.google.cloud.workstations.v1.WorkstationConfig.Host.decode(reader, reader.uint32()); + break; + } + case 13: { + if (!(message.persistentDirectories && message.persistentDirectories.length)) + message.persistentDirectories = []; + message.persistentDirectories.push($root.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.decode(reader, reader.uint32())); + break; + } + case 14: { + message.container = $root.google.cloud.workstations.v1.WorkstationConfig.Container.decode(reader, reader.uint32()); + break; + } + case 17: { + message.encryptionKey = $root.google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + } + case 15: { + message.degraded = reader.bool(); + break; + } + case 16: { + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.rpc.Status.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkstationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.WorkstationConfig} WorkstationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkstationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkstationConfig message. + * @function verify + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkstationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.idleTimeout != null && message.hasOwnProperty("idleTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.idleTimeout); + if (error) + return "idleTimeout." + error; + } + if (message.runningTimeout != null && message.hasOwnProperty("runningTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.runningTimeout); + if (error) + return "runningTimeout." + error; + } + if (message.host != null && message.hasOwnProperty("host")) { + var error = $root.google.cloud.workstations.v1.WorkstationConfig.Host.verify(message.host); + if (error) + return "host." + error; + } + if (message.persistentDirectories != null && message.hasOwnProperty("persistentDirectories")) { + if (!Array.isArray(message.persistentDirectories)) + return "persistentDirectories: array expected"; + for (var i = 0; i < message.persistentDirectories.length; ++i) { + var error = $root.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.verify(message.persistentDirectories[i]); + if (error) + return "persistentDirectories." + error; + } + } + if (message.container != null && message.hasOwnProperty("container")) { + var error = $root.google.cloud.workstations.v1.WorkstationConfig.Container.verify(message.container); + if (error) + return "container." + error; + } + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) { + var error = $root.google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey.verify(message.encryptionKey); + if (error) + return "encryptionKey." + error; + } + if (message.degraded != null && message.hasOwnProperty("degraded")) + if (typeof message.degraded !== "boolean") + return "degraded: boolean expected"; + if (message.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.rpc.Status.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + return null; + }; + + /** + * Creates a WorkstationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.WorkstationConfig} WorkstationConfig + */ + WorkstationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.WorkstationConfig) + return object; + var message = new $root.google.cloud.workstations.v1.WorkstationConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.idleTimeout != null) { + if (typeof object.idleTimeout !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.idleTimeout: object expected"); + message.idleTimeout = $root.google.protobuf.Duration.fromObject(object.idleTimeout); + } + if (object.runningTimeout != null) { + if (typeof object.runningTimeout !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.runningTimeout: object expected"); + message.runningTimeout = $root.google.protobuf.Duration.fromObject(object.runningTimeout); + } + if (object.host != null) { + if (typeof object.host !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.host: object expected"); + message.host = $root.google.cloud.workstations.v1.WorkstationConfig.Host.fromObject(object.host); + } + if (object.persistentDirectories) { + if (!Array.isArray(object.persistentDirectories)) + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.persistentDirectories: array expected"); + message.persistentDirectories = []; + for (var i = 0; i < object.persistentDirectories.length; ++i) { + if (typeof object.persistentDirectories[i] !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.persistentDirectories: object expected"); + message.persistentDirectories[i] = $root.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.fromObject(object.persistentDirectories[i]); + } + } + if (object.container != null) { + if (typeof object.container !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.container: object expected"); + message.container = $root.google.cloud.workstations.v1.WorkstationConfig.Container.fromObject(object.container); + } + if (object.encryptionKey != null) { + if (typeof object.encryptionKey !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.encryptionKey: object expected"); + message.encryptionKey = $root.google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey.fromObject(object.encryptionKey); + } + if (object.degraded != null) + message.degraded = Boolean(object.degraded); + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.conditions: object expected"); + message.conditions[i] = $root.google.rpc.Status.fromObject(object.conditions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WorkstationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig} message WorkstationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkstationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.persistentDirectories = []; + object.conditions = []; + } + if (options.objects || options.defaults) { + object.annotations = {}; + object.labels = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.reconciling = false; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.etag = ""; + object.idleTimeout = null; + object.runningTimeout = null; + object.host = null; + object.container = null; + object.degraded = false; + object.encryptionKey = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + 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.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.idleTimeout != null && message.hasOwnProperty("idleTimeout")) + object.idleTimeout = $root.google.protobuf.Duration.toObject(message.idleTimeout, options); + if (message.runningTimeout != null && message.hasOwnProperty("runningTimeout")) + object.runningTimeout = $root.google.protobuf.Duration.toObject(message.runningTimeout, options); + if (message.host != null && message.hasOwnProperty("host")) + object.host = $root.google.cloud.workstations.v1.WorkstationConfig.Host.toObject(message.host, options); + if (message.persistentDirectories && message.persistentDirectories.length) { + object.persistentDirectories = []; + for (var j = 0; j < message.persistentDirectories.length; ++j) + object.persistentDirectories[j] = $root.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.toObject(message.persistentDirectories[j], options); + } + if (message.container != null && message.hasOwnProperty("container")) + object.container = $root.google.cloud.workstations.v1.WorkstationConfig.Container.toObject(message.container, options); + if (message.degraded != null && message.hasOwnProperty("degraded")) + object.degraded = message.degraded; + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.rpc.Status.toObject(message.conditions[j], options); + } + if (message.encryptionKey != null && message.hasOwnProperty("encryptionKey")) + object.encryptionKey = $root.google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey.toObject(message.encryptionKey, options); + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this WorkstationConfig to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @instance + * @returns {Object.} JSON object + */ + WorkstationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkstationConfig + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkstationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.WorkstationConfig"; + }; + + WorkstationConfig.Host = (function() { + + /** + * Properties of a Host. + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @interface IHost + * @property {google.cloud.workstations.v1.WorkstationConfig.Host.IGceInstance|null} [gceInstance] Host gceInstance + */ + + /** + * Constructs a new Host. + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @classdesc Represents a Host. + * @implements IHost + * @constructor + * @param {google.cloud.workstations.v1.WorkstationConfig.IHost=} [properties] Properties to set + */ + function Host(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Host gceInstance. + * @member {google.cloud.workstations.v1.WorkstationConfig.Host.IGceInstance|null|undefined} gceInstance + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host + * @instance + */ + Host.prototype.gceInstance = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Host config. + * @member {"gceInstance"|undefined} config + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host + * @instance + */ + Object.defineProperty(Host.prototype, "config", { + get: $util.oneOfGetter($oneOfFields = ["gceInstance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Host instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.IHost=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.WorkstationConfig.Host} Host instance + */ + Host.create = function create(properties) { + return new Host(properties); + }; + + /** + * Encodes the specified Host message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Host.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.IHost} message Host message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Host.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gceInstance != null && Object.hasOwnProperty.call(message, "gceInstance")) + $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.encode(message.gceInstance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Host message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Host.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.IHost} message Host message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Host.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Host message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.WorkstationConfig.Host} Host + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Host.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.WorkstationConfig.Host(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gceInstance = $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Host message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.WorkstationConfig.Host} Host + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Host.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Host message. + * @function verify + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Host.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gceInstance != null && message.hasOwnProperty("gceInstance")) { + properties.config = 1; + { + var error = $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.verify(message.gceInstance); + if (error) + return "gceInstance." + error; + } + } + return null; + }; + + /** + * Creates a Host message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.WorkstationConfig.Host} Host + */ + Host.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.WorkstationConfig.Host) + return object; + var message = new $root.google.cloud.workstations.v1.WorkstationConfig.Host(); + if (object.gceInstance != null) { + if (typeof object.gceInstance !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.Host.gceInstance: object expected"); + message.gceInstance = $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.fromObject(object.gceInstance); + } + return message; + }; + + /** + * Creates a plain object from a Host message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.Host} message Host + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Host.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gceInstance != null && message.hasOwnProperty("gceInstance")) { + object.gceInstance = $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.toObject(message.gceInstance, options); + if (options.oneofs) + object.config = "gceInstance"; + } + return object; + }; + + /** + * Converts this Host to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host + * @instance + * @returns {Object.} JSON object + */ + Host.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Host + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Host.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.WorkstationConfig.Host"; + }; + + Host.GceInstance = (function() { + + /** + * Properties of a GceInstance. + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host + * @interface IGceInstance + * @property {string|null} [machineType] GceInstance machineType + * @property {string|null} [serviceAccount] GceInstance serviceAccount + * @property {Array.|null} [tags] GceInstance tags + * @property {number|null} [poolSize] GceInstance poolSize + * @property {boolean|null} [disablePublicIpAddresses] GceInstance disablePublicIpAddresses + * @property {boolean|null} [enableNestedVirtualization] GceInstance enableNestedVirtualization + * @property {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceShieldedInstanceConfig|null} [shieldedInstanceConfig] GceInstance shieldedInstanceConfig + * @property {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceConfidentialInstanceConfig|null} [confidentialInstanceConfig] GceInstance confidentialInstanceConfig + * @property {number|null} [bootDiskSizeGb] GceInstance bootDiskSizeGb + */ + + /** + * Constructs a new GceInstance. + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host + * @classdesc Represents a GceInstance. + * @implements IGceInstance + * @constructor + * @param {google.cloud.workstations.v1.WorkstationConfig.Host.IGceInstance=} [properties] Properties to set + */ + function GceInstance(properties) { + this.tags = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GceInstance machineType. + * @member {string} machineType + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @instance + */ + GceInstance.prototype.machineType = ""; + + /** + * GceInstance serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @instance + */ + GceInstance.prototype.serviceAccount = ""; + + /** + * GceInstance tags. + * @member {Array.} tags + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @instance + */ + GceInstance.prototype.tags = $util.emptyArray; + + /** + * GceInstance poolSize. + * @member {number} poolSize + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @instance + */ + GceInstance.prototype.poolSize = 0; + + /** + * GceInstance disablePublicIpAddresses. + * @member {boolean} disablePublicIpAddresses + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @instance + */ + GceInstance.prototype.disablePublicIpAddresses = false; + + /** + * GceInstance enableNestedVirtualization. + * @member {boolean} enableNestedVirtualization + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @instance + */ + GceInstance.prototype.enableNestedVirtualization = false; + + /** + * GceInstance shieldedInstanceConfig. + * @member {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceShieldedInstanceConfig|null|undefined} shieldedInstanceConfig + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @instance + */ + GceInstance.prototype.shieldedInstanceConfig = null; + + /** + * GceInstance confidentialInstanceConfig. + * @member {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceConfidentialInstanceConfig|null|undefined} confidentialInstanceConfig + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @instance + */ + GceInstance.prototype.confidentialInstanceConfig = null; + + /** + * GceInstance bootDiskSizeGb. + * @member {number} bootDiskSizeGb + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @instance + */ + GceInstance.prototype.bootDiskSizeGb = 0; + + /** + * Creates a new GceInstance instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.Host.IGceInstance=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance} GceInstance instance + */ + GceInstance.create = function create(properties) { + return new GceInstance(properties); + }; + + /** + * Encodes the specified GceInstance message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.Host.IGceInstance} message GceInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GceInstance.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.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.serviceAccount); + if (message.tags != null && message.tags.length) + for (var i = 0; i < message.tags.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tags[i]); + if (message.poolSize != null && Object.hasOwnProperty.call(message, "poolSize")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.poolSize); + if (message.disablePublicIpAddresses != null && Object.hasOwnProperty.call(message, "disablePublicIpAddresses")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.disablePublicIpAddresses); + if (message.enableNestedVirtualization != null && Object.hasOwnProperty.call(message, "enableNestedVirtualization")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.enableNestedVirtualization); + if (message.shieldedInstanceConfig != null && Object.hasOwnProperty.call(message, "shieldedInstanceConfig")) + $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig.encode(message.shieldedInstanceConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.bootDiskSizeGb != null && Object.hasOwnProperty.call(message, "bootDiskSizeGb")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.bootDiskSizeGb); + if (message.confidentialInstanceConfig != null && Object.hasOwnProperty.call(message, "confidentialInstanceConfig")) + $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig.encode(message.confidentialInstanceConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GceInstance message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.Host.IGceInstance} message GceInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GceInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GceInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance} GceInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GceInstance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.machineType = reader.string(); + break; + } + case 2: { + message.serviceAccount = reader.string(); + break; + } + case 4: { + if (!(message.tags && message.tags.length)) + message.tags = []; + message.tags.push(reader.string()); + break; + } + case 5: { + message.poolSize = reader.int32(); + break; + } + case 6: { + message.disablePublicIpAddresses = reader.bool(); + break; + } + case 7: { + message.enableNestedVirtualization = reader.bool(); + break; + } + case 8: { + message.shieldedInstanceConfig = $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.confidentialInstanceConfig = $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 9: { + message.bootDiskSizeGb = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GceInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance} GceInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GceInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GceInstance message. + * @function verify + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GceInstance.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.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.tags != null && message.hasOwnProperty("tags")) { + if (!Array.isArray(message.tags)) + return "tags: array expected"; + for (var i = 0; i < message.tags.length; ++i) + if (!$util.isString(message.tags[i])) + return "tags: string[] expected"; + } + if (message.poolSize != null && message.hasOwnProperty("poolSize")) + if (!$util.isInteger(message.poolSize)) + return "poolSize: integer expected"; + if (message.disablePublicIpAddresses != null && message.hasOwnProperty("disablePublicIpAddresses")) + if (typeof message.disablePublicIpAddresses !== "boolean") + return "disablePublicIpAddresses: boolean expected"; + if (message.enableNestedVirtualization != null && message.hasOwnProperty("enableNestedVirtualization")) + if (typeof message.enableNestedVirtualization !== "boolean") + return "enableNestedVirtualization: boolean expected"; + if (message.shieldedInstanceConfig != null && message.hasOwnProperty("shieldedInstanceConfig")) { + var error = $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig.verify(message.shieldedInstanceConfig); + if (error) + return "shieldedInstanceConfig." + error; + } + if (message.confidentialInstanceConfig != null && message.hasOwnProperty("confidentialInstanceConfig")) { + var error = $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig.verify(message.confidentialInstanceConfig); + if (error) + return "confidentialInstanceConfig." + error; + } + if (message.bootDiskSizeGb != null && message.hasOwnProperty("bootDiskSizeGb")) + if (!$util.isInteger(message.bootDiskSizeGb)) + return "bootDiskSizeGb: integer expected"; + return null; + }; + + /** + * Creates a GceInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance} GceInstance + */ + GceInstance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance) + return object; + var message = new $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance(); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.tags) { + if (!Array.isArray(object.tags)) + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.tags: array expected"); + message.tags = []; + for (var i = 0; i < object.tags.length; ++i) + message.tags[i] = String(object.tags[i]); + } + if (object.poolSize != null) + message.poolSize = object.poolSize | 0; + if (object.disablePublicIpAddresses != null) + message.disablePublicIpAddresses = Boolean(object.disablePublicIpAddresses); + if (object.enableNestedVirtualization != null) + message.enableNestedVirtualization = Boolean(object.enableNestedVirtualization); + if (object.shieldedInstanceConfig != null) { + if (typeof object.shieldedInstanceConfig !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.shieldedInstanceConfig: object expected"); + message.shieldedInstanceConfig = $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig.fromObject(object.shieldedInstanceConfig); + } + if (object.confidentialInstanceConfig != null) { + if (typeof object.confidentialInstanceConfig !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.confidentialInstanceConfig: object expected"); + message.confidentialInstanceConfig = $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig.fromObject(object.confidentialInstanceConfig); + } + if (object.bootDiskSizeGb != null) + message.bootDiskSizeGb = object.bootDiskSizeGb | 0; + return message; + }; + + /** + * Creates a plain object from a GceInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance} message GceInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GceInstance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tags = []; + if (options.defaults) { + object.machineType = ""; + object.serviceAccount = ""; + object.poolSize = 0; + object.disablePublicIpAddresses = false; + object.enableNestedVirtualization = false; + object.shieldedInstanceConfig = null; + object.bootDiskSizeGb = 0; + object.confidentialInstanceConfig = null; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.tags && message.tags.length) { + object.tags = []; + for (var j = 0; j < message.tags.length; ++j) + object.tags[j] = message.tags[j]; + } + if (message.poolSize != null && message.hasOwnProperty("poolSize")) + object.poolSize = message.poolSize; + if (message.disablePublicIpAddresses != null && message.hasOwnProperty("disablePublicIpAddresses")) + object.disablePublicIpAddresses = message.disablePublicIpAddresses; + if (message.enableNestedVirtualization != null && message.hasOwnProperty("enableNestedVirtualization")) + object.enableNestedVirtualization = message.enableNestedVirtualization; + if (message.shieldedInstanceConfig != null && message.hasOwnProperty("shieldedInstanceConfig")) + object.shieldedInstanceConfig = $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig.toObject(message.shieldedInstanceConfig, options); + if (message.bootDiskSizeGb != null && message.hasOwnProperty("bootDiskSizeGb")) + object.bootDiskSizeGb = message.bootDiskSizeGb; + if (message.confidentialInstanceConfig != null && message.hasOwnProperty("confidentialInstanceConfig")) + object.confidentialInstanceConfig = $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig.toObject(message.confidentialInstanceConfig, options); + return object; + }; + + /** + * Converts this GceInstance to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @instance + * @returns {Object.} JSON object + */ + GceInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GceInstance + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GceInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance"; + }; + + GceInstance.GceShieldedInstanceConfig = (function() { + + /** + * Properties of a GceShieldedInstanceConfig. + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @interface IGceShieldedInstanceConfig + * @property {boolean|null} [enableSecureBoot] GceShieldedInstanceConfig enableSecureBoot + * @property {boolean|null} [enableVtpm] GceShieldedInstanceConfig enableVtpm + * @property {boolean|null} [enableIntegrityMonitoring] GceShieldedInstanceConfig enableIntegrityMonitoring + */ + + /** + * Constructs a new GceShieldedInstanceConfig. + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @classdesc Represents a GceShieldedInstanceConfig. + * @implements IGceShieldedInstanceConfig + * @constructor + * @param {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceShieldedInstanceConfig=} [properties] Properties to set + */ + function GceShieldedInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GceShieldedInstanceConfig enableSecureBoot. + * @member {boolean} enableSecureBoot + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig + * @instance + */ + GceShieldedInstanceConfig.prototype.enableSecureBoot = false; + + /** + * GceShieldedInstanceConfig enableVtpm. + * @member {boolean} enableVtpm + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig + * @instance + */ + GceShieldedInstanceConfig.prototype.enableVtpm = false; + + /** + * GceShieldedInstanceConfig enableIntegrityMonitoring. + * @member {boolean} enableIntegrityMonitoring + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig + * @instance + */ + GceShieldedInstanceConfig.prototype.enableIntegrityMonitoring = false; + + /** + * Creates a new GceShieldedInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceShieldedInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig} GceShieldedInstanceConfig instance + */ + GceShieldedInstanceConfig.create = function create(properties) { + return new GceShieldedInstanceConfig(properties); + }; + + /** + * Encodes the specified GceShieldedInstanceConfig message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceShieldedInstanceConfig} message GceShieldedInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GceShieldedInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableSecureBoot != null && Object.hasOwnProperty.call(message, "enableSecureBoot")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableSecureBoot); + if (message.enableVtpm != null && Object.hasOwnProperty.call(message, "enableVtpm")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableVtpm); + if (message.enableIntegrityMonitoring != null && Object.hasOwnProperty.call(message, "enableIntegrityMonitoring")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableIntegrityMonitoring); + return writer; + }; + + /** + * Encodes the specified GceShieldedInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceShieldedInstanceConfig} message GceShieldedInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GceShieldedInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GceShieldedInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig} GceShieldedInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GceShieldedInstanceConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableSecureBoot = reader.bool(); + break; + } + case 2: { + message.enableVtpm = reader.bool(); + break; + } + case 3: { + message.enableIntegrityMonitoring = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GceShieldedInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig} GceShieldedInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GceShieldedInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GceShieldedInstanceConfig message. + * @function verify + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GceShieldedInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableSecureBoot != null && message.hasOwnProperty("enableSecureBoot")) + if (typeof message.enableSecureBoot !== "boolean") + return "enableSecureBoot: boolean expected"; + if (message.enableVtpm != null && message.hasOwnProperty("enableVtpm")) + if (typeof message.enableVtpm !== "boolean") + return "enableVtpm: boolean expected"; + if (message.enableIntegrityMonitoring != null && message.hasOwnProperty("enableIntegrityMonitoring")) + if (typeof message.enableIntegrityMonitoring !== "boolean") + return "enableIntegrityMonitoring: boolean expected"; + return null; + }; + + /** + * Creates a GceShieldedInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig} GceShieldedInstanceConfig + */ + GceShieldedInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig) + return object; + var message = new $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig(); + if (object.enableSecureBoot != null) + message.enableSecureBoot = Boolean(object.enableSecureBoot); + if (object.enableVtpm != null) + message.enableVtpm = Boolean(object.enableVtpm); + if (object.enableIntegrityMonitoring != null) + message.enableIntegrityMonitoring = Boolean(object.enableIntegrityMonitoring); + return message; + }; + + /** + * Creates a plain object from a GceShieldedInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig} message GceShieldedInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GceShieldedInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableSecureBoot = false; + object.enableVtpm = false; + object.enableIntegrityMonitoring = false; + } + if (message.enableSecureBoot != null && message.hasOwnProperty("enableSecureBoot")) + object.enableSecureBoot = message.enableSecureBoot; + if (message.enableVtpm != null && message.hasOwnProperty("enableVtpm")) + object.enableVtpm = message.enableVtpm; + if (message.enableIntegrityMonitoring != null && message.hasOwnProperty("enableIntegrityMonitoring")) + object.enableIntegrityMonitoring = message.enableIntegrityMonitoring; + return object; + }; + + /** + * Converts this GceShieldedInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + GceShieldedInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GceShieldedInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GceShieldedInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig"; + }; + + return GceShieldedInstanceConfig; + })(); + + GceInstance.GceConfidentialInstanceConfig = (function() { + + /** + * Properties of a GceConfidentialInstanceConfig. + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @interface IGceConfidentialInstanceConfig + * @property {boolean|null} [enableConfidentialCompute] GceConfidentialInstanceConfig enableConfidentialCompute + */ + + /** + * Constructs a new GceConfidentialInstanceConfig. + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance + * @classdesc Represents a GceConfidentialInstanceConfig. + * @implements IGceConfidentialInstanceConfig + * @constructor + * @param {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceConfidentialInstanceConfig=} [properties] Properties to set + */ + function GceConfidentialInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GceConfidentialInstanceConfig enableConfidentialCompute. + * @member {boolean} enableConfidentialCompute + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig + * @instance + */ + GceConfidentialInstanceConfig.prototype.enableConfidentialCompute = false; + + /** + * Creates a new GceConfidentialInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceConfidentialInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig} GceConfidentialInstanceConfig instance + */ + GceConfidentialInstanceConfig.create = function create(properties) { + return new GceConfidentialInstanceConfig(properties); + }; + + /** + * Encodes the specified GceConfidentialInstanceConfig message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceConfidentialInstanceConfig} message GceConfidentialInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GceConfidentialInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableConfidentialCompute != null && Object.hasOwnProperty.call(message, "enableConfidentialCompute")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableConfidentialCompute); + return writer; + }; + + /** + * Encodes the specified GceConfidentialInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.IGceConfidentialInstanceConfig} message GceConfidentialInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GceConfidentialInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GceConfidentialInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig} GceConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GceConfidentialInstanceConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableConfidentialCompute = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GceConfidentialInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig} GceConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GceConfidentialInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GceConfidentialInstanceConfig message. + * @function verify + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GceConfidentialInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) + if (typeof message.enableConfidentialCompute !== "boolean") + return "enableConfidentialCompute: boolean expected"; + return null; + }; + + /** + * Creates a GceConfidentialInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig} GceConfidentialInstanceConfig + */ + GceConfidentialInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig) + return object; + var message = new $root.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig(); + if (object.enableConfidentialCompute != null) + message.enableConfidentialCompute = Boolean(object.enableConfidentialCompute); + return message; + }; + + /** + * Creates a plain object from a GceConfidentialInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig} message GceConfidentialInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GceConfidentialInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableConfidentialCompute = false; + if (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) + object.enableConfidentialCompute = message.enableConfidentialCompute; + return object; + }; + + /** + * Converts this GceConfidentialInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + GceConfidentialInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GceConfidentialInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GceConfidentialInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig"; + }; + + return GceConfidentialInstanceConfig; + })(); + + return GceInstance; + })(); + + return Host; + })(); + + WorkstationConfig.PersistentDirectory = (function() { + + /** + * Properties of a PersistentDirectory. + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @interface IPersistentDirectory + * @property {google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.IGceRegionalPersistentDisk|null} [gcePd] PersistentDirectory gcePd + * @property {string|null} [mountPath] PersistentDirectory mountPath + */ + + /** + * Constructs a new PersistentDirectory. + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @classdesc Represents a PersistentDirectory. + * @implements IPersistentDirectory + * @constructor + * @param {google.cloud.workstations.v1.WorkstationConfig.IPersistentDirectory=} [properties] Properties to set + */ + function PersistentDirectory(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PersistentDirectory gcePd. + * @member {google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.IGceRegionalPersistentDisk|null|undefined} gcePd + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory + * @instance + */ + PersistentDirectory.prototype.gcePd = null; + + /** + * PersistentDirectory mountPath. + * @member {string} mountPath + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory + * @instance + */ + PersistentDirectory.prototype.mountPath = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PersistentDirectory directoryType. + * @member {"gcePd"|undefined} directoryType + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory + * @instance + */ + Object.defineProperty(PersistentDirectory.prototype, "directoryType", { + get: $util.oneOfGetter($oneOfFields = ["gcePd"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PersistentDirectory instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.IPersistentDirectory=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory} PersistentDirectory instance + */ + PersistentDirectory.create = function create(properties) { + return new PersistentDirectory(properties); + }; + + /** + * Encodes the specified PersistentDirectory message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.IPersistentDirectory} message PersistentDirectory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersistentDirectory.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mountPath != null && Object.hasOwnProperty.call(message, "mountPath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mountPath); + if (message.gcePd != null && Object.hasOwnProperty.call(message, "gcePd")) + $root.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.encode(message.gcePd, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PersistentDirectory message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.IPersistentDirectory} message PersistentDirectory message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PersistentDirectory.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PersistentDirectory message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory} PersistentDirectory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersistentDirectory.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.gcePd = $root.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.decode(reader, reader.uint32()); + break; + } + case 1: { + message.mountPath = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PersistentDirectory message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory} PersistentDirectory + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PersistentDirectory.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PersistentDirectory message. + * @function verify + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PersistentDirectory.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcePd != null && message.hasOwnProperty("gcePd")) { + properties.directoryType = 1; + { + var error = $root.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.verify(message.gcePd); + if (error) + return "gcePd." + error; + } + } + if (message.mountPath != null && message.hasOwnProperty("mountPath")) + if (!$util.isString(message.mountPath)) + return "mountPath: string expected"; + return null; + }; + + /** + * Creates a PersistentDirectory message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory} PersistentDirectory + */ + PersistentDirectory.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory) + return object; + var message = new $root.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory(); + if (object.gcePd != null) { + if (typeof object.gcePd !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.gcePd: object expected"); + message.gcePd = $root.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.fromObject(object.gcePd); + } + if (object.mountPath != null) + message.mountPath = String(object.mountPath); + return message; + }; + + /** + * Creates a plain object from a PersistentDirectory message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory} message PersistentDirectory + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PersistentDirectory.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.mountPath = ""; + if (message.mountPath != null && message.hasOwnProperty("mountPath")) + object.mountPath = message.mountPath; + if (message.gcePd != null && message.hasOwnProperty("gcePd")) { + object.gcePd = $root.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.toObject(message.gcePd, options); + if (options.oneofs) + object.directoryType = "gcePd"; + } + return object; + }; + + /** + * Converts this PersistentDirectory to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory + * @instance + * @returns {Object.} JSON object + */ + PersistentDirectory.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PersistentDirectory + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PersistentDirectory.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory"; + }; + + PersistentDirectory.GceRegionalPersistentDisk = (function() { + + /** + * Properties of a GceRegionalPersistentDisk. + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory + * @interface IGceRegionalPersistentDisk + * @property {number|null} [sizeGb] GceRegionalPersistentDisk sizeGb + * @property {string|null} [fsType] GceRegionalPersistentDisk fsType + * @property {string|null} [diskType] GceRegionalPersistentDisk diskType + * @property {string|null} [sourceSnapshot] GceRegionalPersistentDisk sourceSnapshot + * @property {google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy|null} [reclaimPolicy] GceRegionalPersistentDisk reclaimPolicy + */ + + /** + * Constructs a new GceRegionalPersistentDisk. + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory + * @classdesc Represents a GceRegionalPersistentDisk. + * @implements IGceRegionalPersistentDisk + * @constructor + * @param {google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.IGceRegionalPersistentDisk=} [properties] Properties to set + */ + function GceRegionalPersistentDisk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GceRegionalPersistentDisk sizeGb. + * @member {number} sizeGb + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk + * @instance + */ + GceRegionalPersistentDisk.prototype.sizeGb = 0; + + /** + * GceRegionalPersistentDisk fsType. + * @member {string} fsType + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk + * @instance + */ + GceRegionalPersistentDisk.prototype.fsType = ""; + + /** + * GceRegionalPersistentDisk diskType. + * @member {string} diskType + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk + * @instance + */ + GceRegionalPersistentDisk.prototype.diskType = ""; + + /** + * GceRegionalPersistentDisk sourceSnapshot. + * @member {string} sourceSnapshot + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk + * @instance + */ + GceRegionalPersistentDisk.prototype.sourceSnapshot = ""; + + /** + * GceRegionalPersistentDisk reclaimPolicy. + * @member {google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy} reclaimPolicy + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk + * @instance + */ + GceRegionalPersistentDisk.prototype.reclaimPolicy = 0; + + /** + * Creates a new GceRegionalPersistentDisk instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.IGceRegionalPersistentDisk=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk} GceRegionalPersistentDisk instance + */ + GceRegionalPersistentDisk.create = function create(properties) { + return new GceRegionalPersistentDisk(properties); + }; + + /** + * Encodes the specified GceRegionalPersistentDisk message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.IGceRegionalPersistentDisk} message GceRegionalPersistentDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GceRegionalPersistentDisk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sizeGb); + if (message.fsType != null && Object.hasOwnProperty.call(message, "fsType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fsType); + if (message.diskType != null && Object.hasOwnProperty.call(message, "diskType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.diskType); + if (message.reclaimPolicy != null && Object.hasOwnProperty.call(message, "reclaimPolicy")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.reclaimPolicy); + if (message.sourceSnapshot != null && Object.hasOwnProperty.call(message, "sourceSnapshot")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.sourceSnapshot); + return writer; + }; + + /** + * Encodes the specified GceRegionalPersistentDisk message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.IGceRegionalPersistentDisk} message GceRegionalPersistentDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GceRegionalPersistentDisk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GceRegionalPersistentDisk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk} GceRegionalPersistentDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GceRegionalPersistentDisk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sizeGb = reader.int32(); + break; + } + case 2: { + message.fsType = reader.string(); + break; + } + case 3: { + message.diskType = reader.string(); + break; + } + case 5: { + message.sourceSnapshot = reader.string(); + break; + } + case 4: { + message.reclaimPolicy = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GceRegionalPersistentDisk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk} GceRegionalPersistentDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GceRegionalPersistentDisk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GceRegionalPersistentDisk message. + * @function verify + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GceRegionalPersistentDisk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) + if (!$util.isInteger(message.sizeGb)) + return "sizeGb: integer expected"; + if (message.fsType != null && message.hasOwnProperty("fsType")) + if (!$util.isString(message.fsType)) + return "fsType: string expected"; + if (message.diskType != null && message.hasOwnProperty("diskType")) + if (!$util.isString(message.diskType)) + return "diskType: string expected"; + if (message.sourceSnapshot != null && message.hasOwnProperty("sourceSnapshot")) + if (!$util.isString(message.sourceSnapshot)) + return "sourceSnapshot: string expected"; + if (message.reclaimPolicy != null && message.hasOwnProperty("reclaimPolicy")) + switch (message.reclaimPolicy) { + default: + return "reclaimPolicy: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GceRegionalPersistentDisk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk} GceRegionalPersistentDisk + */ + GceRegionalPersistentDisk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk) + return object; + var message = new $root.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk(); + if (object.sizeGb != null) + message.sizeGb = object.sizeGb | 0; + if (object.fsType != null) + message.fsType = String(object.fsType); + if (object.diskType != null) + message.diskType = String(object.diskType); + if (object.sourceSnapshot != null) + message.sourceSnapshot = String(object.sourceSnapshot); + switch (object.reclaimPolicy) { + default: + if (typeof object.reclaimPolicy === "number") { + message.reclaimPolicy = object.reclaimPolicy; + break; + } + break; + case "RECLAIM_POLICY_UNSPECIFIED": + case 0: + message.reclaimPolicy = 0; + break; + case "DELETE": + case 1: + message.reclaimPolicy = 1; + break; + case "RETAIN": + case 2: + message.reclaimPolicy = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GceRegionalPersistentDisk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk} message GceRegionalPersistentDisk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GceRegionalPersistentDisk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sizeGb = 0; + object.fsType = ""; + object.diskType = ""; + object.reclaimPolicy = options.enums === String ? "RECLAIM_POLICY_UNSPECIFIED" : 0; + object.sourceSnapshot = ""; + } + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) + object.sizeGb = message.sizeGb; + if (message.fsType != null && message.hasOwnProperty("fsType")) + object.fsType = message.fsType; + if (message.diskType != null && message.hasOwnProperty("diskType")) + object.diskType = message.diskType; + if (message.reclaimPolicy != null && message.hasOwnProperty("reclaimPolicy")) + object.reclaimPolicy = options.enums === String ? $root.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy[message.reclaimPolicy] === undefined ? message.reclaimPolicy : $root.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy[message.reclaimPolicy] : message.reclaimPolicy; + if (message.sourceSnapshot != null && message.hasOwnProperty("sourceSnapshot")) + object.sourceSnapshot = message.sourceSnapshot; + return object; + }; + + /** + * Converts this GceRegionalPersistentDisk to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk + * @instance + * @returns {Object.} JSON object + */ + GceRegionalPersistentDisk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GceRegionalPersistentDisk + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GceRegionalPersistentDisk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk"; + }; + + /** + * ReclaimPolicy enum. + * @name google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy + * @enum {number} + * @property {number} RECLAIM_POLICY_UNSPECIFIED=0 RECLAIM_POLICY_UNSPECIFIED value + * @property {number} DELETE=1 DELETE value + * @property {number} RETAIN=2 RETAIN value + */ + GceRegionalPersistentDisk.ReclaimPolicy = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RECLAIM_POLICY_UNSPECIFIED"] = 0; + values[valuesById[1] = "DELETE"] = 1; + values[valuesById[2] = "RETAIN"] = 2; + return values; + })(); + + return GceRegionalPersistentDisk; + })(); + + return PersistentDirectory; + })(); + + WorkstationConfig.Container = (function() { + + /** + * Properties of a Container. + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @interface IContainer + * @property {string|null} [image] Container image + * @property {Array.|null} [command] Container command + * @property {Array.|null} [args] Container args + * @property {Object.|null} [env] Container env + * @property {string|null} [workingDir] Container workingDir + * @property {number|null} [runAsUser] Container runAsUser + */ + + /** + * Constructs a new Container. + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @classdesc Represents a Container. + * @implements IContainer + * @constructor + * @param {google.cloud.workstations.v1.WorkstationConfig.IContainer=} [properties] Properties to set + */ + function Container(properties) { + this.command = []; + this.args = []; + this.env = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Container image. + * @member {string} image + * @memberof google.cloud.workstations.v1.WorkstationConfig.Container + * @instance + */ + Container.prototype.image = ""; + + /** + * Container command. + * @member {Array.} command + * @memberof google.cloud.workstations.v1.WorkstationConfig.Container + * @instance + */ + Container.prototype.command = $util.emptyArray; + + /** + * Container args. + * @member {Array.} args + * @memberof google.cloud.workstations.v1.WorkstationConfig.Container + * @instance + */ + Container.prototype.args = $util.emptyArray; + + /** + * Container env. + * @member {Object.} env + * @memberof google.cloud.workstations.v1.WorkstationConfig.Container + * @instance + */ + Container.prototype.env = $util.emptyObject; + + /** + * Container workingDir. + * @member {string} workingDir + * @memberof google.cloud.workstations.v1.WorkstationConfig.Container + * @instance + */ + Container.prototype.workingDir = ""; + + /** + * Container runAsUser. + * @member {number} runAsUser + * @memberof google.cloud.workstations.v1.WorkstationConfig.Container + * @instance + */ + Container.prototype.runAsUser = 0; + + /** + * Creates a new Container instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.WorkstationConfig.Container + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.IContainer=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.WorkstationConfig.Container} Container instance + */ + Container.create = function create(properties) { + return new Container(properties); + }; + + /** + * Encodes the specified Container message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Container.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.WorkstationConfig.Container + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.IContainer} message Container message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Container.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.image); + if (message.command != null && message.command.length) + for (var i = 0; i < message.command.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.command[i]); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.args[i]); + if (message.env != null && Object.hasOwnProperty.call(message, "env")) + for (var keys = Object.keys(message.env), 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.env[keys[i]]).ldelim(); + if (message.workingDir != null && Object.hasOwnProperty.call(message, "workingDir")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.workingDir); + if (message.runAsUser != null && Object.hasOwnProperty.call(message, "runAsUser")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.runAsUser); + return writer; + }; + + /** + * Encodes the specified Container message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.Container.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationConfig.Container + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.IContainer} message Container message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Container.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Container message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.WorkstationConfig.Container + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.WorkstationConfig.Container} Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Container.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.WorkstationConfig.Container(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.image = reader.string(); + break; + } + case 2: { + if (!(message.command && message.command.length)) + message.command = []; + message.command.push(reader.string()); + break; + } + case 3: { + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + } + case 4: { + if (message.env === $util.emptyObject) + message.env = {}; + 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.env[key] = value; + break; + } + case 5: { + message.workingDir = reader.string(); + break; + } + case 6: { + message.runAsUser = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Container message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationConfig.Container + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.WorkstationConfig.Container} Container + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Container.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Container message. + * @function verify + * @memberof google.cloud.workstations.v1.WorkstationConfig.Container + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Container.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.image != null && message.hasOwnProperty("image")) + if (!$util.isString(message.image)) + return "image: string expected"; + if (message.command != null && message.hasOwnProperty("command")) { + if (!Array.isArray(message.command)) + return "command: array expected"; + for (var i = 0; i < message.command.length; ++i) + if (!$util.isString(message.command[i])) + return "command: string[] expected"; + } + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) + if (!$util.isString(message.args[i])) + return "args: string[] expected"; + } + if (message.env != null && message.hasOwnProperty("env")) { + if (!$util.isObject(message.env)) + return "env: object expected"; + var key = Object.keys(message.env); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.env[key[i]])) + return "env: string{k:string} expected"; + } + if (message.workingDir != null && message.hasOwnProperty("workingDir")) + if (!$util.isString(message.workingDir)) + return "workingDir: string expected"; + if (message.runAsUser != null && message.hasOwnProperty("runAsUser")) + if (!$util.isInteger(message.runAsUser)) + return "runAsUser: integer expected"; + return null; + }; + + /** + * Creates a Container message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.WorkstationConfig.Container + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.WorkstationConfig.Container} Container + */ + Container.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.WorkstationConfig.Container) + return object; + var message = new $root.google.cloud.workstations.v1.WorkstationConfig.Container(); + if (object.image != null) + message.image = String(object.image); + if (object.command) { + if (!Array.isArray(object.command)) + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.Container.command: array expected"); + message.command = []; + for (var i = 0; i < object.command.length; ++i) + message.command[i] = String(object.command[i]); + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.Container.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) + message.args[i] = String(object.args[i]); + } + if (object.env) { + if (typeof object.env !== "object") + throw TypeError(".google.cloud.workstations.v1.WorkstationConfig.Container.env: object expected"); + message.env = {}; + for (var keys = Object.keys(object.env), i = 0; i < keys.length; ++i) + message.env[keys[i]] = String(object.env[keys[i]]); + } + if (object.workingDir != null) + message.workingDir = String(object.workingDir); + if (object.runAsUser != null) + message.runAsUser = object.runAsUser | 0; + return message; + }; + + /** + * Creates a plain object from a Container message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.WorkstationConfig.Container + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.Container} message Container + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Container.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.command = []; + object.args = []; + } + if (options.objects || options.defaults) + object.env = {}; + if (options.defaults) { + object.image = ""; + object.workingDir = ""; + object.runAsUser = 0; + } + if (message.image != null && message.hasOwnProperty("image")) + object.image = message.image; + if (message.command && message.command.length) { + object.command = []; + for (var j = 0; j < message.command.length; ++j) + object.command[j] = message.command[j]; + } + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = message.args[j]; + } + var keys2; + if (message.env && (keys2 = Object.keys(message.env)).length) { + object.env = {}; + for (var j = 0; j < keys2.length; ++j) + object.env[keys2[j]] = message.env[keys2[j]]; + } + if (message.workingDir != null && message.hasOwnProperty("workingDir")) + object.workingDir = message.workingDir; + if (message.runAsUser != null && message.hasOwnProperty("runAsUser")) + object.runAsUser = message.runAsUser; + return object; + }; + + /** + * Converts this Container to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.WorkstationConfig.Container + * @instance + * @returns {Object.} JSON object + */ + Container.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Container + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.WorkstationConfig.Container + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Container.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.WorkstationConfig.Container"; + }; + + return Container; + })(); + + WorkstationConfig.CustomerEncryptionKey = (function() { + + /** + * Properties of a CustomerEncryptionKey. + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @interface ICustomerEncryptionKey + * @property {string|null} [kmsKey] CustomerEncryptionKey kmsKey + * @property {string|null} [kmsKeyServiceAccount] CustomerEncryptionKey kmsKeyServiceAccount + */ + + /** + * Constructs a new CustomerEncryptionKey. + * @memberof google.cloud.workstations.v1.WorkstationConfig + * @classdesc Represents a CustomerEncryptionKey. + * @implements ICustomerEncryptionKey + * @constructor + * @param {google.cloud.workstations.v1.WorkstationConfig.ICustomerEncryptionKey=} [properties] Properties to set + */ + function CustomerEncryptionKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomerEncryptionKey kmsKey. + * @member {string} kmsKey + * @memberof google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey + * @instance + */ + CustomerEncryptionKey.prototype.kmsKey = ""; + + /** + * CustomerEncryptionKey kmsKeyServiceAccount. + * @member {string} kmsKeyServiceAccount + * @memberof google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey + * @instance + */ + CustomerEncryptionKey.prototype.kmsKeyServiceAccount = ""; + + /** + * Creates a new CustomerEncryptionKey instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.ICustomerEncryptionKey=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey} CustomerEncryptionKey instance + */ + CustomerEncryptionKey.create = function create(properties) { + return new CustomerEncryptionKey(properties); + }; + + /** + * Encodes the specified CustomerEncryptionKey message. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.ICustomerEncryptionKey} message CustomerEncryptionKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerEncryptionKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kmsKey != null && Object.hasOwnProperty.call(message, "kmsKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKey); + if (message.kmsKeyServiceAccount != null && Object.hasOwnProperty.call(message, "kmsKeyServiceAccount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kmsKeyServiceAccount); + return writer; + }; + + /** + * Encodes the specified CustomerEncryptionKey message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.ICustomerEncryptionKey} message CustomerEncryptionKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerEncryptionKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey} CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerEncryptionKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kmsKey = reader.string(); + break; + } + case 2: { + message.kmsKeyServiceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey} CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerEncryptionKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomerEncryptionKey message. + * @function verify + * @memberof google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomerEncryptionKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + if (!$util.isString(message.kmsKey)) + return "kmsKey: string expected"; + if (message.kmsKeyServiceAccount != null && message.hasOwnProperty("kmsKeyServiceAccount")) + if (!$util.isString(message.kmsKeyServiceAccount)) + return "kmsKeyServiceAccount: string expected"; + return null; + }; + + /** + * Creates a CustomerEncryptionKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey} CustomerEncryptionKey + */ + CustomerEncryptionKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey) + return object; + var message = new $root.google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey(); + if (object.kmsKey != null) + message.kmsKey = String(object.kmsKey); + if (object.kmsKeyServiceAccount != null) + message.kmsKeyServiceAccount = String(object.kmsKeyServiceAccount); + return message; + }; + + /** + * Creates a plain object from a CustomerEncryptionKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey + * @static + * @param {google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey} message CustomerEncryptionKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomerEncryptionKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kmsKey = ""; + object.kmsKeyServiceAccount = ""; + } + if (message.kmsKey != null && message.hasOwnProperty("kmsKey")) + object.kmsKey = message.kmsKey; + if (message.kmsKeyServiceAccount != null && message.hasOwnProperty("kmsKeyServiceAccount")) + object.kmsKeyServiceAccount = message.kmsKeyServiceAccount; + return object; + }; + + /** + * Converts this CustomerEncryptionKey to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey + * @instance + * @returns {Object.} JSON object + */ + CustomerEncryptionKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomerEncryptionKey + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomerEncryptionKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey"; + }; + + return CustomerEncryptionKey; + })(); + + return WorkstationConfig; + })(); + + v1.Workstation = (function() { + + /** + * Properties of a Workstation. + * @memberof google.cloud.workstations.v1 + * @interface IWorkstation + * @property {string|null} [name] Workstation name + * @property {string|null} [displayName] Workstation displayName + * @property {string|null} [uid] Workstation uid + * @property {boolean|null} [reconciling] Workstation reconciling + * @property {Object.|null} [annotations] Workstation annotations + * @property {Object.|null} [labels] Workstation labels + * @property {google.protobuf.ITimestamp|null} [createTime] Workstation createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Workstation updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Workstation deleteTime + * @property {string|null} [etag] Workstation etag + * @property {google.cloud.workstations.v1.Workstation.State|null} [state] Workstation state + * @property {string|null} [host] Workstation host + */ + + /** + * Constructs a new Workstation. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a Workstation. + * @implements IWorkstation + * @constructor + * @param {google.cloud.workstations.v1.IWorkstation=} [properties] Properties to set + */ + function Workstation(properties) { + this.annotations = {}; + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Workstation name. + * @member {string} name + * @memberof google.cloud.workstations.v1.Workstation + * @instance + */ + Workstation.prototype.name = ""; + + /** + * Workstation displayName. + * @member {string} displayName + * @memberof google.cloud.workstations.v1.Workstation + * @instance + */ + Workstation.prototype.displayName = ""; + + /** + * Workstation uid. + * @member {string} uid + * @memberof google.cloud.workstations.v1.Workstation + * @instance + */ + Workstation.prototype.uid = ""; + + /** + * Workstation reconciling. + * @member {boolean} reconciling + * @memberof google.cloud.workstations.v1.Workstation + * @instance + */ + Workstation.prototype.reconciling = false; + + /** + * Workstation annotations. + * @member {Object.} annotations + * @memberof google.cloud.workstations.v1.Workstation + * @instance + */ + Workstation.prototype.annotations = $util.emptyObject; + + /** + * Workstation labels. + * @member {Object.} labels + * @memberof google.cloud.workstations.v1.Workstation + * @instance + */ + Workstation.prototype.labels = $util.emptyObject; + + /** + * Workstation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.workstations.v1.Workstation + * @instance + */ + Workstation.prototype.createTime = null; + + /** + * Workstation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.workstations.v1.Workstation + * @instance + */ + Workstation.prototype.updateTime = null; + + /** + * Workstation deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.workstations.v1.Workstation + * @instance + */ + Workstation.prototype.deleteTime = null; + + /** + * Workstation etag. + * @member {string} etag + * @memberof google.cloud.workstations.v1.Workstation + * @instance + */ + Workstation.prototype.etag = ""; + + /** + * Workstation state. + * @member {google.cloud.workstations.v1.Workstation.State} state + * @memberof google.cloud.workstations.v1.Workstation + * @instance + */ + Workstation.prototype.state = 0; + + /** + * Workstation host. + * @member {string} host + * @memberof google.cloud.workstations.v1.Workstation + * @instance + */ + Workstation.prototype.host = ""; + + /** + * Creates a new Workstation instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.Workstation + * @static + * @param {google.cloud.workstations.v1.IWorkstation=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.Workstation} Workstation instance + */ + Workstation.create = function create(properties) { + return new Workstation(properties); + }; + + /** + * Encodes the specified Workstation message. Does not implicitly {@link google.cloud.workstations.v1.Workstation.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.Workstation + * @static + * @param {google.cloud.workstations.v1.IWorkstation} message Workstation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Workstation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uid); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.reconciling); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.host); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Workstation message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.Workstation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.Workstation + * @static + * @param {google.cloud.workstations.v1.IWorkstation} message Workstation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Workstation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Workstation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.Workstation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.Workstation} Workstation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Workstation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.Workstation(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.uid = reader.string(); + break; + } + case 4: { + message.reconciling = reader.bool(); + break; + } + case 5: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 13: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.etag = reader.string(); + break; + } + case 10: { + message.state = reader.int32(); + break; + } + case 11: { + message.host = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Workstation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.Workstation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.Workstation} Workstation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Workstation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Workstation message. + * @function verify + * @memberof google.cloud.workstations.v1.Workstation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Workstation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + return null; + }; + + /** + * Creates a Workstation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.Workstation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.Workstation} Workstation + */ + Workstation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.Workstation) + return object; + var message = new $root.google.cloud.workstations.v1.Workstation(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.uid != null) + message.uid = String(object.uid); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.workstations.v1.Workstation.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.workstations.v1.Workstation.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.workstations.v1.Workstation.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.workstations.v1.Workstation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.workstations.v1.Workstation.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.etag != null) + message.etag = String(object.etag); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "STATE_STARTING": + case 1: + message.state = 1; + break; + case "STATE_RUNNING": + case 2: + message.state = 2; + break; + case "STATE_STOPPING": + case 3: + message.state = 3; + break; + case "STATE_STOPPED": + case 4: + message.state = 4; + break; + } + if (object.host != null) + message.host = String(object.host); + return message; + }; + + /** + * Creates a plain object from a Workstation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.Workstation + * @static + * @param {google.cloud.workstations.v1.Workstation} message Workstation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Workstation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.annotations = {}; + object.labels = {}; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.uid = ""; + object.reconciling = false; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.etag = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.host = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + 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.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.workstations.v1.Workstation.State[message.state] === undefined ? message.state : $root.google.cloud.workstations.v1.Workstation.State[message.state] : message.state; + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this Workstation to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.Workstation + * @instance + * @returns {Object.} JSON object + */ + Workstation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Workstation + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.Workstation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Workstation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.Workstation"; + }; + + /** + * State enum. + * @name google.cloud.workstations.v1.Workstation.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} STATE_STARTING=1 STATE_STARTING value + * @property {number} STATE_RUNNING=2 STATE_RUNNING value + * @property {number} STATE_STOPPING=3 STATE_STOPPING value + * @property {number} STATE_STOPPED=4 STATE_STOPPED value + */ + Workstation.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STATE_STARTING"] = 1; + values[valuesById[2] = "STATE_RUNNING"] = 2; + values[valuesById[3] = "STATE_STOPPING"] = 3; + values[valuesById[4] = "STATE_STOPPED"] = 4; + return values; + })(); + + return Workstation; + })(); + + v1.GetWorkstationClusterRequest = (function() { + + /** + * Properties of a GetWorkstationClusterRequest. + * @memberof google.cloud.workstations.v1 + * @interface IGetWorkstationClusterRequest + * @property {string|null} [name] GetWorkstationClusterRequest name + */ + + /** + * Constructs a new GetWorkstationClusterRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a GetWorkstationClusterRequest. + * @implements IGetWorkstationClusterRequest + * @constructor + * @param {google.cloud.workstations.v1.IGetWorkstationClusterRequest=} [properties] Properties to set + */ + function GetWorkstationClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetWorkstationClusterRequest name. + * @member {string} name + * @memberof google.cloud.workstations.v1.GetWorkstationClusterRequest + * @instance + */ + GetWorkstationClusterRequest.prototype.name = ""; + + /** + * Creates a new GetWorkstationClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.GetWorkstationClusterRequest + * @static + * @param {google.cloud.workstations.v1.IGetWorkstationClusterRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.GetWorkstationClusterRequest} GetWorkstationClusterRequest instance + */ + GetWorkstationClusterRequest.create = function create(properties) { + return new GetWorkstationClusterRequest(properties); + }; + + /** + * Encodes the specified GetWorkstationClusterRequest message. Does not implicitly {@link google.cloud.workstations.v1.GetWorkstationClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.GetWorkstationClusterRequest + * @static + * @param {google.cloud.workstations.v1.IGetWorkstationClusterRequest} message GetWorkstationClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkstationClusterRequest.encode = function encode(message, writer) { + 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 GetWorkstationClusterRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.GetWorkstationClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.GetWorkstationClusterRequest + * @static + * @param {google.cloud.workstations.v1.IGetWorkstationClusterRequest} message GetWorkstationClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkstationClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetWorkstationClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.GetWorkstationClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.GetWorkstationClusterRequest} GetWorkstationClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkstationClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.GetWorkstationClusterRequest(); + 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 GetWorkstationClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.GetWorkstationClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.GetWorkstationClusterRequest} GetWorkstationClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkstationClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetWorkstationClusterRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.GetWorkstationClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetWorkstationClusterRequest.verify = function verify(message) { + if (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 GetWorkstationClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.GetWorkstationClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.GetWorkstationClusterRequest} GetWorkstationClusterRequest + */ + GetWorkstationClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.GetWorkstationClusterRequest) + return object; + var message = new $root.google.cloud.workstations.v1.GetWorkstationClusterRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetWorkstationClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.GetWorkstationClusterRequest + * @static + * @param {google.cloud.workstations.v1.GetWorkstationClusterRequest} message GetWorkstationClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetWorkstationClusterRequest.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 GetWorkstationClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.GetWorkstationClusterRequest + * @instance + * @returns {Object.} JSON object + */ + GetWorkstationClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetWorkstationClusterRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.GetWorkstationClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetWorkstationClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.GetWorkstationClusterRequest"; + }; + + return GetWorkstationClusterRequest; + })(); + + v1.ListWorkstationClustersRequest = (function() { + + /** + * Properties of a ListWorkstationClustersRequest. + * @memberof google.cloud.workstations.v1 + * @interface IListWorkstationClustersRequest + * @property {string|null} [parent] ListWorkstationClustersRequest parent + * @property {number|null} [pageSize] ListWorkstationClustersRequest pageSize + * @property {string|null} [pageToken] ListWorkstationClustersRequest pageToken + */ + + /** + * Constructs a new ListWorkstationClustersRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a ListWorkstationClustersRequest. + * @implements IListWorkstationClustersRequest + * @constructor + * @param {google.cloud.workstations.v1.IListWorkstationClustersRequest=} [properties] Properties to set + */ + function ListWorkstationClustersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWorkstationClustersRequest parent. + * @member {string} parent + * @memberof google.cloud.workstations.v1.ListWorkstationClustersRequest + * @instance + */ + ListWorkstationClustersRequest.prototype.parent = ""; + + /** + * ListWorkstationClustersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.workstations.v1.ListWorkstationClustersRequest + * @instance + */ + ListWorkstationClustersRequest.prototype.pageSize = 0; + + /** + * ListWorkstationClustersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.workstations.v1.ListWorkstationClustersRequest + * @instance + */ + ListWorkstationClustersRequest.prototype.pageToken = ""; + + /** + * Creates a new ListWorkstationClustersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.ListWorkstationClustersRequest + * @static + * @param {google.cloud.workstations.v1.IListWorkstationClustersRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.ListWorkstationClustersRequest} ListWorkstationClustersRequest instance + */ + ListWorkstationClustersRequest.create = function create(properties) { + return new ListWorkstationClustersRequest(properties); + }; + + /** + * Encodes the specified ListWorkstationClustersRequest message. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationClustersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.ListWorkstationClustersRequest + * @static + * @param {google.cloud.workstations.v1.IListWorkstationClustersRequest} message ListWorkstationClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkstationClustersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListWorkstationClustersRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationClustersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.ListWorkstationClustersRequest + * @static + * @param {google.cloud.workstations.v1.IListWorkstationClustersRequest} message ListWorkstationClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkstationClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWorkstationClustersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.ListWorkstationClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.ListWorkstationClustersRequest} ListWorkstationClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkstationClustersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.ListWorkstationClustersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListWorkstationClustersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.ListWorkstationClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.ListWorkstationClustersRequest} ListWorkstationClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkstationClustersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWorkstationClustersRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.ListWorkstationClustersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkstationClustersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListWorkstationClustersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.ListWorkstationClustersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.ListWorkstationClustersRequest} ListWorkstationClustersRequest + */ + ListWorkstationClustersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.ListWorkstationClustersRequest) + return object; + var message = new $root.google.cloud.workstations.v1.ListWorkstationClustersRequest(); + 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 ListWorkstationClustersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.ListWorkstationClustersRequest + * @static + * @param {google.cloud.workstations.v1.ListWorkstationClustersRequest} message ListWorkstationClustersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkstationClustersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListWorkstationClustersRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.ListWorkstationClustersRequest + * @instance + * @returns {Object.} JSON object + */ + ListWorkstationClustersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListWorkstationClustersRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.ListWorkstationClustersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWorkstationClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.ListWorkstationClustersRequest"; + }; + + return ListWorkstationClustersRequest; + })(); + + v1.ListWorkstationClustersResponse = (function() { + + /** + * Properties of a ListWorkstationClustersResponse. + * @memberof google.cloud.workstations.v1 + * @interface IListWorkstationClustersResponse + * @property {Array.|null} [workstationClusters] ListWorkstationClustersResponse workstationClusters + * @property {string|null} [nextPageToken] ListWorkstationClustersResponse nextPageToken + * @property {Array.|null} [unreachable] ListWorkstationClustersResponse unreachable + */ + + /** + * Constructs a new ListWorkstationClustersResponse. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a ListWorkstationClustersResponse. + * @implements IListWorkstationClustersResponse + * @constructor + * @param {google.cloud.workstations.v1.IListWorkstationClustersResponse=} [properties] Properties to set + */ + function ListWorkstationClustersResponse(properties) { + this.workstationClusters = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWorkstationClustersResponse workstationClusters. + * @member {Array.} workstationClusters + * @memberof google.cloud.workstations.v1.ListWorkstationClustersResponse + * @instance + */ + ListWorkstationClustersResponse.prototype.workstationClusters = $util.emptyArray; + + /** + * ListWorkstationClustersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.workstations.v1.ListWorkstationClustersResponse + * @instance + */ + ListWorkstationClustersResponse.prototype.nextPageToken = ""; + + /** + * ListWorkstationClustersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.workstations.v1.ListWorkstationClustersResponse + * @instance + */ + ListWorkstationClustersResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListWorkstationClustersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.ListWorkstationClustersResponse + * @static + * @param {google.cloud.workstations.v1.IListWorkstationClustersResponse=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.ListWorkstationClustersResponse} ListWorkstationClustersResponse instance + */ + ListWorkstationClustersResponse.create = function create(properties) { + return new ListWorkstationClustersResponse(properties); + }; + + /** + * Encodes the specified ListWorkstationClustersResponse message. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationClustersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.ListWorkstationClustersResponse + * @static + * @param {google.cloud.workstations.v1.IListWorkstationClustersResponse} message ListWorkstationClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkstationClustersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workstationClusters != null && message.workstationClusters.length) + for (var i = 0; i < message.workstationClusters.length; ++i) + $root.google.cloud.workstations.v1.WorkstationCluster.encode(message.workstationClusters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListWorkstationClustersResponse message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationClustersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.ListWorkstationClustersResponse + * @static + * @param {google.cloud.workstations.v1.IListWorkstationClustersResponse} message ListWorkstationClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkstationClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWorkstationClustersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.ListWorkstationClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.ListWorkstationClustersResponse} ListWorkstationClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkstationClustersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.ListWorkstationClustersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.workstationClusters && message.workstationClusters.length)) + message.workstationClusters = []; + message.workstationClusters.push($root.google.cloud.workstations.v1.WorkstationCluster.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListWorkstationClustersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.ListWorkstationClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.ListWorkstationClustersResponse} ListWorkstationClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkstationClustersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWorkstationClustersResponse message. + * @function verify + * @memberof google.cloud.workstations.v1.ListWorkstationClustersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkstationClustersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workstationClusters != null && message.hasOwnProperty("workstationClusters")) { + if (!Array.isArray(message.workstationClusters)) + return "workstationClusters: array expected"; + for (var i = 0; i < message.workstationClusters.length; ++i) { + var error = $root.google.cloud.workstations.v1.WorkstationCluster.verify(message.workstationClusters[i]); + if (error) + return "workstationClusters." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListWorkstationClustersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.ListWorkstationClustersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.ListWorkstationClustersResponse} ListWorkstationClustersResponse + */ + ListWorkstationClustersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.ListWorkstationClustersResponse) + return object; + var message = new $root.google.cloud.workstations.v1.ListWorkstationClustersResponse(); + if (object.workstationClusters) { + if (!Array.isArray(object.workstationClusters)) + throw TypeError(".google.cloud.workstations.v1.ListWorkstationClustersResponse.workstationClusters: array expected"); + message.workstationClusters = []; + for (var i = 0; i < object.workstationClusters.length; ++i) { + if (typeof object.workstationClusters[i] !== "object") + throw TypeError(".google.cloud.workstations.v1.ListWorkstationClustersResponse.workstationClusters: object expected"); + message.workstationClusters[i] = $root.google.cloud.workstations.v1.WorkstationCluster.fromObject(object.workstationClusters[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.workstations.v1.ListWorkstationClustersResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListWorkstationClustersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.ListWorkstationClustersResponse + * @static + * @param {google.cloud.workstations.v1.ListWorkstationClustersResponse} message ListWorkstationClustersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkstationClustersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.workstationClusters = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.workstationClusters && message.workstationClusters.length) { + object.workstationClusters = []; + for (var j = 0; j < message.workstationClusters.length; ++j) + object.workstationClusters[j] = $root.google.cloud.workstations.v1.WorkstationCluster.toObject(message.workstationClusters[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListWorkstationClustersResponse to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.ListWorkstationClustersResponse + * @instance + * @returns {Object.} JSON object + */ + ListWorkstationClustersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListWorkstationClustersResponse + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.ListWorkstationClustersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWorkstationClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.ListWorkstationClustersResponse"; + }; + + return ListWorkstationClustersResponse; + })(); + + v1.CreateWorkstationClusterRequest = (function() { + + /** + * Properties of a CreateWorkstationClusterRequest. + * @memberof google.cloud.workstations.v1 + * @interface ICreateWorkstationClusterRequest + * @property {string|null} [parent] CreateWorkstationClusterRequest parent + * @property {string|null} [workstationClusterId] CreateWorkstationClusterRequest workstationClusterId + * @property {google.cloud.workstations.v1.IWorkstationCluster|null} [workstationCluster] CreateWorkstationClusterRequest workstationCluster + * @property {boolean|null} [validateOnly] CreateWorkstationClusterRequest validateOnly + */ + + /** + * Constructs a new CreateWorkstationClusterRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a CreateWorkstationClusterRequest. + * @implements ICreateWorkstationClusterRequest + * @constructor + * @param {google.cloud.workstations.v1.ICreateWorkstationClusterRequest=} [properties] Properties to set + */ + function CreateWorkstationClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateWorkstationClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.workstations.v1.CreateWorkstationClusterRequest + * @instance + */ + CreateWorkstationClusterRequest.prototype.parent = ""; + + /** + * CreateWorkstationClusterRequest workstationClusterId. + * @member {string} workstationClusterId + * @memberof google.cloud.workstations.v1.CreateWorkstationClusterRequest + * @instance + */ + CreateWorkstationClusterRequest.prototype.workstationClusterId = ""; + + /** + * CreateWorkstationClusterRequest workstationCluster. + * @member {google.cloud.workstations.v1.IWorkstationCluster|null|undefined} workstationCluster + * @memberof google.cloud.workstations.v1.CreateWorkstationClusterRequest + * @instance + */ + CreateWorkstationClusterRequest.prototype.workstationCluster = null; + + /** + * CreateWorkstationClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.workstations.v1.CreateWorkstationClusterRequest + * @instance + */ + CreateWorkstationClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateWorkstationClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.CreateWorkstationClusterRequest + * @static + * @param {google.cloud.workstations.v1.ICreateWorkstationClusterRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.CreateWorkstationClusterRequest} CreateWorkstationClusterRequest instance + */ + CreateWorkstationClusterRequest.create = function create(properties) { + return new CreateWorkstationClusterRequest(properties); + }; + + /** + * Encodes the specified CreateWorkstationClusterRequest message. Does not implicitly {@link google.cloud.workstations.v1.CreateWorkstationClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.CreateWorkstationClusterRequest + * @static + * @param {google.cloud.workstations.v1.ICreateWorkstationClusterRequest} message CreateWorkstationClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkstationClusterRequest.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.workstationClusterId != null && Object.hasOwnProperty.call(message, "workstationClusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.workstationClusterId); + if (message.workstationCluster != null && Object.hasOwnProperty.call(message, "workstationCluster")) + $root.google.cloud.workstations.v1.WorkstationCluster.encode(message.workstationCluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateWorkstationClusterRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.CreateWorkstationClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.CreateWorkstationClusterRequest + * @static + * @param {google.cloud.workstations.v1.ICreateWorkstationClusterRequest} message CreateWorkstationClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkstationClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateWorkstationClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.CreateWorkstationClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.CreateWorkstationClusterRequest} CreateWorkstationClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkstationClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.CreateWorkstationClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.workstationClusterId = reader.string(); + break; + } + case 3: { + message.workstationCluster = $root.google.cloud.workstations.v1.WorkstationCluster.decode(reader, reader.uint32()); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateWorkstationClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.CreateWorkstationClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.CreateWorkstationClusterRequest} CreateWorkstationClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkstationClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateWorkstationClusterRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.CreateWorkstationClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateWorkstationClusterRequest.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.workstationClusterId != null && message.hasOwnProperty("workstationClusterId")) + if (!$util.isString(message.workstationClusterId)) + return "workstationClusterId: string expected"; + if (message.workstationCluster != null && message.hasOwnProperty("workstationCluster")) { + var error = $root.google.cloud.workstations.v1.WorkstationCluster.verify(message.workstationCluster); + if (error) + return "workstationCluster." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateWorkstationClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.CreateWorkstationClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.CreateWorkstationClusterRequest} CreateWorkstationClusterRequest + */ + CreateWorkstationClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.CreateWorkstationClusterRequest) + return object; + var message = new $root.google.cloud.workstations.v1.CreateWorkstationClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.workstationClusterId != null) + message.workstationClusterId = String(object.workstationClusterId); + if (object.workstationCluster != null) { + if (typeof object.workstationCluster !== "object") + throw TypeError(".google.cloud.workstations.v1.CreateWorkstationClusterRequest.workstationCluster: object expected"); + message.workstationCluster = $root.google.cloud.workstations.v1.WorkstationCluster.fromObject(object.workstationCluster); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateWorkstationClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.CreateWorkstationClusterRequest + * @static + * @param {google.cloud.workstations.v1.CreateWorkstationClusterRequest} message CreateWorkstationClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateWorkstationClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.workstationClusterId = ""; + object.workstationCluster = null; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.workstationClusterId != null && message.hasOwnProperty("workstationClusterId")) + object.workstationClusterId = message.workstationClusterId; + if (message.workstationCluster != null && message.hasOwnProperty("workstationCluster")) + object.workstationCluster = $root.google.cloud.workstations.v1.WorkstationCluster.toObject(message.workstationCluster, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateWorkstationClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.CreateWorkstationClusterRequest + * @instance + * @returns {Object.} JSON object + */ + CreateWorkstationClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateWorkstationClusterRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.CreateWorkstationClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateWorkstationClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.CreateWorkstationClusterRequest"; + }; + + return CreateWorkstationClusterRequest; + })(); + + v1.UpdateWorkstationClusterRequest = (function() { + + /** + * Properties of an UpdateWorkstationClusterRequest. + * @memberof google.cloud.workstations.v1 + * @interface IUpdateWorkstationClusterRequest + * @property {google.cloud.workstations.v1.IWorkstationCluster|null} [workstationCluster] UpdateWorkstationClusterRequest workstationCluster + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateWorkstationClusterRequest updateMask + * @property {boolean|null} [validateOnly] UpdateWorkstationClusterRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateWorkstationClusterRequest allowMissing + */ + + /** + * Constructs a new UpdateWorkstationClusterRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents an UpdateWorkstationClusterRequest. + * @implements IUpdateWorkstationClusterRequest + * @constructor + * @param {google.cloud.workstations.v1.IUpdateWorkstationClusterRequest=} [properties] Properties to set + */ + function UpdateWorkstationClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateWorkstationClusterRequest workstationCluster. + * @member {google.cloud.workstations.v1.IWorkstationCluster|null|undefined} workstationCluster + * @memberof google.cloud.workstations.v1.UpdateWorkstationClusterRequest + * @instance + */ + UpdateWorkstationClusterRequest.prototype.workstationCluster = null; + + /** + * UpdateWorkstationClusterRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.workstations.v1.UpdateWorkstationClusterRequest + * @instance + */ + UpdateWorkstationClusterRequest.prototype.updateMask = null; + + /** + * UpdateWorkstationClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.workstations.v1.UpdateWorkstationClusterRequest + * @instance + */ + UpdateWorkstationClusterRequest.prototype.validateOnly = false; + + /** + * UpdateWorkstationClusterRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.workstations.v1.UpdateWorkstationClusterRequest + * @instance + */ + UpdateWorkstationClusterRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateWorkstationClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.UpdateWorkstationClusterRequest + * @static + * @param {google.cloud.workstations.v1.IUpdateWorkstationClusterRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.UpdateWorkstationClusterRequest} UpdateWorkstationClusterRequest instance + */ + UpdateWorkstationClusterRequest.create = function create(properties) { + return new UpdateWorkstationClusterRequest(properties); + }; + + /** + * Encodes the specified UpdateWorkstationClusterRequest message. Does not implicitly {@link google.cloud.workstations.v1.UpdateWorkstationClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.UpdateWorkstationClusterRequest + * @static + * @param {google.cloud.workstations.v1.IUpdateWorkstationClusterRequest} message UpdateWorkstationClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkstationClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workstationCluster != null && Object.hasOwnProperty.call(message, "workstationCluster")) + $root.google.cloud.workstations.v1.WorkstationCluster.encode(message.workstationCluster, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateWorkstationClusterRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.UpdateWorkstationClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.UpdateWorkstationClusterRequest + * @static + * @param {google.cloud.workstations.v1.IUpdateWorkstationClusterRequest} message UpdateWorkstationClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkstationClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateWorkstationClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.UpdateWorkstationClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.UpdateWorkstationClusterRequest} UpdateWorkstationClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkstationClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.UpdateWorkstationClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.workstationCluster = $root.google.cloud.workstations.v1.WorkstationCluster.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateWorkstationClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.UpdateWorkstationClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.UpdateWorkstationClusterRequest} UpdateWorkstationClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkstationClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateWorkstationClusterRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.UpdateWorkstationClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateWorkstationClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workstationCluster != null && message.hasOwnProperty("workstationCluster")) { + var error = $root.google.cloud.workstations.v1.WorkstationCluster.verify(message.workstationCluster); + if (error) + return "workstationCluster." + 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"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateWorkstationClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.UpdateWorkstationClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.UpdateWorkstationClusterRequest} UpdateWorkstationClusterRequest + */ + UpdateWorkstationClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.UpdateWorkstationClusterRequest) + return object; + var message = new $root.google.cloud.workstations.v1.UpdateWorkstationClusterRequest(); + if (object.workstationCluster != null) { + if (typeof object.workstationCluster !== "object") + throw TypeError(".google.cloud.workstations.v1.UpdateWorkstationClusterRequest.workstationCluster: object expected"); + message.workstationCluster = $root.google.cloud.workstations.v1.WorkstationCluster.fromObject(object.workstationCluster); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.workstations.v1.UpdateWorkstationClusterRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateWorkstationClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.UpdateWorkstationClusterRequest + * @static + * @param {google.cloud.workstations.v1.UpdateWorkstationClusterRequest} message UpdateWorkstationClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateWorkstationClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.workstationCluster = null; + object.updateMask = null; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.workstationCluster != null && message.hasOwnProperty("workstationCluster")) + object.workstationCluster = $root.google.cloud.workstations.v1.WorkstationCluster.toObject(message.workstationCluster, 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; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateWorkstationClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.UpdateWorkstationClusterRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateWorkstationClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateWorkstationClusterRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.UpdateWorkstationClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateWorkstationClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.UpdateWorkstationClusterRequest"; + }; + + return UpdateWorkstationClusterRequest; + })(); + + v1.DeleteWorkstationClusterRequest = (function() { + + /** + * Properties of a DeleteWorkstationClusterRequest. + * @memberof google.cloud.workstations.v1 + * @interface IDeleteWorkstationClusterRequest + * @property {string|null} [name] DeleteWorkstationClusterRequest name + * @property {boolean|null} [validateOnly] DeleteWorkstationClusterRequest validateOnly + * @property {string|null} [etag] DeleteWorkstationClusterRequest etag + * @property {boolean|null} [force] DeleteWorkstationClusterRequest force + */ + + /** + * Constructs a new DeleteWorkstationClusterRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a DeleteWorkstationClusterRequest. + * @implements IDeleteWorkstationClusterRequest + * @constructor + * @param {google.cloud.workstations.v1.IDeleteWorkstationClusterRequest=} [properties] Properties to set + */ + function DeleteWorkstationClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteWorkstationClusterRequest name. + * @member {string} name + * @memberof google.cloud.workstations.v1.DeleteWorkstationClusterRequest + * @instance + */ + DeleteWorkstationClusterRequest.prototype.name = ""; + + /** + * DeleteWorkstationClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.workstations.v1.DeleteWorkstationClusterRequest + * @instance + */ + DeleteWorkstationClusterRequest.prototype.validateOnly = false; + + /** + * DeleteWorkstationClusterRequest etag. + * @member {string} etag + * @memberof google.cloud.workstations.v1.DeleteWorkstationClusterRequest + * @instance + */ + DeleteWorkstationClusterRequest.prototype.etag = ""; + + /** + * DeleteWorkstationClusterRequest force. + * @member {boolean} force + * @memberof google.cloud.workstations.v1.DeleteWorkstationClusterRequest + * @instance + */ + DeleteWorkstationClusterRequest.prototype.force = false; + + /** + * Creates a new DeleteWorkstationClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.DeleteWorkstationClusterRequest + * @static + * @param {google.cloud.workstations.v1.IDeleteWorkstationClusterRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.DeleteWorkstationClusterRequest} DeleteWorkstationClusterRequest instance + */ + DeleteWorkstationClusterRequest.create = function create(properties) { + return new DeleteWorkstationClusterRequest(properties); + }; + + /** + * Encodes the specified DeleteWorkstationClusterRequest message. Does not implicitly {@link google.cloud.workstations.v1.DeleteWorkstationClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.DeleteWorkstationClusterRequest + * @static + * @param {google.cloud.workstations.v1.IDeleteWorkstationClusterRequest} message DeleteWorkstationClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkstationClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteWorkstationClusterRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.DeleteWorkstationClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.DeleteWorkstationClusterRequest + * @static + * @param {google.cloud.workstations.v1.IDeleteWorkstationClusterRequest} message DeleteWorkstationClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkstationClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteWorkstationClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.DeleteWorkstationClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.DeleteWorkstationClusterRequest} DeleteWorkstationClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkstationClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.DeleteWorkstationClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteWorkstationClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.DeleteWorkstationClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.DeleteWorkstationClusterRequest} DeleteWorkstationClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkstationClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteWorkstationClusterRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.DeleteWorkstationClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteWorkstationClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteWorkstationClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.DeleteWorkstationClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.DeleteWorkstationClusterRequest} DeleteWorkstationClusterRequest + */ + DeleteWorkstationClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.DeleteWorkstationClusterRequest) + return object; + var message = new $root.google.cloud.workstations.v1.DeleteWorkstationClusterRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteWorkstationClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.DeleteWorkstationClusterRequest + * @static + * @param {google.cloud.workstations.v1.DeleteWorkstationClusterRequest} message DeleteWorkstationClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteWorkstationClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteWorkstationClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.DeleteWorkstationClusterRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteWorkstationClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteWorkstationClusterRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.DeleteWorkstationClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteWorkstationClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.DeleteWorkstationClusterRequest"; + }; + + return DeleteWorkstationClusterRequest; + })(); + + v1.GetWorkstationConfigRequest = (function() { + + /** + * Properties of a GetWorkstationConfigRequest. + * @memberof google.cloud.workstations.v1 + * @interface IGetWorkstationConfigRequest + * @property {string|null} [name] GetWorkstationConfigRequest name + */ + + /** + * Constructs a new GetWorkstationConfigRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a GetWorkstationConfigRequest. + * @implements IGetWorkstationConfigRequest + * @constructor + * @param {google.cloud.workstations.v1.IGetWorkstationConfigRequest=} [properties] Properties to set + */ + function GetWorkstationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetWorkstationConfigRequest name. + * @member {string} name + * @memberof google.cloud.workstations.v1.GetWorkstationConfigRequest + * @instance + */ + GetWorkstationConfigRequest.prototype.name = ""; + + /** + * Creates a new GetWorkstationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.GetWorkstationConfigRequest + * @static + * @param {google.cloud.workstations.v1.IGetWorkstationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.GetWorkstationConfigRequest} GetWorkstationConfigRequest instance + */ + GetWorkstationConfigRequest.create = function create(properties) { + return new GetWorkstationConfigRequest(properties); + }; + + /** + * Encodes the specified GetWorkstationConfigRequest message. Does not implicitly {@link google.cloud.workstations.v1.GetWorkstationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.GetWorkstationConfigRequest + * @static + * @param {google.cloud.workstations.v1.IGetWorkstationConfigRequest} message GetWorkstationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkstationConfigRequest.encode = function encode(message, writer) { + 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 GetWorkstationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.GetWorkstationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.GetWorkstationConfigRequest + * @static + * @param {google.cloud.workstations.v1.IGetWorkstationConfigRequest} message GetWorkstationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkstationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetWorkstationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.GetWorkstationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.GetWorkstationConfigRequest} GetWorkstationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkstationConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.GetWorkstationConfigRequest(); + 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 GetWorkstationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.GetWorkstationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.GetWorkstationConfigRequest} GetWorkstationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkstationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetWorkstationConfigRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.GetWorkstationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetWorkstationConfigRequest.verify = function verify(message) { + if (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 GetWorkstationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.GetWorkstationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.GetWorkstationConfigRequest} GetWorkstationConfigRequest + */ + GetWorkstationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.GetWorkstationConfigRequest) + return object; + var message = new $root.google.cloud.workstations.v1.GetWorkstationConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetWorkstationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.GetWorkstationConfigRequest + * @static + * @param {google.cloud.workstations.v1.GetWorkstationConfigRequest} message GetWorkstationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetWorkstationConfigRequest.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 GetWorkstationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.GetWorkstationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetWorkstationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetWorkstationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.GetWorkstationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetWorkstationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.GetWorkstationConfigRequest"; + }; + + return GetWorkstationConfigRequest; + })(); + + v1.ListWorkstationConfigsRequest = (function() { + + /** + * Properties of a ListWorkstationConfigsRequest. + * @memberof google.cloud.workstations.v1 + * @interface IListWorkstationConfigsRequest + * @property {string|null} [parent] ListWorkstationConfigsRequest parent + * @property {number|null} [pageSize] ListWorkstationConfigsRequest pageSize + * @property {string|null} [pageToken] ListWorkstationConfigsRequest pageToken + */ + + /** + * Constructs a new ListWorkstationConfigsRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a ListWorkstationConfigsRequest. + * @implements IListWorkstationConfigsRequest + * @constructor + * @param {google.cloud.workstations.v1.IListWorkstationConfigsRequest=} [properties] Properties to set + */ + function ListWorkstationConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWorkstationConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsRequest + * @instance + */ + ListWorkstationConfigsRequest.prototype.parent = ""; + + /** + * ListWorkstationConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsRequest + * @instance + */ + ListWorkstationConfigsRequest.prototype.pageSize = 0; + + /** + * ListWorkstationConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsRequest + * @instance + */ + ListWorkstationConfigsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListWorkstationConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsRequest + * @static + * @param {google.cloud.workstations.v1.IListWorkstationConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.ListWorkstationConfigsRequest} ListWorkstationConfigsRequest instance + */ + ListWorkstationConfigsRequest.create = function create(properties) { + return new ListWorkstationConfigsRequest(properties); + }; + + /** + * Encodes the specified ListWorkstationConfigsRequest message. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsRequest + * @static + * @param {google.cloud.workstations.v1.IListWorkstationConfigsRequest} message ListWorkstationConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkstationConfigsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListWorkstationConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsRequest + * @static + * @param {google.cloud.workstations.v1.IListWorkstationConfigsRequest} message ListWorkstationConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkstationConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWorkstationConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.ListWorkstationConfigsRequest} ListWorkstationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkstationConfigsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.ListWorkstationConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListWorkstationConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.ListWorkstationConfigsRequest} ListWorkstationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkstationConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWorkstationConfigsRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkstationConfigsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListWorkstationConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.ListWorkstationConfigsRequest} ListWorkstationConfigsRequest + */ + ListWorkstationConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.ListWorkstationConfigsRequest) + return object; + var message = new $root.google.cloud.workstations.v1.ListWorkstationConfigsRequest(); + 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 ListWorkstationConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsRequest + * @static + * @param {google.cloud.workstations.v1.ListWorkstationConfigsRequest} message ListWorkstationConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkstationConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListWorkstationConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListWorkstationConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListWorkstationConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWorkstationConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.ListWorkstationConfigsRequest"; + }; + + return ListWorkstationConfigsRequest; + })(); + + v1.ListWorkstationConfigsResponse = (function() { + + /** + * Properties of a ListWorkstationConfigsResponse. + * @memberof google.cloud.workstations.v1 + * @interface IListWorkstationConfigsResponse + * @property {Array.|null} [workstationConfigs] ListWorkstationConfigsResponse workstationConfigs + * @property {string|null} [nextPageToken] ListWorkstationConfigsResponse nextPageToken + * @property {Array.|null} [unreachable] ListWorkstationConfigsResponse unreachable + */ + + /** + * Constructs a new ListWorkstationConfigsResponse. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a ListWorkstationConfigsResponse. + * @implements IListWorkstationConfigsResponse + * @constructor + * @param {google.cloud.workstations.v1.IListWorkstationConfigsResponse=} [properties] Properties to set + */ + function ListWorkstationConfigsResponse(properties) { + this.workstationConfigs = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWorkstationConfigsResponse workstationConfigs. + * @member {Array.} workstationConfigs + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsResponse + * @instance + */ + ListWorkstationConfigsResponse.prototype.workstationConfigs = $util.emptyArray; + + /** + * ListWorkstationConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsResponse + * @instance + */ + ListWorkstationConfigsResponse.prototype.nextPageToken = ""; + + /** + * ListWorkstationConfigsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsResponse + * @instance + */ + ListWorkstationConfigsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListWorkstationConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsResponse + * @static + * @param {google.cloud.workstations.v1.IListWorkstationConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.ListWorkstationConfigsResponse} ListWorkstationConfigsResponse instance + */ + ListWorkstationConfigsResponse.create = function create(properties) { + return new ListWorkstationConfigsResponse(properties); + }; + + /** + * Encodes the specified ListWorkstationConfigsResponse message. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsResponse + * @static + * @param {google.cloud.workstations.v1.IListWorkstationConfigsResponse} message ListWorkstationConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkstationConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workstationConfigs != null && message.workstationConfigs.length) + for (var i = 0; i < message.workstationConfigs.length; ++i) + $root.google.cloud.workstations.v1.WorkstationConfig.encode(message.workstationConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListWorkstationConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsResponse + * @static + * @param {google.cloud.workstations.v1.IListWorkstationConfigsResponse} message ListWorkstationConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkstationConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWorkstationConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.ListWorkstationConfigsResponse} ListWorkstationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkstationConfigsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.ListWorkstationConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.workstationConfigs && message.workstationConfigs.length)) + message.workstationConfigs = []; + message.workstationConfigs.push($root.google.cloud.workstations.v1.WorkstationConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListWorkstationConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.ListWorkstationConfigsResponse} ListWorkstationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkstationConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWorkstationConfigsResponse message. + * @function verify + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkstationConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workstationConfigs != null && message.hasOwnProperty("workstationConfigs")) { + if (!Array.isArray(message.workstationConfigs)) + return "workstationConfigs: array expected"; + for (var i = 0; i < message.workstationConfigs.length; ++i) { + var error = $root.google.cloud.workstations.v1.WorkstationConfig.verify(message.workstationConfigs[i]); + if (error) + return "workstationConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListWorkstationConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.ListWorkstationConfigsResponse} ListWorkstationConfigsResponse + */ + ListWorkstationConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.ListWorkstationConfigsResponse) + return object; + var message = new $root.google.cloud.workstations.v1.ListWorkstationConfigsResponse(); + if (object.workstationConfigs) { + if (!Array.isArray(object.workstationConfigs)) + throw TypeError(".google.cloud.workstations.v1.ListWorkstationConfigsResponse.workstationConfigs: array expected"); + message.workstationConfigs = []; + for (var i = 0; i < object.workstationConfigs.length; ++i) { + if (typeof object.workstationConfigs[i] !== "object") + throw TypeError(".google.cloud.workstations.v1.ListWorkstationConfigsResponse.workstationConfigs: object expected"); + message.workstationConfigs[i] = $root.google.cloud.workstations.v1.WorkstationConfig.fromObject(object.workstationConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.workstations.v1.ListWorkstationConfigsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListWorkstationConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsResponse + * @static + * @param {google.cloud.workstations.v1.ListWorkstationConfigsResponse} message ListWorkstationConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkstationConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.workstationConfigs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.workstationConfigs && message.workstationConfigs.length) { + object.workstationConfigs = []; + for (var j = 0; j < message.workstationConfigs.length; ++j) + object.workstationConfigs[j] = $root.google.cloud.workstations.v1.WorkstationConfig.toObject(message.workstationConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListWorkstationConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListWorkstationConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListWorkstationConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.ListWorkstationConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWorkstationConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.ListWorkstationConfigsResponse"; + }; + + return ListWorkstationConfigsResponse; + })(); + + v1.ListUsableWorkstationConfigsRequest = (function() { + + /** + * Properties of a ListUsableWorkstationConfigsRequest. + * @memberof google.cloud.workstations.v1 + * @interface IListUsableWorkstationConfigsRequest + * @property {string|null} [parent] ListUsableWorkstationConfigsRequest parent + * @property {number|null} [pageSize] ListUsableWorkstationConfigsRequest pageSize + * @property {string|null} [pageToken] ListUsableWorkstationConfigsRequest pageToken + */ + + /** + * Constructs a new ListUsableWorkstationConfigsRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a ListUsableWorkstationConfigsRequest. + * @implements IListUsableWorkstationConfigsRequest + * @constructor + * @param {google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest=} [properties] Properties to set + */ + function ListUsableWorkstationConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUsableWorkstationConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest + * @instance + */ + ListUsableWorkstationConfigsRequest.prototype.parent = ""; + + /** + * ListUsableWorkstationConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest + * @instance + */ + ListUsableWorkstationConfigsRequest.prototype.pageSize = 0; + + /** + * ListUsableWorkstationConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest + * @instance + */ + ListUsableWorkstationConfigsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListUsableWorkstationConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest + * @static + * @param {google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest} ListUsableWorkstationConfigsRequest instance + */ + ListUsableWorkstationConfigsRequest.create = function create(properties) { + return new ListUsableWorkstationConfigsRequest(properties); + }; + + /** + * Encodes the specified ListUsableWorkstationConfigsRequest message. Does not implicitly {@link google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest + * @static + * @param {google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest} message ListUsableWorkstationConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsableWorkstationConfigsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListUsableWorkstationConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest + * @static + * @param {google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest} message ListUsableWorkstationConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsableWorkstationConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUsableWorkstationConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest} ListUsableWorkstationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsableWorkstationConfigsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUsableWorkstationConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest} ListUsableWorkstationConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsableWorkstationConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUsableWorkstationConfigsRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUsableWorkstationConfigsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListUsableWorkstationConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest} ListUsableWorkstationConfigsRequest + */ + ListUsableWorkstationConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest) + return object; + var message = new $root.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest(); + 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 ListUsableWorkstationConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest + * @static + * @param {google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest} message ListUsableWorkstationConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUsableWorkstationConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListUsableWorkstationConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListUsableWorkstationConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUsableWorkstationConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUsableWorkstationConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest"; + }; + + return ListUsableWorkstationConfigsRequest; + })(); + + v1.ListUsableWorkstationConfigsResponse = (function() { + + /** + * Properties of a ListUsableWorkstationConfigsResponse. + * @memberof google.cloud.workstations.v1 + * @interface IListUsableWorkstationConfigsResponse + * @property {Array.|null} [workstationConfigs] ListUsableWorkstationConfigsResponse workstationConfigs + * @property {string|null} [nextPageToken] ListUsableWorkstationConfigsResponse nextPageToken + * @property {Array.|null} [unreachable] ListUsableWorkstationConfigsResponse unreachable + */ + + /** + * Constructs a new ListUsableWorkstationConfigsResponse. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a ListUsableWorkstationConfigsResponse. + * @implements IListUsableWorkstationConfigsResponse + * @constructor + * @param {google.cloud.workstations.v1.IListUsableWorkstationConfigsResponse=} [properties] Properties to set + */ + function ListUsableWorkstationConfigsResponse(properties) { + this.workstationConfigs = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUsableWorkstationConfigsResponse workstationConfigs. + * @member {Array.} workstationConfigs + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse + * @instance + */ + ListUsableWorkstationConfigsResponse.prototype.workstationConfigs = $util.emptyArray; + + /** + * ListUsableWorkstationConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse + * @instance + */ + ListUsableWorkstationConfigsResponse.prototype.nextPageToken = ""; + + /** + * ListUsableWorkstationConfigsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse + * @instance + */ + ListUsableWorkstationConfigsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListUsableWorkstationConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse + * @static + * @param {google.cloud.workstations.v1.IListUsableWorkstationConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse} ListUsableWorkstationConfigsResponse instance + */ + ListUsableWorkstationConfigsResponse.create = function create(properties) { + return new ListUsableWorkstationConfigsResponse(properties); + }; + + /** + * Encodes the specified ListUsableWorkstationConfigsResponse message. Does not implicitly {@link google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse + * @static + * @param {google.cloud.workstations.v1.IListUsableWorkstationConfigsResponse} message ListUsableWorkstationConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsableWorkstationConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workstationConfigs != null && message.workstationConfigs.length) + for (var i = 0; i < message.workstationConfigs.length; ++i) + $root.google.cloud.workstations.v1.WorkstationConfig.encode(message.workstationConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListUsableWorkstationConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse + * @static + * @param {google.cloud.workstations.v1.IListUsableWorkstationConfigsResponse} message ListUsableWorkstationConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsableWorkstationConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUsableWorkstationConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse} ListUsableWorkstationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsableWorkstationConfigsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.workstationConfigs && message.workstationConfigs.length)) + message.workstationConfigs = []; + message.workstationConfigs.push($root.google.cloud.workstations.v1.WorkstationConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUsableWorkstationConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse} ListUsableWorkstationConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsableWorkstationConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUsableWorkstationConfigsResponse message. + * @function verify + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUsableWorkstationConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workstationConfigs != null && message.hasOwnProperty("workstationConfigs")) { + if (!Array.isArray(message.workstationConfigs)) + return "workstationConfigs: array expected"; + for (var i = 0; i < message.workstationConfigs.length; ++i) { + var error = $root.google.cloud.workstations.v1.WorkstationConfig.verify(message.workstationConfigs[i]); + if (error) + return "workstationConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListUsableWorkstationConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse} ListUsableWorkstationConfigsResponse + */ + ListUsableWorkstationConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse) + return object; + var message = new $root.google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse(); + if (object.workstationConfigs) { + if (!Array.isArray(object.workstationConfigs)) + throw TypeError(".google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse.workstationConfigs: array expected"); + message.workstationConfigs = []; + for (var i = 0; i < object.workstationConfigs.length; ++i) { + if (typeof object.workstationConfigs[i] !== "object") + throw TypeError(".google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse.workstationConfigs: object expected"); + message.workstationConfigs[i] = $root.google.cloud.workstations.v1.WorkstationConfig.fromObject(object.workstationConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListUsableWorkstationConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse + * @static + * @param {google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse} message ListUsableWorkstationConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUsableWorkstationConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.workstationConfigs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.workstationConfigs && message.workstationConfigs.length) { + object.workstationConfigs = []; + for (var j = 0; j < message.workstationConfigs.length; ++j) + object.workstationConfigs[j] = $root.google.cloud.workstations.v1.WorkstationConfig.toObject(message.workstationConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListUsableWorkstationConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListUsableWorkstationConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUsableWorkstationConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUsableWorkstationConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse"; + }; + + return ListUsableWorkstationConfigsResponse; + })(); + + v1.CreateWorkstationConfigRequest = (function() { + + /** + * Properties of a CreateWorkstationConfigRequest. + * @memberof google.cloud.workstations.v1 + * @interface ICreateWorkstationConfigRequest + * @property {string|null} [parent] CreateWorkstationConfigRequest parent + * @property {string|null} [workstationConfigId] CreateWorkstationConfigRequest workstationConfigId + * @property {google.cloud.workstations.v1.IWorkstationConfig|null} [workstationConfig] CreateWorkstationConfigRequest workstationConfig + * @property {boolean|null} [validateOnly] CreateWorkstationConfigRequest validateOnly + */ + + /** + * Constructs a new CreateWorkstationConfigRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a CreateWorkstationConfigRequest. + * @implements ICreateWorkstationConfigRequest + * @constructor + * @param {google.cloud.workstations.v1.ICreateWorkstationConfigRequest=} [properties] Properties to set + */ + function CreateWorkstationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateWorkstationConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.workstations.v1.CreateWorkstationConfigRequest + * @instance + */ + CreateWorkstationConfigRequest.prototype.parent = ""; + + /** + * CreateWorkstationConfigRequest workstationConfigId. + * @member {string} workstationConfigId + * @memberof google.cloud.workstations.v1.CreateWorkstationConfigRequest + * @instance + */ + CreateWorkstationConfigRequest.prototype.workstationConfigId = ""; + + /** + * CreateWorkstationConfigRequest workstationConfig. + * @member {google.cloud.workstations.v1.IWorkstationConfig|null|undefined} workstationConfig + * @memberof google.cloud.workstations.v1.CreateWorkstationConfigRequest + * @instance + */ + CreateWorkstationConfigRequest.prototype.workstationConfig = null; + + /** + * CreateWorkstationConfigRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.workstations.v1.CreateWorkstationConfigRequest + * @instance + */ + CreateWorkstationConfigRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateWorkstationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.CreateWorkstationConfigRequest + * @static + * @param {google.cloud.workstations.v1.ICreateWorkstationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.CreateWorkstationConfigRequest} CreateWorkstationConfigRequest instance + */ + CreateWorkstationConfigRequest.create = function create(properties) { + return new CreateWorkstationConfigRequest(properties); + }; + + /** + * Encodes the specified CreateWorkstationConfigRequest message. Does not implicitly {@link google.cloud.workstations.v1.CreateWorkstationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.CreateWorkstationConfigRequest + * @static + * @param {google.cloud.workstations.v1.ICreateWorkstationConfigRequest} message CreateWorkstationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkstationConfigRequest.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.workstationConfigId != null && Object.hasOwnProperty.call(message, "workstationConfigId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.workstationConfigId); + if (message.workstationConfig != null && Object.hasOwnProperty.call(message, "workstationConfig")) + $root.google.cloud.workstations.v1.WorkstationConfig.encode(message.workstationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateWorkstationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.CreateWorkstationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.CreateWorkstationConfigRequest + * @static + * @param {google.cloud.workstations.v1.ICreateWorkstationConfigRequest} message CreateWorkstationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkstationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateWorkstationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.CreateWorkstationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.CreateWorkstationConfigRequest} CreateWorkstationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkstationConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.CreateWorkstationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.workstationConfigId = reader.string(); + break; + } + case 3: { + message.workstationConfig = $root.google.cloud.workstations.v1.WorkstationConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateWorkstationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.CreateWorkstationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.CreateWorkstationConfigRequest} CreateWorkstationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkstationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateWorkstationConfigRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.CreateWorkstationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateWorkstationConfigRequest.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.workstationConfigId != null && message.hasOwnProperty("workstationConfigId")) + if (!$util.isString(message.workstationConfigId)) + return "workstationConfigId: string expected"; + if (message.workstationConfig != null && message.hasOwnProperty("workstationConfig")) { + var error = $root.google.cloud.workstations.v1.WorkstationConfig.verify(message.workstationConfig); + if (error) + return "workstationConfig." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateWorkstationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.CreateWorkstationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.CreateWorkstationConfigRequest} CreateWorkstationConfigRequest + */ + CreateWorkstationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.CreateWorkstationConfigRequest) + return object; + var message = new $root.google.cloud.workstations.v1.CreateWorkstationConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.workstationConfigId != null) + message.workstationConfigId = String(object.workstationConfigId); + if (object.workstationConfig != null) { + if (typeof object.workstationConfig !== "object") + throw TypeError(".google.cloud.workstations.v1.CreateWorkstationConfigRequest.workstationConfig: object expected"); + message.workstationConfig = $root.google.cloud.workstations.v1.WorkstationConfig.fromObject(object.workstationConfig); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateWorkstationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.CreateWorkstationConfigRequest + * @static + * @param {google.cloud.workstations.v1.CreateWorkstationConfigRequest} message CreateWorkstationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateWorkstationConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.workstationConfigId = ""; + object.workstationConfig = null; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.workstationConfigId != null && message.hasOwnProperty("workstationConfigId")) + object.workstationConfigId = message.workstationConfigId; + if (message.workstationConfig != null && message.hasOwnProperty("workstationConfig")) + object.workstationConfig = $root.google.cloud.workstations.v1.WorkstationConfig.toObject(message.workstationConfig, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateWorkstationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.CreateWorkstationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateWorkstationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateWorkstationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.CreateWorkstationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateWorkstationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.CreateWorkstationConfigRequest"; + }; + + return CreateWorkstationConfigRequest; + })(); + + v1.UpdateWorkstationConfigRequest = (function() { + + /** + * Properties of an UpdateWorkstationConfigRequest. + * @memberof google.cloud.workstations.v1 + * @interface IUpdateWorkstationConfigRequest + * @property {google.cloud.workstations.v1.IWorkstationConfig|null} [workstationConfig] UpdateWorkstationConfigRequest workstationConfig + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateWorkstationConfigRequest updateMask + * @property {boolean|null} [validateOnly] UpdateWorkstationConfigRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateWorkstationConfigRequest allowMissing + */ + + /** + * Constructs a new UpdateWorkstationConfigRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents an UpdateWorkstationConfigRequest. + * @implements IUpdateWorkstationConfigRequest + * @constructor + * @param {google.cloud.workstations.v1.IUpdateWorkstationConfigRequest=} [properties] Properties to set + */ + function UpdateWorkstationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateWorkstationConfigRequest workstationConfig. + * @member {google.cloud.workstations.v1.IWorkstationConfig|null|undefined} workstationConfig + * @memberof google.cloud.workstations.v1.UpdateWorkstationConfigRequest + * @instance + */ + UpdateWorkstationConfigRequest.prototype.workstationConfig = null; + + /** + * UpdateWorkstationConfigRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.workstations.v1.UpdateWorkstationConfigRequest + * @instance + */ + UpdateWorkstationConfigRequest.prototype.updateMask = null; + + /** + * UpdateWorkstationConfigRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.workstations.v1.UpdateWorkstationConfigRequest + * @instance + */ + UpdateWorkstationConfigRequest.prototype.validateOnly = false; + + /** + * UpdateWorkstationConfigRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.workstations.v1.UpdateWorkstationConfigRequest + * @instance + */ + UpdateWorkstationConfigRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateWorkstationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.UpdateWorkstationConfigRequest + * @static + * @param {google.cloud.workstations.v1.IUpdateWorkstationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.UpdateWorkstationConfigRequest} UpdateWorkstationConfigRequest instance + */ + UpdateWorkstationConfigRequest.create = function create(properties) { + return new UpdateWorkstationConfigRequest(properties); + }; + + /** + * Encodes the specified UpdateWorkstationConfigRequest message. Does not implicitly {@link google.cloud.workstations.v1.UpdateWorkstationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.UpdateWorkstationConfigRequest + * @static + * @param {google.cloud.workstations.v1.IUpdateWorkstationConfigRequest} message UpdateWorkstationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkstationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workstationConfig != null && Object.hasOwnProperty.call(message, "workstationConfig")) + $root.google.cloud.workstations.v1.WorkstationConfig.encode(message.workstationConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateWorkstationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.UpdateWorkstationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.UpdateWorkstationConfigRequest + * @static + * @param {google.cloud.workstations.v1.IUpdateWorkstationConfigRequest} message UpdateWorkstationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkstationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateWorkstationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.UpdateWorkstationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.UpdateWorkstationConfigRequest} UpdateWorkstationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkstationConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.UpdateWorkstationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.workstationConfig = $root.google.cloud.workstations.v1.WorkstationConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateWorkstationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.UpdateWorkstationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.UpdateWorkstationConfigRequest} UpdateWorkstationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkstationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateWorkstationConfigRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.UpdateWorkstationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateWorkstationConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workstationConfig != null && message.hasOwnProperty("workstationConfig")) { + var error = $root.google.cloud.workstations.v1.WorkstationConfig.verify(message.workstationConfig); + if (error) + return "workstationConfig." + 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"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateWorkstationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.UpdateWorkstationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.UpdateWorkstationConfigRequest} UpdateWorkstationConfigRequest + */ + UpdateWorkstationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.UpdateWorkstationConfigRequest) + return object; + var message = new $root.google.cloud.workstations.v1.UpdateWorkstationConfigRequest(); + if (object.workstationConfig != null) { + if (typeof object.workstationConfig !== "object") + throw TypeError(".google.cloud.workstations.v1.UpdateWorkstationConfigRequest.workstationConfig: object expected"); + message.workstationConfig = $root.google.cloud.workstations.v1.WorkstationConfig.fromObject(object.workstationConfig); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.workstations.v1.UpdateWorkstationConfigRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateWorkstationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.UpdateWorkstationConfigRequest + * @static + * @param {google.cloud.workstations.v1.UpdateWorkstationConfigRequest} message UpdateWorkstationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateWorkstationConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.workstationConfig = null; + object.updateMask = null; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.workstationConfig != null && message.hasOwnProperty("workstationConfig")) + object.workstationConfig = $root.google.cloud.workstations.v1.WorkstationConfig.toObject(message.workstationConfig, 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; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateWorkstationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.UpdateWorkstationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateWorkstationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateWorkstationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.UpdateWorkstationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateWorkstationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.UpdateWorkstationConfigRequest"; + }; + + return UpdateWorkstationConfigRequest; + })(); + + v1.DeleteWorkstationConfigRequest = (function() { + + /** + * Properties of a DeleteWorkstationConfigRequest. + * @memberof google.cloud.workstations.v1 + * @interface IDeleteWorkstationConfigRequest + * @property {string|null} [name] DeleteWorkstationConfigRequest name + * @property {boolean|null} [validateOnly] DeleteWorkstationConfigRequest validateOnly + * @property {string|null} [etag] DeleteWorkstationConfigRequest etag + * @property {boolean|null} [force] DeleteWorkstationConfigRequest force + */ + + /** + * Constructs a new DeleteWorkstationConfigRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a DeleteWorkstationConfigRequest. + * @implements IDeleteWorkstationConfigRequest + * @constructor + * @param {google.cloud.workstations.v1.IDeleteWorkstationConfigRequest=} [properties] Properties to set + */ + function DeleteWorkstationConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteWorkstationConfigRequest name. + * @member {string} name + * @memberof google.cloud.workstations.v1.DeleteWorkstationConfigRequest + * @instance + */ + DeleteWorkstationConfigRequest.prototype.name = ""; + + /** + * DeleteWorkstationConfigRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.workstations.v1.DeleteWorkstationConfigRequest + * @instance + */ + DeleteWorkstationConfigRequest.prototype.validateOnly = false; + + /** + * DeleteWorkstationConfigRequest etag. + * @member {string} etag + * @memberof google.cloud.workstations.v1.DeleteWorkstationConfigRequest + * @instance + */ + DeleteWorkstationConfigRequest.prototype.etag = ""; + + /** + * DeleteWorkstationConfigRequest force. + * @member {boolean} force + * @memberof google.cloud.workstations.v1.DeleteWorkstationConfigRequest + * @instance + */ + DeleteWorkstationConfigRequest.prototype.force = false; + + /** + * Creates a new DeleteWorkstationConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.DeleteWorkstationConfigRequest + * @static + * @param {google.cloud.workstations.v1.IDeleteWorkstationConfigRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.DeleteWorkstationConfigRequest} DeleteWorkstationConfigRequest instance + */ + DeleteWorkstationConfigRequest.create = function create(properties) { + return new DeleteWorkstationConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteWorkstationConfigRequest message. Does not implicitly {@link google.cloud.workstations.v1.DeleteWorkstationConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.DeleteWorkstationConfigRequest + * @static + * @param {google.cloud.workstations.v1.IDeleteWorkstationConfigRequest} message DeleteWorkstationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkstationConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteWorkstationConfigRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.DeleteWorkstationConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.DeleteWorkstationConfigRequest + * @static + * @param {google.cloud.workstations.v1.IDeleteWorkstationConfigRequest} message DeleteWorkstationConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkstationConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteWorkstationConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.DeleteWorkstationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.DeleteWorkstationConfigRequest} DeleteWorkstationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkstationConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.DeleteWorkstationConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteWorkstationConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.DeleteWorkstationConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.DeleteWorkstationConfigRequest} DeleteWorkstationConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkstationConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteWorkstationConfigRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.DeleteWorkstationConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteWorkstationConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteWorkstationConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.DeleteWorkstationConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.DeleteWorkstationConfigRequest} DeleteWorkstationConfigRequest + */ + DeleteWorkstationConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.DeleteWorkstationConfigRequest) + return object; + var message = new $root.google.cloud.workstations.v1.DeleteWorkstationConfigRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteWorkstationConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.DeleteWorkstationConfigRequest + * @static + * @param {google.cloud.workstations.v1.DeleteWorkstationConfigRequest} message DeleteWorkstationConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteWorkstationConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteWorkstationConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.DeleteWorkstationConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteWorkstationConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteWorkstationConfigRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.DeleteWorkstationConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteWorkstationConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.DeleteWorkstationConfigRequest"; + }; + + return DeleteWorkstationConfigRequest; + })(); + + v1.GetWorkstationRequest = (function() { + + /** + * Properties of a GetWorkstationRequest. + * @memberof google.cloud.workstations.v1 + * @interface IGetWorkstationRequest + * @property {string|null} [name] GetWorkstationRequest name + */ + + /** + * Constructs a new GetWorkstationRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a GetWorkstationRequest. + * @implements IGetWorkstationRequest + * @constructor + * @param {google.cloud.workstations.v1.IGetWorkstationRequest=} [properties] Properties to set + */ + function GetWorkstationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetWorkstationRequest name. + * @member {string} name + * @memberof google.cloud.workstations.v1.GetWorkstationRequest + * @instance + */ + GetWorkstationRequest.prototype.name = ""; + + /** + * Creates a new GetWorkstationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.GetWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.IGetWorkstationRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.GetWorkstationRequest} GetWorkstationRequest instance + */ + GetWorkstationRequest.create = function create(properties) { + return new GetWorkstationRequest(properties); + }; + + /** + * Encodes the specified GetWorkstationRequest message. Does not implicitly {@link google.cloud.workstations.v1.GetWorkstationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.GetWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.IGetWorkstationRequest} message GetWorkstationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkstationRequest.encode = function encode(message, writer) { + 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 GetWorkstationRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.GetWorkstationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.GetWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.IGetWorkstationRequest} message GetWorkstationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetWorkstationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetWorkstationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.GetWorkstationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.GetWorkstationRequest} GetWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkstationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.GetWorkstationRequest(); + 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 GetWorkstationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.GetWorkstationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.GetWorkstationRequest} GetWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetWorkstationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetWorkstationRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.GetWorkstationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetWorkstationRequest.verify = function verify(message) { + if (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 GetWorkstationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.GetWorkstationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.GetWorkstationRequest} GetWorkstationRequest + */ + GetWorkstationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.GetWorkstationRequest) + return object; + var message = new $root.google.cloud.workstations.v1.GetWorkstationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetWorkstationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.GetWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.GetWorkstationRequest} message GetWorkstationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetWorkstationRequest.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 GetWorkstationRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.GetWorkstationRequest + * @instance + * @returns {Object.} JSON object + */ + GetWorkstationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetWorkstationRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.GetWorkstationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetWorkstationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.GetWorkstationRequest"; + }; + + return GetWorkstationRequest; + })(); + + v1.ListWorkstationsRequest = (function() { + + /** + * Properties of a ListWorkstationsRequest. + * @memberof google.cloud.workstations.v1 + * @interface IListWorkstationsRequest + * @property {string|null} [parent] ListWorkstationsRequest parent + * @property {number|null} [pageSize] ListWorkstationsRequest pageSize + * @property {string|null} [pageToken] ListWorkstationsRequest pageToken + */ + + /** + * Constructs a new ListWorkstationsRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a ListWorkstationsRequest. + * @implements IListWorkstationsRequest + * @constructor + * @param {google.cloud.workstations.v1.IListWorkstationsRequest=} [properties] Properties to set + */ + function ListWorkstationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWorkstationsRequest parent. + * @member {string} parent + * @memberof google.cloud.workstations.v1.ListWorkstationsRequest + * @instance + */ + ListWorkstationsRequest.prototype.parent = ""; + + /** + * ListWorkstationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.workstations.v1.ListWorkstationsRequest + * @instance + */ + ListWorkstationsRequest.prototype.pageSize = 0; + + /** + * ListWorkstationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.workstations.v1.ListWorkstationsRequest + * @instance + */ + ListWorkstationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListWorkstationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.ListWorkstationsRequest + * @static + * @param {google.cloud.workstations.v1.IListWorkstationsRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.ListWorkstationsRequest} ListWorkstationsRequest instance + */ + ListWorkstationsRequest.create = function create(properties) { + return new ListWorkstationsRequest(properties); + }; + + /** + * Encodes the specified ListWorkstationsRequest message. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.ListWorkstationsRequest + * @static + * @param {google.cloud.workstations.v1.IListWorkstationsRequest} message ListWorkstationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkstationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListWorkstationsRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.ListWorkstationsRequest + * @static + * @param {google.cloud.workstations.v1.IListWorkstationsRequest} message ListWorkstationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkstationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWorkstationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.ListWorkstationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.ListWorkstationsRequest} ListWorkstationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkstationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.ListWorkstationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListWorkstationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.ListWorkstationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.ListWorkstationsRequest} ListWorkstationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkstationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWorkstationsRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.ListWorkstationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkstationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListWorkstationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.ListWorkstationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.ListWorkstationsRequest} ListWorkstationsRequest + */ + ListWorkstationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.ListWorkstationsRequest) + return object; + var message = new $root.google.cloud.workstations.v1.ListWorkstationsRequest(); + 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 ListWorkstationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.ListWorkstationsRequest + * @static + * @param {google.cloud.workstations.v1.ListWorkstationsRequest} message ListWorkstationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkstationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListWorkstationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.ListWorkstationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListWorkstationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListWorkstationsRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.ListWorkstationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWorkstationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.ListWorkstationsRequest"; + }; + + return ListWorkstationsRequest; + })(); + + v1.ListWorkstationsResponse = (function() { + + /** + * Properties of a ListWorkstationsResponse. + * @memberof google.cloud.workstations.v1 + * @interface IListWorkstationsResponse + * @property {Array.|null} [workstations] ListWorkstationsResponse workstations + * @property {string|null} [nextPageToken] ListWorkstationsResponse nextPageToken + * @property {Array.|null} [unreachable] ListWorkstationsResponse unreachable + */ + + /** + * Constructs a new ListWorkstationsResponse. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a ListWorkstationsResponse. + * @implements IListWorkstationsResponse + * @constructor + * @param {google.cloud.workstations.v1.IListWorkstationsResponse=} [properties] Properties to set + */ + function ListWorkstationsResponse(properties) { + this.workstations = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListWorkstationsResponse workstations. + * @member {Array.} workstations + * @memberof google.cloud.workstations.v1.ListWorkstationsResponse + * @instance + */ + ListWorkstationsResponse.prototype.workstations = $util.emptyArray; + + /** + * ListWorkstationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.workstations.v1.ListWorkstationsResponse + * @instance + */ + ListWorkstationsResponse.prototype.nextPageToken = ""; + + /** + * ListWorkstationsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.workstations.v1.ListWorkstationsResponse + * @instance + */ + ListWorkstationsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListWorkstationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.ListWorkstationsResponse + * @static + * @param {google.cloud.workstations.v1.IListWorkstationsResponse=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.ListWorkstationsResponse} ListWorkstationsResponse instance + */ + ListWorkstationsResponse.create = function create(properties) { + return new ListWorkstationsResponse(properties); + }; + + /** + * Encodes the specified ListWorkstationsResponse message. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.ListWorkstationsResponse + * @static + * @param {google.cloud.workstations.v1.IListWorkstationsResponse} message ListWorkstationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkstationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workstations != null && message.workstations.length) + for (var i = 0; i < message.workstations.length; ++i) + $root.google.cloud.workstations.v1.Workstation.encode(message.workstations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListWorkstationsResponse message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListWorkstationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.ListWorkstationsResponse + * @static + * @param {google.cloud.workstations.v1.IListWorkstationsResponse} message ListWorkstationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListWorkstationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListWorkstationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.ListWorkstationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.ListWorkstationsResponse} ListWorkstationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkstationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.ListWorkstationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.workstations && message.workstations.length)) + message.workstations = []; + message.workstations.push($root.google.cloud.workstations.v1.Workstation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListWorkstationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.ListWorkstationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.ListWorkstationsResponse} ListWorkstationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListWorkstationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListWorkstationsResponse message. + * @function verify + * @memberof google.cloud.workstations.v1.ListWorkstationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListWorkstationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workstations != null && message.hasOwnProperty("workstations")) { + if (!Array.isArray(message.workstations)) + return "workstations: array expected"; + for (var i = 0; i < message.workstations.length; ++i) { + var error = $root.google.cloud.workstations.v1.Workstation.verify(message.workstations[i]); + if (error) + return "workstations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListWorkstationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.ListWorkstationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.ListWorkstationsResponse} ListWorkstationsResponse + */ + ListWorkstationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.ListWorkstationsResponse) + return object; + var message = new $root.google.cloud.workstations.v1.ListWorkstationsResponse(); + if (object.workstations) { + if (!Array.isArray(object.workstations)) + throw TypeError(".google.cloud.workstations.v1.ListWorkstationsResponse.workstations: array expected"); + message.workstations = []; + for (var i = 0; i < object.workstations.length; ++i) { + if (typeof object.workstations[i] !== "object") + throw TypeError(".google.cloud.workstations.v1.ListWorkstationsResponse.workstations: object expected"); + message.workstations[i] = $root.google.cloud.workstations.v1.Workstation.fromObject(object.workstations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.workstations.v1.ListWorkstationsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListWorkstationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.ListWorkstationsResponse + * @static + * @param {google.cloud.workstations.v1.ListWorkstationsResponse} message ListWorkstationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListWorkstationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.workstations = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.workstations && message.workstations.length) { + object.workstations = []; + for (var j = 0; j < message.workstations.length; ++j) + object.workstations[j] = $root.google.cloud.workstations.v1.Workstation.toObject(message.workstations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListWorkstationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.ListWorkstationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListWorkstationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListWorkstationsResponse + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.ListWorkstationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListWorkstationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.ListWorkstationsResponse"; + }; + + return ListWorkstationsResponse; + })(); + + v1.ListUsableWorkstationsRequest = (function() { + + /** + * Properties of a ListUsableWorkstationsRequest. + * @memberof google.cloud.workstations.v1 + * @interface IListUsableWorkstationsRequest + * @property {string|null} [parent] ListUsableWorkstationsRequest parent + * @property {number|null} [pageSize] ListUsableWorkstationsRequest pageSize + * @property {string|null} [pageToken] ListUsableWorkstationsRequest pageToken + */ + + /** + * Constructs a new ListUsableWorkstationsRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a ListUsableWorkstationsRequest. + * @implements IListUsableWorkstationsRequest + * @constructor + * @param {google.cloud.workstations.v1.IListUsableWorkstationsRequest=} [properties] Properties to set + */ + function ListUsableWorkstationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUsableWorkstationsRequest parent. + * @member {string} parent + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsRequest + * @instance + */ + ListUsableWorkstationsRequest.prototype.parent = ""; + + /** + * ListUsableWorkstationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsRequest + * @instance + */ + ListUsableWorkstationsRequest.prototype.pageSize = 0; + + /** + * ListUsableWorkstationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsRequest + * @instance + */ + ListUsableWorkstationsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListUsableWorkstationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsRequest + * @static + * @param {google.cloud.workstations.v1.IListUsableWorkstationsRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.ListUsableWorkstationsRequest} ListUsableWorkstationsRequest instance + */ + ListUsableWorkstationsRequest.create = function create(properties) { + return new ListUsableWorkstationsRequest(properties); + }; + + /** + * Encodes the specified ListUsableWorkstationsRequest message. Does not implicitly {@link google.cloud.workstations.v1.ListUsableWorkstationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsRequest + * @static + * @param {google.cloud.workstations.v1.IListUsableWorkstationsRequest} message ListUsableWorkstationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsableWorkstationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListUsableWorkstationsRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListUsableWorkstationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsRequest + * @static + * @param {google.cloud.workstations.v1.IListUsableWorkstationsRequest} message ListUsableWorkstationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsableWorkstationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUsableWorkstationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.ListUsableWorkstationsRequest} ListUsableWorkstationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsableWorkstationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.ListUsableWorkstationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUsableWorkstationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.ListUsableWorkstationsRequest} ListUsableWorkstationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsableWorkstationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUsableWorkstationsRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUsableWorkstationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListUsableWorkstationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.ListUsableWorkstationsRequest} ListUsableWorkstationsRequest + */ + ListUsableWorkstationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.ListUsableWorkstationsRequest) + return object; + var message = new $root.google.cloud.workstations.v1.ListUsableWorkstationsRequest(); + 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 ListUsableWorkstationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsRequest + * @static + * @param {google.cloud.workstations.v1.ListUsableWorkstationsRequest} message ListUsableWorkstationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUsableWorkstationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListUsableWorkstationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListUsableWorkstationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUsableWorkstationsRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUsableWorkstationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.ListUsableWorkstationsRequest"; + }; + + return ListUsableWorkstationsRequest; + })(); + + v1.ListUsableWorkstationsResponse = (function() { + + /** + * Properties of a ListUsableWorkstationsResponse. + * @memberof google.cloud.workstations.v1 + * @interface IListUsableWorkstationsResponse + * @property {Array.|null} [workstations] ListUsableWorkstationsResponse workstations + * @property {string|null} [nextPageToken] ListUsableWorkstationsResponse nextPageToken + * @property {Array.|null} [unreachable] ListUsableWorkstationsResponse unreachable + */ + + /** + * Constructs a new ListUsableWorkstationsResponse. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a ListUsableWorkstationsResponse. + * @implements IListUsableWorkstationsResponse + * @constructor + * @param {google.cloud.workstations.v1.IListUsableWorkstationsResponse=} [properties] Properties to set + */ + function ListUsableWorkstationsResponse(properties) { + this.workstations = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListUsableWorkstationsResponse workstations. + * @member {Array.} workstations + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsResponse + * @instance + */ + ListUsableWorkstationsResponse.prototype.workstations = $util.emptyArray; + + /** + * ListUsableWorkstationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsResponse + * @instance + */ + ListUsableWorkstationsResponse.prototype.nextPageToken = ""; + + /** + * ListUsableWorkstationsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsResponse + * @instance + */ + ListUsableWorkstationsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListUsableWorkstationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsResponse + * @static + * @param {google.cloud.workstations.v1.IListUsableWorkstationsResponse=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.ListUsableWorkstationsResponse} ListUsableWorkstationsResponse instance + */ + ListUsableWorkstationsResponse.create = function create(properties) { + return new ListUsableWorkstationsResponse(properties); + }; + + /** + * Encodes the specified ListUsableWorkstationsResponse message. Does not implicitly {@link google.cloud.workstations.v1.ListUsableWorkstationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsResponse + * @static + * @param {google.cloud.workstations.v1.IListUsableWorkstationsResponse} message ListUsableWorkstationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsableWorkstationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workstations != null && message.workstations.length) + for (var i = 0; i < message.workstations.length; ++i) + $root.google.cloud.workstations.v1.Workstation.encode(message.workstations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListUsableWorkstationsResponse message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.ListUsableWorkstationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsResponse + * @static + * @param {google.cloud.workstations.v1.IListUsableWorkstationsResponse} message ListUsableWorkstationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListUsableWorkstationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListUsableWorkstationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.ListUsableWorkstationsResponse} ListUsableWorkstationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsableWorkstationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.ListUsableWorkstationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.workstations && message.workstations.length)) + message.workstations = []; + message.workstations.push($root.google.cloud.workstations.v1.Workstation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListUsableWorkstationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.ListUsableWorkstationsResponse} ListUsableWorkstationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListUsableWorkstationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListUsableWorkstationsResponse message. + * @function verify + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListUsableWorkstationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workstations != null && message.hasOwnProperty("workstations")) { + if (!Array.isArray(message.workstations)) + return "workstations: array expected"; + for (var i = 0; i < message.workstations.length; ++i) { + var error = $root.google.cloud.workstations.v1.Workstation.verify(message.workstations[i]); + if (error) + return "workstations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListUsableWorkstationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.ListUsableWorkstationsResponse} ListUsableWorkstationsResponse + */ + ListUsableWorkstationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.ListUsableWorkstationsResponse) + return object; + var message = new $root.google.cloud.workstations.v1.ListUsableWorkstationsResponse(); + if (object.workstations) { + if (!Array.isArray(object.workstations)) + throw TypeError(".google.cloud.workstations.v1.ListUsableWorkstationsResponse.workstations: array expected"); + message.workstations = []; + for (var i = 0; i < object.workstations.length; ++i) { + if (typeof object.workstations[i] !== "object") + throw TypeError(".google.cloud.workstations.v1.ListUsableWorkstationsResponse.workstations: object expected"); + message.workstations[i] = $root.google.cloud.workstations.v1.Workstation.fromObject(object.workstations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.workstations.v1.ListUsableWorkstationsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListUsableWorkstationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsResponse + * @static + * @param {google.cloud.workstations.v1.ListUsableWorkstationsResponse} message ListUsableWorkstationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListUsableWorkstationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.workstations = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.workstations && message.workstations.length) { + object.workstations = []; + for (var j = 0; j < message.workstations.length; ++j) + object.workstations[j] = $root.google.cloud.workstations.v1.Workstation.toObject(message.workstations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListUsableWorkstationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListUsableWorkstationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListUsableWorkstationsResponse + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.ListUsableWorkstationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListUsableWorkstationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.ListUsableWorkstationsResponse"; + }; + + return ListUsableWorkstationsResponse; + })(); + + v1.CreateWorkstationRequest = (function() { + + /** + * Properties of a CreateWorkstationRequest. + * @memberof google.cloud.workstations.v1 + * @interface ICreateWorkstationRequest + * @property {string|null} [parent] CreateWorkstationRequest parent + * @property {string|null} [workstationId] CreateWorkstationRequest workstationId + * @property {google.cloud.workstations.v1.IWorkstation|null} [workstation] CreateWorkstationRequest workstation + * @property {boolean|null} [validateOnly] CreateWorkstationRequest validateOnly + */ + + /** + * Constructs a new CreateWorkstationRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a CreateWorkstationRequest. + * @implements ICreateWorkstationRequest + * @constructor + * @param {google.cloud.workstations.v1.ICreateWorkstationRequest=} [properties] Properties to set + */ + function CreateWorkstationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateWorkstationRequest parent. + * @member {string} parent + * @memberof google.cloud.workstations.v1.CreateWorkstationRequest + * @instance + */ + CreateWorkstationRequest.prototype.parent = ""; + + /** + * CreateWorkstationRequest workstationId. + * @member {string} workstationId + * @memberof google.cloud.workstations.v1.CreateWorkstationRequest + * @instance + */ + CreateWorkstationRequest.prototype.workstationId = ""; + + /** + * CreateWorkstationRequest workstation. + * @member {google.cloud.workstations.v1.IWorkstation|null|undefined} workstation + * @memberof google.cloud.workstations.v1.CreateWorkstationRequest + * @instance + */ + CreateWorkstationRequest.prototype.workstation = null; + + /** + * CreateWorkstationRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.workstations.v1.CreateWorkstationRequest + * @instance + */ + CreateWorkstationRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateWorkstationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.CreateWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.ICreateWorkstationRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.CreateWorkstationRequest} CreateWorkstationRequest instance + */ + CreateWorkstationRequest.create = function create(properties) { + return new CreateWorkstationRequest(properties); + }; + + /** + * Encodes the specified CreateWorkstationRequest message. Does not implicitly {@link google.cloud.workstations.v1.CreateWorkstationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.CreateWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.ICreateWorkstationRequest} message CreateWorkstationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkstationRequest.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.workstationId != null && Object.hasOwnProperty.call(message, "workstationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.workstationId); + if (message.workstation != null && Object.hasOwnProperty.call(message, "workstation")) + $root.google.cloud.workstations.v1.Workstation.encode(message.workstation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateWorkstationRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.CreateWorkstationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.CreateWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.ICreateWorkstationRequest} message CreateWorkstationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateWorkstationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateWorkstationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.CreateWorkstationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.CreateWorkstationRequest} CreateWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkstationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.CreateWorkstationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.workstationId = reader.string(); + break; + } + case 3: { + message.workstation = $root.google.cloud.workstations.v1.Workstation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateWorkstationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.CreateWorkstationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.CreateWorkstationRequest} CreateWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateWorkstationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateWorkstationRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.CreateWorkstationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateWorkstationRequest.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.workstationId != null && message.hasOwnProperty("workstationId")) + if (!$util.isString(message.workstationId)) + return "workstationId: string expected"; + if (message.workstation != null && message.hasOwnProperty("workstation")) { + var error = $root.google.cloud.workstations.v1.Workstation.verify(message.workstation); + if (error) + return "workstation." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateWorkstationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.CreateWorkstationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.CreateWorkstationRequest} CreateWorkstationRequest + */ + CreateWorkstationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.CreateWorkstationRequest) + return object; + var message = new $root.google.cloud.workstations.v1.CreateWorkstationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.workstationId != null) + message.workstationId = String(object.workstationId); + if (object.workstation != null) { + if (typeof object.workstation !== "object") + throw TypeError(".google.cloud.workstations.v1.CreateWorkstationRequest.workstation: object expected"); + message.workstation = $root.google.cloud.workstations.v1.Workstation.fromObject(object.workstation); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateWorkstationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.CreateWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.CreateWorkstationRequest} message CreateWorkstationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateWorkstationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.workstationId = ""; + object.workstation = null; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.workstationId != null && message.hasOwnProperty("workstationId")) + object.workstationId = message.workstationId; + if (message.workstation != null && message.hasOwnProperty("workstation")) + object.workstation = $root.google.cloud.workstations.v1.Workstation.toObject(message.workstation, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateWorkstationRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.CreateWorkstationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateWorkstationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateWorkstationRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.CreateWorkstationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateWorkstationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.CreateWorkstationRequest"; + }; + + return CreateWorkstationRequest; + })(); + + v1.UpdateWorkstationRequest = (function() { + + /** + * Properties of an UpdateWorkstationRequest. + * @memberof google.cloud.workstations.v1 + * @interface IUpdateWorkstationRequest + * @property {google.cloud.workstations.v1.IWorkstation|null} [workstation] UpdateWorkstationRequest workstation + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateWorkstationRequest updateMask + * @property {boolean|null} [validateOnly] UpdateWorkstationRequest validateOnly + * @property {boolean|null} [allowMissing] UpdateWorkstationRequest allowMissing + */ + + /** + * Constructs a new UpdateWorkstationRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents an UpdateWorkstationRequest. + * @implements IUpdateWorkstationRequest + * @constructor + * @param {google.cloud.workstations.v1.IUpdateWorkstationRequest=} [properties] Properties to set + */ + function UpdateWorkstationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateWorkstationRequest workstation. + * @member {google.cloud.workstations.v1.IWorkstation|null|undefined} workstation + * @memberof google.cloud.workstations.v1.UpdateWorkstationRequest + * @instance + */ + UpdateWorkstationRequest.prototype.workstation = null; + + /** + * UpdateWorkstationRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.workstations.v1.UpdateWorkstationRequest + * @instance + */ + UpdateWorkstationRequest.prototype.updateMask = null; + + /** + * UpdateWorkstationRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.workstations.v1.UpdateWorkstationRequest + * @instance + */ + UpdateWorkstationRequest.prototype.validateOnly = false; + + /** + * UpdateWorkstationRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.workstations.v1.UpdateWorkstationRequest + * @instance + */ + UpdateWorkstationRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateWorkstationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.UpdateWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.IUpdateWorkstationRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.UpdateWorkstationRequest} UpdateWorkstationRequest instance + */ + UpdateWorkstationRequest.create = function create(properties) { + return new UpdateWorkstationRequest(properties); + }; + + /** + * Encodes the specified UpdateWorkstationRequest message. Does not implicitly {@link google.cloud.workstations.v1.UpdateWorkstationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.UpdateWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.IUpdateWorkstationRequest} message UpdateWorkstationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkstationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workstation != null && Object.hasOwnProperty.call(message, "workstation")) + $root.google.cloud.workstations.v1.Workstation.encode(message.workstation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateWorkstationRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.UpdateWorkstationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.UpdateWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.IUpdateWorkstationRequest} message UpdateWorkstationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateWorkstationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateWorkstationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.UpdateWorkstationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.UpdateWorkstationRequest} UpdateWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkstationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.UpdateWorkstationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.workstation = $root.google.cloud.workstations.v1.Workstation.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateWorkstationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.UpdateWorkstationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.UpdateWorkstationRequest} UpdateWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateWorkstationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateWorkstationRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.UpdateWorkstationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateWorkstationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workstation != null && message.hasOwnProperty("workstation")) { + var error = $root.google.cloud.workstations.v1.Workstation.verify(message.workstation); + if (error) + return "workstation." + 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"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateWorkstationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.UpdateWorkstationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.UpdateWorkstationRequest} UpdateWorkstationRequest + */ + UpdateWorkstationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.UpdateWorkstationRequest) + return object; + var message = new $root.google.cloud.workstations.v1.UpdateWorkstationRequest(); + if (object.workstation != null) { + if (typeof object.workstation !== "object") + throw TypeError(".google.cloud.workstations.v1.UpdateWorkstationRequest.workstation: object expected"); + message.workstation = $root.google.cloud.workstations.v1.Workstation.fromObject(object.workstation); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.workstations.v1.UpdateWorkstationRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateWorkstationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.UpdateWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.UpdateWorkstationRequest} message UpdateWorkstationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateWorkstationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.workstation = null; + object.updateMask = null; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.workstation != null && message.hasOwnProperty("workstation")) + object.workstation = $root.google.cloud.workstations.v1.Workstation.toObject(message.workstation, 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; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateWorkstationRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.UpdateWorkstationRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateWorkstationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateWorkstationRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.UpdateWorkstationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateWorkstationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.UpdateWorkstationRequest"; + }; + + return UpdateWorkstationRequest; + })(); + + v1.DeleteWorkstationRequest = (function() { + + /** + * Properties of a DeleteWorkstationRequest. + * @memberof google.cloud.workstations.v1 + * @interface IDeleteWorkstationRequest + * @property {string|null} [name] DeleteWorkstationRequest name + * @property {boolean|null} [validateOnly] DeleteWorkstationRequest validateOnly + * @property {string|null} [etag] DeleteWorkstationRequest etag + */ + + /** + * Constructs a new DeleteWorkstationRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a DeleteWorkstationRequest. + * @implements IDeleteWorkstationRequest + * @constructor + * @param {google.cloud.workstations.v1.IDeleteWorkstationRequest=} [properties] Properties to set + */ + function DeleteWorkstationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteWorkstationRequest name. + * @member {string} name + * @memberof google.cloud.workstations.v1.DeleteWorkstationRequest + * @instance + */ + DeleteWorkstationRequest.prototype.name = ""; + + /** + * DeleteWorkstationRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.workstations.v1.DeleteWorkstationRequest + * @instance + */ + DeleteWorkstationRequest.prototype.validateOnly = false; + + /** + * DeleteWorkstationRequest etag. + * @member {string} etag + * @memberof google.cloud.workstations.v1.DeleteWorkstationRequest + * @instance + */ + DeleteWorkstationRequest.prototype.etag = ""; + + /** + * Creates a new DeleteWorkstationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.DeleteWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.IDeleteWorkstationRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.DeleteWorkstationRequest} DeleteWorkstationRequest instance + */ + DeleteWorkstationRequest.create = function create(properties) { + return new DeleteWorkstationRequest(properties); + }; + + /** + * Encodes the specified DeleteWorkstationRequest message. Does not implicitly {@link google.cloud.workstations.v1.DeleteWorkstationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.DeleteWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.IDeleteWorkstationRequest} message DeleteWorkstationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkstationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteWorkstationRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.DeleteWorkstationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.DeleteWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.IDeleteWorkstationRequest} message DeleteWorkstationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteWorkstationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteWorkstationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.DeleteWorkstationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.DeleteWorkstationRequest} DeleteWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkstationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.DeleteWorkstationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteWorkstationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.DeleteWorkstationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.DeleteWorkstationRequest} DeleteWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteWorkstationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteWorkstationRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.DeleteWorkstationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteWorkstationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteWorkstationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.DeleteWorkstationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.DeleteWorkstationRequest} DeleteWorkstationRequest + */ + DeleteWorkstationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.DeleteWorkstationRequest) + return object; + var message = new $root.google.cloud.workstations.v1.DeleteWorkstationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteWorkstationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.DeleteWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.DeleteWorkstationRequest} message DeleteWorkstationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteWorkstationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteWorkstationRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.DeleteWorkstationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteWorkstationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteWorkstationRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.DeleteWorkstationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteWorkstationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.DeleteWorkstationRequest"; + }; + + return DeleteWorkstationRequest; + })(); + + v1.StartWorkstationRequest = (function() { + + /** + * Properties of a StartWorkstationRequest. + * @memberof google.cloud.workstations.v1 + * @interface IStartWorkstationRequest + * @property {string|null} [name] StartWorkstationRequest name + * @property {boolean|null} [validateOnly] StartWorkstationRequest validateOnly + * @property {string|null} [etag] StartWorkstationRequest etag + */ + + /** + * Constructs a new StartWorkstationRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a StartWorkstationRequest. + * @implements IStartWorkstationRequest + * @constructor + * @param {google.cloud.workstations.v1.IStartWorkstationRequest=} [properties] Properties to set + */ + function StartWorkstationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StartWorkstationRequest name. + * @member {string} name + * @memberof google.cloud.workstations.v1.StartWorkstationRequest + * @instance + */ + StartWorkstationRequest.prototype.name = ""; + + /** + * StartWorkstationRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.workstations.v1.StartWorkstationRequest + * @instance + */ + StartWorkstationRequest.prototype.validateOnly = false; + + /** + * StartWorkstationRequest etag. + * @member {string} etag + * @memberof google.cloud.workstations.v1.StartWorkstationRequest + * @instance + */ + StartWorkstationRequest.prototype.etag = ""; + + /** + * Creates a new StartWorkstationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.StartWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.IStartWorkstationRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.StartWorkstationRequest} StartWorkstationRequest instance + */ + StartWorkstationRequest.create = function create(properties) { + return new StartWorkstationRequest(properties); + }; + + /** + * Encodes the specified StartWorkstationRequest message. Does not implicitly {@link google.cloud.workstations.v1.StartWorkstationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.StartWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.IStartWorkstationRequest} message StartWorkstationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartWorkstationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified StartWorkstationRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.StartWorkstationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.StartWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.IStartWorkstationRequest} message StartWorkstationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StartWorkstationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StartWorkstationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.StartWorkstationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.StartWorkstationRequest} StartWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartWorkstationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.StartWorkstationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StartWorkstationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.StartWorkstationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.StartWorkstationRequest} StartWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StartWorkstationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StartWorkstationRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.StartWorkstationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StartWorkstationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a StartWorkstationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.StartWorkstationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.StartWorkstationRequest} StartWorkstationRequest + */ + StartWorkstationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.StartWorkstationRequest) + return object; + var message = new $root.google.cloud.workstations.v1.StartWorkstationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a StartWorkstationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.StartWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.StartWorkstationRequest} message StartWorkstationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StartWorkstationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this StartWorkstationRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.StartWorkstationRequest + * @instance + * @returns {Object.} JSON object + */ + StartWorkstationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StartWorkstationRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.StartWorkstationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StartWorkstationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.StartWorkstationRequest"; + }; + + return StartWorkstationRequest; + })(); + + v1.StopWorkstationRequest = (function() { + + /** + * Properties of a StopWorkstationRequest. + * @memberof google.cloud.workstations.v1 + * @interface IStopWorkstationRequest + * @property {string|null} [name] StopWorkstationRequest name + * @property {boolean|null} [validateOnly] StopWorkstationRequest validateOnly + * @property {string|null} [etag] StopWorkstationRequest etag + */ + + /** + * Constructs a new StopWorkstationRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a StopWorkstationRequest. + * @implements IStopWorkstationRequest + * @constructor + * @param {google.cloud.workstations.v1.IStopWorkstationRequest=} [properties] Properties to set + */ + function StopWorkstationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StopWorkstationRequest name. + * @member {string} name + * @memberof google.cloud.workstations.v1.StopWorkstationRequest + * @instance + */ + StopWorkstationRequest.prototype.name = ""; + + /** + * StopWorkstationRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.workstations.v1.StopWorkstationRequest + * @instance + */ + StopWorkstationRequest.prototype.validateOnly = false; + + /** + * StopWorkstationRequest etag. + * @member {string} etag + * @memberof google.cloud.workstations.v1.StopWorkstationRequest + * @instance + */ + StopWorkstationRequest.prototype.etag = ""; + + /** + * Creates a new StopWorkstationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.StopWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.IStopWorkstationRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.StopWorkstationRequest} StopWorkstationRequest instance + */ + StopWorkstationRequest.create = function create(properties) { + return new StopWorkstationRequest(properties); + }; + + /** + * Encodes the specified StopWorkstationRequest message. Does not implicitly {@link google.cloud.workstations.v1.StopWorkstationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.StopWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.IStopWorkstationRequest} message StopWorkstationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopWorkstationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.validateOnly); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified StopWorkstationRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.StopWorkstationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.StopWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.IStopWorkstationRequest} message StopWorkstationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StopWorkstationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StopWorkstationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.StopWorkstationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.StopWorkstationRequest} StopWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopWorkstationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.StopWorkstationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.validateOnly = reader.bool(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StopWorkstationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.StopWorkstationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.StopWorkstationRequest} StopWorkstationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StopWorkstationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StopWorkstationRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.StopWorkstationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StopWorkstationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a StopWorkstationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.StopWorkstationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.StopWorkstationRequest} StopWorkstationRequest + */ + StopWorkstationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.StopWorkstationRequest) + return object; + var message = new $root.google.cloud.workstations.v1.StopWorkstationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a StopWorkstationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.StopWorkstationRequest + * @static + * @param {google.cloud.workstations.v1.StopWorkstationRequest} message StopWorkstationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StopWorkstationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.validateOnly = false; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this StopWorkstationRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.StopWorkstationRequest + * @instance + * @returns {Object.} JSON object + */ + StopWorkstationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StopWorkstationRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.StopWorkstationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StopWorkstationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.StopWorkstationRequest"; + }; + + return StopWorkstationRequest; + })(); + + v1.GenerateAccessTokenRequest = (function() { + + /** + * Properties of a GenerateAccessTokenRequest. + * @memberof google.cloud.workstations.v1 + * @interface IGenerateAccessTokenRequest + * @property {google.protobuf.ITimestamp|null} [expireTime] GenerateAccessTokenRequest expireTime + * @property {google.protobuf.IDuration|null} [ttl] GenerateAccessTokenRequest ttl + * @property {string|null} [workstation] GenerateAccessTokenRequest workstation + */ + + /** + * Constructs a new GenerateAccessTokenRequest. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a GenerateAccessTokenRequest. + * @implements IGenerateAccessTokenRequest + * @constructor + * @param {google.cloud.workstations.v1.IGenerateAccessTokenRequest=} [properties] Properties to set + */ + function GenerateAccessTokenRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateAccessTokenRequest expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.workstations.v1.GenerateAccessTokenRequest + * @instance + */ + GenerateAccessTokenRequest.prototype.expireTime = null; + + /** + * GenerateAccessTokenRequest ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.cloud.workstations.v1.GenerateAccessTokenRequest + * @instance + */ + GenerateAccessTokenRequest.prototype.ttl = null; + + /** + * GenerateAccessTokenRequest workstation. + * @member {string} workstation + * @memberof google.cloud.workstations.v1.GenerateAccessTokenRequest + * @instance + */ + GenerateAccessTokenRequest.prototype.workstation = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GenerateAccessTokenRequest expiration. + * @member {"expireTime"|"ttl"|undefined} expiration + * @memberof google.cloud.workstations.v1.GenerateAccessTokenRequest + * @instance + */ + Object.defineProperty(GenerateAccessTokenRequest.prototype, "expiration", { + get: $util.oneOfGetter($oneOfFields = ["expireTime", "ttl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenerateAccessTokenRequest instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.GenerateAccessTokenRequest + * @static + * @param {google.cloud.workstations.v1.IGenerateAccessTokenRequest=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.GenerateAccessTokenRequest} GenerateAccessTokenRequest instance + */ + GenerateAccessTokenRequest.create = function create(properties) { + return new GenerateAccessTokenRequest(properties); + }; + + /** + * Encodes the specified GenerateAccessTokenRequest message. Does not implicitly {@link google.cloud.workstations.v1.GenerateAccessTokenRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.GenerateAccessTokenRequest + * @static + * @param {google.cloud.workstations.v1.IGenerateAccessTokenRequest} message GenerateAccessTokenRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAccessTokenRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workstation != null && Object.hasOwnProperty.call(message, "workstation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.workstation); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ttl != null && Object.hasOwnProperty.call(message, "ttl")) + $root.google.protobuf.Duration.encode(message.ttl, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateAccessTokenRequest message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.GenerateAccessTokenRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.GenerateAccessTokenRequest + * @static + * @param {google.cloud.workstations.v1.IGenerateAccessTokenRequest} message GenerateAccessTokenRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAccessTokenRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateAccessTokenRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.GenerateAccessTokenRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.GenerateAccessTokenRequest} GenerateAccessTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAccessTokenRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.GenerateAccessTokenRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.ttl = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 1: { + message.workstation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateAccessTokenRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.GenerateAccessTokenRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.GenerateAccessTokenRequest} GenerateAccessTokenRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAccessTokenRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateAccessTokenRequest message. + * @function verify + * @memberof google.cloud.workstations.v1.GenerateAccessTokenRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateAccessTokenRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + properties.expiration = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + if (properties.expiration === 1) + return "expiration: multiple values"; + properties.expiration = 1; + { + var error = $root.google.protobuf.Duration.verify(message.ttl); + if (error) + return "ttl." + error; + } + } + if (message.workstation != null && message.hasOwnProperty("workstation")) + if (!$util.isString(message.workstation)) + return "workstation: string expected"; + return null; + }; + + /** + * Creates a GenerateAccessTokenRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.GenerateAccessTokenRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.GenerateAccessTokenRequest} GenerateAccessTokenRequest + */ + GenerateAccessTokenRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.GenerateAccessTokenRequest) + return object; + var message = new $root.google.cloud.workstations.v1.GenerateAccessTokenRequest(); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.workstations.v1.GenerateAccessTokenRequest.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.ttl != null) { + if (typeof object.ttl !== "object") + throw TypeError(".google.cloud.workstations.v1.GenerateAccessTokenRequest.ttl: object expected"); + message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); + } + if (object.workstation != null) + message.workstation = String(object.workstation); + return message; + }; + + /** + * Creates a plain object from a GenerateAccessTokenRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.GenerateAccessTokenRequest + * @static + * @param {google.cloud.workstations.v1.GenerateAccessTokenRequest} message GenerateAccessTokenRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateAccessTokenRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.workstation = ""; + if (message.workstation != null && message.hasOwnProperty("workstation")) + object.workstation = message.workstation; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (options.oneofs) + object.expiration = "expireTime"; + } + if (message.ttl != null && message.hasOwnProperty("ttl")) { + object.ttl = $root.google.protobuf.Duration.toObject(message.ttl, options); + if (options.oneofs) + object.expiration = "ttl"; + } + return object; + }; + + /** + * Converts this GenerateAccessTokenRequest to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.GenerateAccessTokenRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateAccessTokenRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateAccessTokenRequest + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.GenerateAccessTokenRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateAccessTokenRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.GenerateAccessTokenRequest"; + }; + + return GenerateAccessTokenRequest; + })(); + + v1.GenerateAccessTokenResponse = (function() { + + /** + * Properties of a GenerateAccessTokenResponse. + * @memberof google.cloud.workstations.v1 + * @interface IGenerateAccessTokenResponse + * @property {string|null} [accessToken] GenerateAccessTokenResponse accessToken + * @property {google.protobuf.ITimestamp|null} [expireTime] GenerateAccessTokenResponse expireTime + */ + + /** + * Constructs a new GenerateAccessTokenResponse. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents a GenerateAccessTokenResponse. + * @implements IGenerateAccessTokenResponse + * @constructor + * @param {google.cloud.workstations.v1.IGenerateAccessTokenResponse=} [properties] Properties to set + */ + function GenerateAccessTokenResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateAccessTokenResponse accessToken. + * @member {string} accessToken + * @memberof google.cloud.workstations.v1.GenerateAccessTokenResponse + * @instance + */ + GenerateAccessTokenResponse.prototype.accessToken = ""; + + /** + * GenerateAccessTokenResponse expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.workstations.v1.GenerateAccessTokenResponse + * @instance + */ + GenerateAccessTokenResponse.prototype.expireTime = null; + + /** + * Creates a new GenerateAccessTokenResponse instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.GenerateAccessTokenResponse + * @static + * @param {google.cloud.workstations.v1.IGenerateAccessTokenResponse=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.GenerateAccessTokenResponse} GenerateAccessTokenResponse instance + */ + GenerateAccessTokenResponse.create = function create(properties) { + return new GenerateAccessTokenResponse(properties); + }; + + /** + * Encodes the specified GenerateAccessTokenResponse message. Does not implicitly {@link google.cloud.workstations.v1.GenerateAccessTokenResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.GenerateAccessTokenResponse + * @static + * @param {google.cloud.workstations.v1.IGenerateAccessTokenResponse} message GenerateAccessTokenResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAccessTokenResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accessToken != null && Object.hasOwnProperty.call(message, "accessToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.accessToken); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateAccessTokenResponse message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.GenerateAccessTokenResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.GenerateAccessTokenResponse + * @static + * @param {google.cloud.workstations.v1.IGenerateAccessTokenResponse} message GenerateAccessTokenResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAccessTokenResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateAccessTokenResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.GenerateAccessTokenResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.GenerateAccessTokenResponse} GenerateAccessTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAccessTokenResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.GenerateAccessTokenResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.accessToken = reader.string(); + break; + } + case 2: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateAccessTokenResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.GenerateAccessTokenResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.GenerateAccessTokenResponse} GenerateAccessTokenResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAccessTokenResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateAccessTokenResponse message. + * @function verify + * @memberof google.cloud.workstations.v1.GenerateAccessTokenResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateAccessTokenResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accessToken != null && message.hasOwnProperty("accessToken")) + if (!$util.isString(message.accessToken)) + return "accessToken: string expected"; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + return null; + }; + + /** + * Creates a GenerateAccessTokenResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.GenerateAccessTokenResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.GenerateAccessTokenResponse} GenerateAccessTokenResponse + */ + GenerateAccessTokenResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.GenerateAccessTokenResponse) + return object; + var message = new $root.google.cloud.workstations.v1.GenerateAccessTokenResponse(); + if (object.accessToken != null) + message.accessToken = String(object.accessToken); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.workstations.v1.GenerateAccessTokenResponse.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + return message; + }; + + /** + * Creates a plain object from a GenerateAccessTokenResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.GenerateAccessTokenResponse + * @static + * @param {google.cloud.workstations.v1.GenerateAccessTokenResponse} message GenerateAccessTokenResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateAccessTokenResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.accessToken = ""; + object.expireTime = null; + } + if (message.accessToken != null && message.hasOwnProperty("accessToken")) + object.accessToken = message.accessToken; + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + return object; + }; + + /** + * Converts this GenerateAccessTokenResponse to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.GenerateAccessTokenResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateAccessTokenResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateAccessTokenResponse + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.GenerateAccessTokenResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateAccessTokenResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.GenerateAccessTokenResponse"; + }; + + return GenerateAccessTokenResponse; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.workstations.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.workstations.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.workstations.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.workstations.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.workstations.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.workstations.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.workstations.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.workstations.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.workstations.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.workstations.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.workstations.v1.OperationMetadata + * @static + * @param {google.cloud.workstations.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.workstations.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.workstations.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.workstations.v1.OperationMetadata + * @static + * @param {google.cloud.workstations.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.workstations.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.workstations.v1.OperationMetadata + * @static + * @param {google.cloud.workstations.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.workstations.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.workstations.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.workstations.v1.OperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.workstations.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.workstations.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.workstations.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.workstations.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.workstations.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.workstations.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.workstations.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.workstations.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.workstations.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.workstations.v1.OperationMetadata + * @static + * @param {google.cloud.workstations.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.workstations.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.workstations.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.workstations.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + return v1; + })(); + workstations.v1beta = (function() { /** diff --git a/packages/google-cloud-workstations/protos/protos.json b/packages/google-cloud-workstations/protos/protos.json index 91acac1970f..5e5787c3aaf 100644 --- a/packages/google-cloud-workstations/protos/protos.json +++ b/packages/google-cloud-workstations/protos/protos.json @@ -6,6 +6,1596 @@ "nested": { "workstations": { "nested": { + "v1": { + "options": { + "go_package": "cloud.google.com/go/workstations/apiv1/workstationspb;workstationspb", + "java_multiple_files": true, + "java_outer_classname": "WorkstationsProto", + "java_package": "com.google.cloud.workstations.v1" + }, + "nested": { + "Workstations": { + "options": { + "(google.api.default_host)": "workstations.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "GetWorkstationCluster": { + "requestType": "GetWorkstationClusterRequest", + "responseType": "WorkstationCluster", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/workstationClusters/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/workstationClusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListWorkstationClusters": { + "requestType": "ListWorkstationClustersRequest", + "responseType": "ListWorkstationClustersResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/workstationClusters", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/workstationClusters" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateWorkstationCluster": { + "requestType": "CreateWorkstationClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/workstationClusters", + "(google.api.http).body": "workstation_cluster", + "(google.api.method_signature)": "parent,workstation_cluster,workstation_cluster_id", + "(google.longrunning.operation_info).response_type": "WorkstationCluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/workstationClusters", + "body": "workstation_cluster" + } + }, + { + "(google.api.method_signature)": "parent,workstation_cluster,workstation_cluster_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "WorkstationCluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateWorkstationCluster": { + "requestType": "UpdateWorkstationClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{workstation_cluster.name=projects/*/locations/*/workstationClusters/*}", + "(google.api.http).body": "workstation_cluster", + "(google.api.method_signature)": "workstation_cluster,update_mask", + "(google.longrunning.operation_info).response_type": "WorkstationCluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{workstation_cluster.name=projects/*/locations/*/workstationClusters/*}", + "body": "workstation_cluster" + } + }, + { + "(google.api.method_signature)": "workstation_cluster,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "WorkstationCluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteWorkstationCluster": { + "requestType": "DeleteWorkstationClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/workstationClusters/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "WorkstationCluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/workstationClusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "WorkstationCluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetWorkstationConfig": { + "requestType": "GetWorkstationConfigRequest", + "responseType": "WorkstationConfig", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListWorkstationConfigs": { + "requestType": "ListWorkstationConfigsRequest", + "responseType": "ListWorkstationConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListUsableWorkstationConfigs": { + "requestType": "ListUsableWorkstationConfigsRequest", + "responseType": "ListUsableWorkstationConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs:listUsable", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs:listUsable" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateWorkstationConfig": { + "requestType": "CreateWorkstationConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs", + "(google.api.http).body": "workstation_config", + "(google.api.method_signature)": "parent,workstation_config,workstation_config_id", + "(google.longrunning.operation_info).response_type": "WorkstationConfig", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs", + "body": "workstation_config" + } + }, + { + "(google.api.method_signature)": "parent,workstation_config,workstation_config_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "WorkstationConfig", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateWorkstationConfig": { + "requestType": "UpdateWorkstationConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{workstation_config.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}", + "(google.api.http).body": "workstation_config", + "(google.api.method_signature)": "workstation_config,update_mask", + "(google.longrunning.operation_info).response_type": "WorkstationConfig", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{workstation_config.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}", + "body": "workstation_config" + } + }, + { + "(google.api.method_signature)": "workstation_config,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "WorkstationConfig", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteWorkstationConfig": { + "requestType": "DeleteWorkstationConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "WorkstationConfig", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "WorkstationConfig", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetWorkstation": { + "requestType": "GetWorkstationRequest", + "responseType": "Workstation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListWorkstations": { + "requestType": "ListWorkstationsRequest", + "responseType": "ListWorkstationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListUsableWorkstations": { + "requestType": "ListUsableWorkstationsRequest", + "responseType": "ListUsableWorkstationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations:listUsable", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations:listUsable" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateWorkstation": { + "requestType": "CreateWorkstationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations", + "(google.api.http).body": "workstation", + "(google.api.method_signature)": "parent,workstation,workstation_id", + "(google.longrunning.operation_info).response_type": "Workstation", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations", + "body": "workstation" + } + }, + { + "(google.api.method_signature)": "parent,workstation,workstation_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Workstation", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateWorkstation": { + "requestType": "UpdateWorkstationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{workstation.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}", + "(google.api.http).body": "workstation", + "(google.api.method_signature)": "workstation,update_mask", + "(google.longrunning.operation_info).response_type": "Workstation", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{workstation.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}", + "body": "workstation" + } + }, + { + "(google.api.method_signature)": "workstation,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Workstation", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteWorkstation": { + "requestType": "DeleteWorkstationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Workstation", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Workstation", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "StartWorkstation": { + "requestType": "StartWorkstationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:start", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Workstation", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:start", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Workstation", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "StopWorkstation": { + "requestType": "StopWorkstationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:stop", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Workstation", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:stop", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Workstation", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GenerateAccessToken": { + "requestType": "GenerateAccessTokenRequest", + "responseType": "GenerateAccessTokenResponse", + "options": { + "(google.api.http).post": "/v1/{workstation=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:generateAccessToken", + "(google.api.http).body": "*", + "(google.api.method_signature)": "workstation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{workstation=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:generateAccessToken", + "body": "*" + } + }, + { + "(google.api.method_signature)": "workstation" + } + ] + } + } + }, + "WorkstationCluster": { + "options": { + "(google.api.resource).type": "workstations.googleapis.com/WorkstationCluster", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 15 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 9 + }, + "network": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "subnetwork": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "privateClusterConfig": { + "type": "PrivateClusterConfig", + "id": 12 + }, + "degraded": { + "type": "bool", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conditions": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "PrivateClusterConfig": { + "fields": { + "enablePrivateEndpoint": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "clusterHostname": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceAttachmentUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "allowedProjects": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + } + } + }, + "WorkstationConfig": { + "options": { + "(google.api.resource).type": "workstations.googleapis.com/WorkstationConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 18 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 9 + }, + "idleTimeout": { + "type": "google.protobuf.Duration", + "id": 10 + }, + "runningTimeout": { + "type": "google.protobuf.Duration", + "id": 11 + }, + "host": { + "type": "Host", + "id": 12 + }, + "persistentDirectories": { + "rule": "repeated", + "type": "PersistentDirectory", + "id": 13 + }, + "container": { + "type": "Container", + "id": 14 + }, + "encryptionKey": { + "type": "CustomerEncryptionKey", + "id": 17 + }, + "degraded": { + "type": "bool", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conditions": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Host": { + "oneofs": { + "config": { + "oneof": [ + "gceInstance" + ] + } + }, + "fields": { + "gceInstance": { + "type": "GceInstance", + "id": 1 + } + }, + "nested": { + "GceInstance": { + "fields": { + "machineType": { + "type": "string", + "id": 1 + }, + "serviceAccount": { + "type": "string", + "id": 2 + }, + "tags": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "poolSize": { + "type": "int32", + "id": 5 + }, + "disablePublicIpAddresses": { + "type": "bool", + "id": 6 + }, + "enableNestedVirtualization": { + "type": "bool", + "id": 7 + }, + "shieldedInstanceConfig": { + "type": "GceShieldedInstanceConfig", + "id": 8 + }, + "confidentialInstanceConfig": { + "type": "GceConfidentialInstanceConfig", + "id": 10 + }, + "bootDiskSizeGb": { + "type": "int32", + "id": 9 + } + }, + "nested": { + "GceShieldedInstanceConfig": { + "fields": { + "enableSecureBoot": { + "type": "bool", + "id": 1 + }, + "enableVtpm": { + "type": "bool", + "id": 2 + }, + "enableIntegrityMonitoring": { + "type": "bool", + "id": 3 + } + } + }, + "GceConfidentialInstanceConfig": { + "fields": { + "enableConfidentialCompute": { + "type": "bool", + "id": 1 + } + } + } + } + } + } + }, + "PersistentDirectory": { + "oneofs": { + "directoryType": { + "oneof": [ + "gcePd" + ] + } + }, + "fields": { + "gcePd": { + "type": "GceRegionalPersistentDisk", + "id": 2 + }, + "mountPath": { + "type": "string", + "id": 1 + } + }, + "nested": { + "GceRegionalPersistentDisk": { + "fields": { + "sizeGb": { + "type": "int32", + "id": 1 + }, + "fsType": { + "type": "string", + "id": 2 + }, + "diskType": { + "type": "string", + "id": 3 + }, + "sourceSnapshot": { + "type": "string", + "id": 5 + }, + "reclaimPolicy": { + "type": "ReclaimPolicy", + "id": 4 + } + }, + "nested": { + "ReclaimPolicy": { + "values": { + "RECLAIM_POLICY_UNSPECIFIED": 0, + "DELETE": 1, + "RETAIN": 2 + } + } + } + } + } + }, + "Container": { + "fields": { + "image": { + "type": "string", + "id": 1 + }, + "command": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "args": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "env": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "workingDir": { + "type": "string", + "id": 5 + }, + "runAsUser": { + "type": "int32", + "id": 6 + } + } + }, + "CustomerEncryptionKey": { + "fields": { + "kmsKey": { + "type": "string", + "id": 1 + }, + "kmsKeyServiceAccount": { + "type": "string", + "id": 2 + } + } + } + } + }, + "Workstation": { + "options": { + "(google.api.resource).type": "workstations.googleapis.com/Workstation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "uid": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reconciling": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 13 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 9 + }, + "state": { + "type": "State", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "host": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "STATE_STARTING": 1, + "STATE_RUNNING": 2, + "STATE_STOPPING": 3, + "STATE_STOPPED": 4 + } + } + } + }, + "GetWorkstationClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workstations.googleapis.com/WorkstationCluster" + } + } + } + }, + "ListWorkstationClustersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "workstations.googleapis.com/WorkstationCluster" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListWorkstationClustersResponse": { + "fields": { + "workstationClusters": { + "rule": "repeated", + "type": "WorkstationCluster", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "CreateWorkstationClusterRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "workstations.googleapis.com/WorkstationCluster" + } + }, + "workstationClusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "workstationCluster": { + "type": "WorkstationCluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4 + } + } + }, + "UpdateWorkstationClusterRequest": { + "fields": { + "workstationCluster": { + "type": "WorkstationCluster", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3 + }, + "allowMissing": { + "type": "bool", + "id": 4 + } + } + }, + "DeleteWorkstationClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workstations.googleapis.com/WorkstationCluster" + } + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3 + }, + "force": { + "type": "bool", + "id": 4 + } + } + }, + "GetWorkstationConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workstations.googleapis.com/WorkstationConfig" + } + } + } + }, + "ListWorkstationConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workstations.googleapis.com/WorkstationCluster" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListWorkstationConfigsResponse": { + "fields": { + "workstationConfigs": { + "rule": "repeated", + "type": "WorkstationConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ListUsableWorkstationConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workstations.googleapis.com/WorkstationCluster" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListUsableWorkstationConfigsResponse": { + "fields": { + "workstationConfigs": { + "rule": "repeated", + "type": "WorkstationConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "CreateWorkstationConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workstations.googleapis.com/WorkstationCluster" + } + }, + "workstationConfigId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "workstationConfig": { + "type": "WorkstationConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4 + } + } + }, + "UpdateWorkstationConfigRequest": { + "fields": { + "workstationConfig": { + "type": "WorkstationConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3 + }, + "allowMissing": { + "type": "bool", + "id": 4 + } + } + }, + "DeleteWorkstationConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workstations.googleapis.com/WorkstationConfig" + } + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3 + }, + "force": { + "type": "bool", + "id": 4 + } + } + }, + "GetWorkstationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workstations.googleapis.com/Workstation" + } + } + } + }, + "ListWorkstationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workstations.googleapis.com/WorkstationConfig" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListWorkstationsResponse": { + "fields": { + "workstations": { + "rule": "repeated", + "type": "Workstation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ListUsableWorkstationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workstations.googleapis.com/WorkstationConfig" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListUsableWorkstationsResponse": { + "fields": { + "workstations": { + "rule": "repeated", + "type": "Workstation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "CreateWorkstationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workstations.googleapis.com/WorkstationConfig" + } + }, + "workstationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "workstation": { + "type": "Workstation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 4 + } + } + }, + "UpdateWorkstationRequest": { + "fields": { + "workstation": { + "type": "Workstation", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "validateOnly": { + "type": "bool", + "id": 3 + }, + "allowMissing": { + "type": "bool", + "id": 4 + } + } + }, + "DeleteWorkstationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workstations.googleapis.com/Workstation" + } + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3 + } + } + }, + "StartWorkstationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workstations.googleapis.com/Workstation" + } + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3 + } + } + }, + "StopWorkstationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workstations.googleapis.com/Workstation" + } + }, + "validateOnly": { + "type": "bool", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3 + } + } + }, + "GenerateAccessTokenRequest": { + "oneofs": { + "expiration": { + "oneof": [ + "expireTime", + "ttl" + ] + } + }, + "fields": { + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "ttl": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "workstation": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "workstations.googleapis.com/Workstation" + } + } + } + }, + "GenerateAccessTokenResponse": { + "fields": { + "accessToken": { + "type": "string", + "id": 1 + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, "v1beta": { "options": { "go_package": "cloud.google.com/go/workstations/apiv1beta/workstationspb;workstationspb", diff --git a/packages/google-cloud-workstations/samples/README.md b/packages/google-cloud-workstations/samples/README.md index 72d30b8c6d0..c6f5f4f3a85 100644 --- a/packages/google-cloud-workstations/samples/README.md +++ b/packages/google-cloud-workstations/samples/README.md @@ -12,6 +12,26 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Workstations.create_workstation](#workstations.create_workstation) + * [Workstations.create_workstation_cluster](#workstations.create_workstation_cluster) + * [Workstations.create_workstation_config](#workstations.create_workstation_config) + * [Workstations.delete_workstation](#workstations.delete_workstation) + * [Workstations.delete_workstation_cluster](#workstations.delete_workstation_cluster) + * [Workstations.delete_workstation_config](#workstations.delete_workstation_config) + * [Workstations.generate_access_token](#workstations.generate_access_token) + * [Workstations.get_workstation](#workstations.get_workstation) + * [Workstations.get_workstation_cluster](#workstations.get_workstation_cluster) + * [Workstations.get_workstation_config](#workstations.get_workstation_config) + * [Workstations.list_usable_workstation_configs](#workstations.list_usable_workstation_configs) + * [Workstations.list_usable_workstations](#workstations.list_usable_workstations) + * [Workstations.list_workstation_clusters](#workstations.list_workstation_clusters) + * [Workstations.list_workstation_configs](#workstations.list_workstation_configs) + * [Workstations.list_workstations](#workstations.list_workstations) + * [Workstations.start_workstation](#workstations.start_workstation) + * [Workstations.stop_workstation](#workstations.stop_workstation) + * [Workstations.update_workstation](#workstations.update_workstation) + * [Workstations.update_workstation_cluster](#workstations.update_workstation_cluster) + * [Workstations.update_workstation_config](#workstations.update_workstation_config) * [Workstations.create_workstation](#workstations.create_workstation) * [Workstations.create_workstation_cluster](#workstations.create_workstation_cluster) * [Workstations.create_workstation_config](#workstations.create_workstation_config) @@ -50,6 +70,346 @@ Before running the samples, make sure you've followed the steps outlined in +### Workstations.create_workstation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation.js` + + +----- + + + + +### Workstations.create_workstation_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation_cluster.js` + + +----- + + + + +### Workstations.create_workstation_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation_config.js` + + +----- + + + + +### Workstations.delete_workstation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation.js` + + +----- + + + + +### Workstations.delete_workstation_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation_cluster.js` + + +----- + + + + +### Workstations.delete_workstation_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation_config.js` + + +----- + + + + +### Workstations.generate_access_token + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.generate_access_token.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.generate_access_token.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.generate_access_token.js` + + +----- + + + + +### Workstations.get_workstation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation.js` + + +----- + + + + +### Workstations.get_workstation_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation_cluster.js` + + +----- + + + + +### Workstations.get_workstation_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation_config.js` + + +----- + + + + +### Workstations.list_usable_workstation_configs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.list_usable_workstation_configs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.list_usable_workstation_configs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.list_usable_workstation_configs.js` + + +----- + + + + +### Workstations.list_usable_workstations + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.list_usable_workstations.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.list_usable_workstations.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.list_usable_workstations.js` + + +----- + + + + +### Workstations.list_workstation_clusters + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstation_clusters.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstation_clusters.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstation_clusters.js` + + +----- + + + + +### Workstations.list_workstation_configs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstation_configs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstation_configs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstation_configs.js` + + +----- + + + + +### Workstations.list_workstations + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstations.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstations.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstations.js` + + +----- + + + + +### Workstations.start_workstation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.start_workstation.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.start_workstation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.start_workstation.js` + + +----- + + + + +### Workstations.stop_workstation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.stop_workstation.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.stop_workstation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.stop_workstation.js` + + +----- + + + + +### Workstations.update_workstation + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation.js` + + +----- + + + + +### Workstations.update_workstation_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation_cluster.js` + + +----- + + + + +### Workstations.update_workstation_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation_config.js` + + +----- + + + + ### Workstations.create_workstation View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-workstations/samples/generated/v1beta/workstations.create_workstation.js). diff --git a/packages/google-cloud-workstations/samples/generated/v1/snippet_metadata.google.cloud.workstations.v1.json b/packages/google-cloud-workstations/samples/generated/v1/snippet_metadata.google.cloud.workstations.v1.json new file mode 100644 index 00000000000..5ab3eb237a4 --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/snippet_metadata.google.cloud.workstations.v1.json @@ -0,0 +1,983 @@ +{ + "clientLibrary": { + "name": "nodejs-workstations", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.workstations.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "workstations_v1_generated_Workstations_GetWorkstationCluster_async", + "title": "Workstations getWorkstationCluster Sample", + "origin": "API_DEFINITION", + "description": " Returns the requested workstation cluster.", + "canonical": true, + "file": "workstations.get_workstation_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetWorkstationCluster", + "fullName": "google.cloud.workstations.v1.Workstations.GetWorkstationCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.workstations.v1.WorkstationCluster", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "GetWorkstationCluster", + "fullName": "google.cloud.workstations.v1.Workstations.GetWorkstationCluster", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_ListWorkstationClusters_async", + "title": "Workstations listWorkstationClusters Sample", + "origin": "API_DEFINITION", + "description": " Returns all workstation clusters in the specified location.", + "canonical": true, + "file": "workstations.list_workstation_clusters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListWorkstationClusters", + "fullName": "google.cloud.workstations.v1.Workstations.ListWorkstationClusters", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.workstations.v1.ListWorkstationClustersResponse", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "ListWorkstationClusters", + "fullName": "google.cloud.workstations.v1.Workstations.ListWorkstationClusters", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_CreateWorkstationCluster_async", + "title": "Workstations createWorkstationCluster Sample", + "origin": "API_DEFINITION", + "description": " Creates a new workstation cluster.", + "canonical": true, + "file": "workstations.create_workstation_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateWorkstationCluster", + "fullName": "google.cloud.workstations.v1.Workstations.CreateWorkstationCluster", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "workstation_cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "workstation_cluster", + "type": ".google.cloud.workstations.v1.WorkstationCluster" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "CreateWorkstationCluster", + "fullName": "google.cloud.workstations.v1.Workstations.CreateWorkstationCluster", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_UpdateWorkstationCluster_async", + "title": "Workstations updateWorkstationCluster Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing workstation cluster.", + "canonical": true, + "file": "workstations.update_workstation_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateWorkstationCluster", + "fullName": "google.cloud.workstations.v1.Workstations.UpdateWorkstationCluster", + "async": true, + "parameters": [ + { + "name": "workstation_cluster", + "type": ".google.cloud.workstations.v1.WorkstationCluster" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "UpdateWorkstationCluster", + "fullName": "google.cloud.workstations.v1.Workstations.UpdateWorkstationCluster", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_DeleteWorkstationCluster_async", + "title": "Workstations deleteWorkstationCluster Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified workstation cluster.", + "canonical": true, + "file": "workstations.delete_workstation_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteWorkstationCluster", + "fullName": "google.cloud.workstations.v1.Workstations.DeleteWorkstationCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "DeleteWorkstationCluster", + "fullName": "google.cloud.workstations.v1.Workstations.DeleteWorkstationCluster", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_GetWorkstationConfig_async", + "title": "Workstations getWorkstationConfig Sample", + "origin": "API_DEFINITION", + "description": " Returns the requested workstation configuration.", + "canonical": true, + "file": "workstations.get_workstation_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetWorkstationConfig", + "fullName": "google.cloud.workstations.v1.Workstations.GetWorkstationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.workstations.v1.WorkstationConfig", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "GetWorkstationConfig", + "fullName": "google.cloud.workstations.v1.Workstations.GetWorkstationConfig", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_ListWorkstationConfigs_async", + "title": "Workstations listWorkstationConfigs Sample", + "origin": "API_DEFINITION", + "description": " Returns all WorkstationConfigs in the specified cluster.", + "canonical": true, + "file": "workstations.list_workstation_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListWorkstationConfigs", + "fullName": "google.cloud.workstations.v1.Workstations.ListWorkstationConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.workstations.v1.ListWorkstationConfigsResponse", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "ListWorkstationConfigs", + "fullName": "google.cloud.workstations.v1.Workstations.ListWorkstationConfigs", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_ListUsableWorkstationConfigs_async", + "title": "Workstations listUsableWorkstationConfigs Sample", + "origin": "API_DEFINITION", + "description": " Returns all workstation configurations in the specified cluster on which the caller has the \"workstations.workstation.create\" permission.", + "canonical": true, + "file": "workstations.list_usable_workstation_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUsableWorkstationConfigs", + "fullName": "google.cloud.workstations.v1.Workstations.ListUsableWorkstationConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "ListUsableWorkstationConfigs", + "fullName": "google.cloud.workstations.v1.Workstations.ListUsableWorkstationConfigs", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_CreateWorkstationConfig_async", + "title": "Workstations createWorkstationConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a new workstation configuration.", + "canonical": true, + "file": "workstations.create_workstation_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateWorkstationConfig", + "fullName": "google.cloud.workstations.v1.Workstations.CreateWorkstationConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "workstation_config_id", + "type": "TYPE_STRING" + }, + { + "name": "workstation_config", + "type": ".google.cloud.workstations.v1.WorkstationConfig" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "CreateWorkstationConfig", + "fullName": "google.cloud.workstations.v1.Workstations.CreateWorkstationConfig", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_UpdateWorkstationConfig_async", + "title": "Workstations updateWorkstationConfig Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing workstation configuration.", + "canonical": true, + "file": "workstations.update_workstation_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateWorkstationConfig", + "fullName": "google.cloud.workstations.v1.Workstations.UpdateWorkstationConfig", + "async": true, + "parameters": [ + { + "name": "workstation_config", + "type": ".google.cloud.workstations.v1.WorkstationConfig" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "UpdateWorkstationConfig", + "fullName": "google.cloud.workstations.v1.Workstations.UpdateWorkstationConfig", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_DeleteWorkstationConfig_async", + "title": "Workstations deleteWorkstationConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified workstation configuration.", + "canonical": true, + "file": "workstations.delete_workstation_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteWorkstationConfig", + "fullName": "google.cloud.workstations.v1.Workstations.DeleteWorkstationConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "DeleteWorkstationConfig", + "fullName": "google.cloud.workstations.v1.Workstations.DeleteWorkstationConfig", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_GetWorkstation_async", + "title": "Workstations getWorkstation Sample", + "origin": "API_DEFINITION", + "description": " Returns the requested workstation.", + "canonical": true, + "file": "workstations.get_workstation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetWorkstation", + "fullName": "google.cloud.workstations.v1.Workstations.GetWorkstation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.workstations.v1.Workstation", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "GetWorkstation", + "fullName": "google.cloud.workstations.v1.Workstations.GetWorkstation", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_ListWorkstations_async", + "title": "Workstations listWorkstations Sample", + "origin": "API_DEFINITION", + "description": " Returns all Workstations using the specified config.", + "canonical": true, + "file": "workstations.list_workstations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListWorkstations", + "fullName": "google.cloud.workstations.v1.Workstations.ListWorkstations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.workstations.v1.ListWorkstationsResponse", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "ListWorkstations", + "fullName": "google.cloud.workstations.v1.Workstations.ListWorkstations", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_ListUsableWorkstations_async", + "title": "Workstations listUsableWorkstations Sample", + "origin": "API_DEFINITION", + "description": " Returns all Workstations using the specified config on which the caller has the \"workstations.workstations.use\" permission.", + "canonical": true, + "file": "workstations.list_usable_workstations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListUsableWorkstations", + "fullName": "google.cloud.workstations.v1.Workstations.ListUsableWorkstations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.workstations.v1.ListUsableWorkstationsResponse", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "ListUsableWorkstations", + "fullName": "google.cloud.workstations.v1.Workstations.ListUsableWorkstations", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_CreateWorkstation_async", + "title": "Workstations createWorkstation Sample", + "origin": "API_DEFINITION", + "description": " Creates a new workstation.", + "canonical": true, + "file": "workstations.create_workstation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateWorkstation", + "fullName": "google.cloud.workstations.v1.Workstations.CreateWorkstation", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "workstation_id", + "type": "TYPE_STRING" + }, + { + "name": "workstation", + "type": ".google.cloud.workstations.v1.Workstation" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "CreateWorkstation", + "fullName": "google.cloud.workstations.v1.Workstations.CreateWorkstation", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_UpdateWorkstation_async", + "title": "Workstations updateWorkstation Sample", + "origin": "API_DEFINITION", + "description": " Updates an existing workstation.", + "canonical": true, + "file": "workstations.update_workstation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateWorkstation", + "fullName": "google.cloud.workstations.v1.Workstations.UpdateWorkstation", + "async": true, + "parameters": [ + { + "name": "workstation", + "type": ".google.cloud.workstations.v1.Workstation" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "UpdateWorkstation", + "fullName": "google.cloud.workstations.v1.Workstations.UpdateWorkstation", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_DeleteWorkstation_async", + "title": "Workstations deleteWorkstation Sample", + "origin": "API_DEFINITION", + "description": " Deletes the specified workstation.", + "canonical": true, + "file": "workstations.delete_workstation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteWorkstation", + "fullName": "google.cloud.workstations.v1.Workstations.DeleteWorkstation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "DeleteWorkstation", + "fullName": "google.cloud.workstations.v1.Workstations.DeleteWorkstation", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_StartWorkstation_async", + "title": "Workstations startWorkstation Sample", + "origin": "API_DEFINITION", + "description": " Starts running a workstation so that users can connect to it.", + "canonical": true, + "file": "workstations.start_workstation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StartWorkstation", + "fullName": "google.cloud.workstations.v1.Workstations.StartWorkstation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "StartWorkstation", + "fullName": "google.cloud.workstations.v1.Workstations.StartWorkstation", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_StopWorkstation_async", + "title": "Workstations stopWorkstation Sample", + "origin": "API_DEFINITION", + "description": " Stops running a workstation, reducing costs.", + "canonical": true, + "file": "workstations.stop_workstation.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StopWorkstation", + "fullName": "google.cloud.workstations.v1.Workstations.StopWorkstation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "StopWorkstation", + "fullName": "google.cloud.workstations.v1.Workstations.StopWorkstation", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + }, + { + "regionTag": "workstations_v1_generated_Workstations_GenerateAccessToken_async", + "title": "Workstations generateAccessToken Sample", + "origin": "API_DEFINITION", + "description": " Returns a short-lived credential that can be used to send authenticated and authorized traffic to a workstation.", + "canonical": true, + "file": "workstations.generate_access_token.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateAccessToken", + "fullName": "google.cloud.workstations.v1.Workstations.GenerateAccessToken", + "async": true, + "parameters": [ + { + "name": "expire_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "ttl", + "type": ".google.protobuf.Duration" + }, + { + "name": "workstation", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.workstations.v1.GenerateAccessTokenResponse", + "client": { + "shortName": "WorkstationsClient", + "fullName": "google.cloud.workstations.v1.WorkstationsClient" + }, + "method": { + "shortName": "GenerateAccessToken", + "fullName": "google.cloud.workstations.v1.Workstations.GenerateAccessToken", + "service": { + "shortName": "Workstations", + "fullName": "google.cloud.workstations.v1.Workstations" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation.js new file mode 100644 index 00000000000..a81d5dbadd8 --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation.js @@ -0,0 +1,77 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, workstationId, workstation) { + // [START workstations_v1_generated_Workstations_CreateWorkstation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + */ + // const parent = 'abc123' + /** + * Required. ID to use for the workstation. + */ + // const workstationId = 'abc123' + /** + * Required. Workstation to create. + */ + // const workstation = {} + /** + * If set, validate the request and preview the review, but do not actually + * apply it. + */ + // const validateOnly = true + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callCreateWorkstation() { + // Construct request + const request = { + parent, + workstationId, + workstation, + }; + + // Run request + const [operation] = await workstationsClient.createWorkstation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateWorkstation(); + // [END workstations_v1_generated_Workstations_CreateWorkstation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation_cluster.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation_cluster.js new file mode 100644 index 00000000000..21b02bbd7c5 --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation_cluster.js @@ -0,0 +1,77 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, workstationClusterId, workstationCluster) { + // [START workstations_v1_generated_Workstations_CreateWorkstationCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + */ + // const parent = 'abc123' + /** + * Required. ID to use for the workstation cluster. + */ + // const workstationClusterId = 'abc123' + /** + * Required. Workstation cluster to create. + */ + // const workstationCluster = {} + /** + * If set, validate the request and preview the review, but do not actually + * apply it. + */ + // const validateOnly = true + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callCreateWorkstationCluster() { + // Construct request + const request = { + parent, + workstationClusterId, + workstationCluster, + }; + + // Run request + const [operation] = await workstationsClient.createWorkstationCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateWorkstationCluster(); + // [END workstations_v1_generated_Workstations_CreateWorkstationCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation_config.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation_config.js new file mode 100644 index 00000000000..4c0e7f3ea0e --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.create_workstation_config.js @@ -0,0 +1,77 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, workstationConfigId, workstationConfig) { + // [START workstations_v1_generated_Workstations_CreateWorkstationConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + */ + // const parent = 'abc123' + /** + * Required. ID to use for the config. + */ + // const workstationConfigId = 'abc123' + /** + * Required. Config to create. + */ + // const workstationConfig = {} + /** + * If set, validate the request and preview the review, but do not actually + * apply it. + */ + // const validateOnly = true + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callCreateWorkstationConfig() { + // Construct request + const request = { + parent, + workstationConfigId, + workstationConfig, + }; + + // Run request + const [operation] = await workstationsClient.createWorkstationConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateWorkstationConfig(); + // [END workstations_v1_generated_Workstations_CreateWorkstationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation.js new file mode 100644 index 00000000000..a585717a1ac --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation.js @@ -0,0 +1,72 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START workstations_v1_generated_Workstations_DeleteWorkstation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the workstation to delete. + */ + // const name = 'abc123' + /** + * If set, validate the request and preview the review, but do not actually + * apply it. + */ + // const validateOnly = true + /** + * If set, the request will be rejected if the latest version of the + * workstation on the server does not have this etag. + */ + // const etag = 'abc123' + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callDeleteWorkstation() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await workstationsClient.deleteWorkstation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteWorkstation(); + // [END workstations_v1_generated_Workstations_DeleteWorkstation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation_cluster.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation_cluster.js new file mode 100644 index 00000000000..3c33c358517 --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation_cluster.js @@ -0,0 +1,77 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START workstations_v1_generated_Workstations_DeleteWorkstationCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the workstation cluster to delete. + */ + // const name = 'abc123' + /** + * If set, validate the request and preview the review, but do not apply it. + */ + // const validateOnly = true + /** + * If set, the request will be rejected if the latest version of the + * workstation cluster on the server does not have this etag. + */ + // const etag = 'abc123' + /** + * If set, any workstation configurations and workstations in the + * workstation cluster are also deleted. Otherwise, the request only + * works if the workstation cluster has no configurations or workstations. + */ + // const force = true + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callDeleteWorkstationCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await workstationsClient.deleteWorkstationCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteWorkstationCluster(); + // [END workstations_v1_generated_Workstations_DeleteWorkstationCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation_config.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation_config.js new file mode 100644 index 00000000000..c3b93d2678e --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.delete_workstation_config.js @@ -0,0 +1,77 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START workstations_v1_generated_Workstations_DeleteWorkstationConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the config to delete. + */ + // const name = 'abc123' + /** + * If set, validate the request and preview the review, but do not actually + * apply it. + */ + // const validateOnly = true + /** + * If set, the request will be rejected if the latest version of the config on + * the server does not have this etag. + */ + // const etag = 'abc123' + /** + * If set, any Workstations in the config will also be deleted. Otherwise, + * the request will work only if the config has no workstations. + */ + // const force = true + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callDeleteWorkstationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await workstationsClient.deleteWorkstationConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteWorkstationConfig(); + // [END workstations_v1_generated_Workstations_DeleteWorkstationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.generate_access_token.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.generate_access_token.js new file mode 100644 index 00000000000..84a042a8964 --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.generate_access_token.js @@ -0,0 +1,75 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workstation) { + // [START workstations_v1_generated_Workstations_GenerateAccessToken_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Desired expiration time of the access token. This value must + * be at most 24 hours in the future. If a value is not specified, the + * token's expiration time will be set to a default value of 1 hour in the + * future. + */ + // const expireTime = {} + /** + * Desired lifetime duration of the access token. This value must + * be at most 24 hours. If a value is not specified, the token's lifetime + * will be set to a default value of 1 hour. + */ + // const ttl = {} + /** + * Required. Name of the workstation for which the access token should be + * generated. + */ + // const workstation = 'abc123' + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callGenerateAccessToken() { + // Construct request + const request = { + workstation, + }; + + // Run request + const response = await workstationsClient.generateAccessToken(request); + console.log(response); + } + + callGenerateAccessToken(); + // [END workstations_v1_generated_Workstations_GenerateAccessToken_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation.js new file mode 100644 index 00000000000..44fd5c9394e --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START workstations_v1_generated_Workstations_GetWorkstation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the requested resource. + */ + // const name = 'abc123' + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callGetWorkstation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await workstationsClient.getWorkstation(request); + console.log(response); + } + + callGetWorkstation(); + // [END workstations_v1_generated_Workstations_GetWorkstation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation_cluster.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation_cluster.js new file mode 100644 index 00000000000..af52420b163 --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation_cluster.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START workstations_v1_generated_Workstations_GetWorkstationCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the requested resource. + */ + // const name = 'abc123' + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callGetWorkstationCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await workstationsClient.getWorkstationCluster(request); + console.log(response); + } + + callGetWorkstationCluster(); + // [END workstations_v1_generated_Workstations_GetWorkstationCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation_config.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation_config.js new file mode 100644 index 00000000000..6e3e86070fd --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.get_workstation_config.js @@ -0,0 +1,61 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START workstations_v1_generated_Workstations_GetWorkstationConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the requested resource. + */ + // const name = 'abc123' + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callGetWorkstationConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await workstationsClient.getWorkstationConfig(request); + console.log(response); + } + + callGetWorkstationConfig(); + // [END workstations_v1_generated_Workstations_GetWorkstationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.list_usable_workstation_configs.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.list_usable_workstation_configs.js new file mode 100644 index 00000000000..e4393f0e08b --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.list_usable_workstation_configs.js @@ -0,0 +1,71 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START workstations_v1_generated_Workstations_ListUsableWorkstationConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + */ + // const parent = 'abc123' + /** + * Maximum number of items to return. + */ + // const pageSize = 1234 + /** + * next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callListUsableWorkstationConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await workstationsClient.listUsableWorkstationConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUsableWorkstationConfigs(); + // [END workstations_v1_generated_Workstations_ListUsableWorkstationConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.list_usable_workstations.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.list_usable_workstations.js new file mode 100644 index 00000000000..d3f09434d14 --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.list_usable_workstations.js @@ -0,0 +1,71 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START workstations_v1_generated_Workstations_ListUsableWorkstations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + */ + // const parent = 'abc123' + /** + * Maximum number of items to return. + */ + // const pageSize = 1234 + /** + * next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callListUsableWorkstations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await workstationsClient.listUsableWorkstationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListUsableWorkstations(); + // [END workstations_v1_generated_Workstations_ListUsableWorkstations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstation_clusters.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstation_clusters.js new file mode 100644 index 00000000000..d46b9ee5fc8 --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstation_clusters.js @@ -0,0 +1,71 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START workstations_v1_generated_Workstations_ListWorkstationClusters_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + */ + // const parent = 'abc123' + /** + * Maximum number of items to return. + */ + // const pageSize = 1234 + /** + * next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callListWorkstationClusters() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await workstationsClient.listWorkstationClustersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListWorkstationClusters(); + // [END workstations_v1_generated_Workstations_ListWorkstationClusters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstation_configs.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstation_configs.js new file mode 100644 index 00000000000..f26affab431 --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstation_configs.js @@ -0,0 +1,71 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START workstations_v1_generated_Workstations_ListWorkstationConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + */ + // const parent = 'abc123' + /** + * Maximum number of items to return. + */ + // const pageSize = 1234 + /** + * next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callListWorkstationConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await workstationsClient.listWorkstationConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListWorkstationConfigs(); + // [END workstations_v1_generated_Workstations_ListWorkstationConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstations.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstations.js new file mode 100644 index 00000000000..78be2ba4e2b --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.list_workstations.js @@ -0,0 +1,71 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START workstations_v1_generated_Workstations_ListWorkstations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource name. + */ + // const parent = 'abc123' + /** + * Maximum number of items to return. + */ + // const pageSize = 1234 + /** + * next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callListWorkstations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await workstationsClient.listWorkstationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListWorkstations(); + // [END workstations_v1_generated_Workstations_ListWorkstations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.start_workstation.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.start_workstation.js new file mode 100644 index 00000000000..b4aa824bd61 --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.start_workstation.js @@ -0,0 +1,72 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START workstations_v1_generated_Workstations_StartWorkstation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the workstation to start. + */ + // const name = 'abc123' + /** + * If set, validate the request and preview the review, but do not actually + * apply it. + */ + // const validateOnly = true + /** + * If set, the request will be rejected if the latest version of the + * workstation on the server does not have this etag. + */ + // const etag = 'abc123' + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callStartWorkstation() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await workstationsClient.startWorkstation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callStartWorkstation(); + // [END workstations_v1_generated_Workstations_StartWorkstation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.stop_workstation.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.stop_workstation.js new file mode 100644 index 00000000000..ab24801bd3f --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.stop_workstation.js @@ -0,0 +1,72 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START workstations_v1_generated_Workstations_StopWorkstation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the workstation to stop. + */ + // const name = 'abc123' + /** + * If set, validate the request and preview the review, but do not actually + * apply it. + */ + // const validateOnly = true + /** + * If set, the request will be rejected if the latest version of the + * workstation on the server does not have this etag. + */ + // const etag = 'abc123' + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callStopWorkstation() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await workstationsClient.stopWorkstation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callStopWorkstation(); + // [END workstations_v1_generated_Workstations_StopWorkstation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation.js new file mode 100644 index 00000000000..639fd0922d0 --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation.js @@ -0,0 +1,77 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workstation, updateMask) { + // [START workstations_v1_generated_Workstations_UpdateWorkstation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Workstation to update. + */ + // const workstation = {} + /** + * Required. Mask specifying which fields in the config should be updated. + */ + // const updateMask = {} + /** + * If set, validate the request and preview the review, but do not actually + * apply it. + */ + // const validateOnly = true + /** + * If set, and the config is not found, a new config will be created. + * In this situation, update_mask is ignored. + */ + // const allowMissing = true + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callUpdateWorkstation() { + // Construct request + const request = { + workstation, + updateMask, + }; + + // Run request + const [operation] = await workstationsClient.updateWorkstation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateWorkstation(); + // [END workstations_v1_generated_Workstations_UpdateWorkstation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation_cluster.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation_cluster.js new file mode 100644 index 00000000000..9a27e3ef296 --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation_cluster.js @@ -0,0 +1,78 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workstationCluster, updateMask) { + // [START workstations_v1_generated_Workstations_UpdateWorkstationCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Workstation cluster to update. + */ + // const workstationCluster = {} + /** + * Required. Mask that specifies which fields in the workstation cluster + * should be updated. + */ + // const updateMask = {} + /** + * If set, validate the request and preview the review, but do not actually + * apply it. + */ + // const validateOnly = true + /** + * If set, and the workstation cluster is not found, a new workstation + * cluster will be created. In this situation, update_mask is ignored. + */ + // const allowMissing = true + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callUpdateWorkstationCluster() { + // Construct request + const request = { + workstationCluster, + updateMask, + }; + + // Run request + const [operation] = await workstationsClient.updateWorkstationCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateWorkstationCluster(); + // [END workstations_v1_generated_Workstations_UpdateWorkstationCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation_config.js b/packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation_config.js new file mode 100644 index 00000000000..0c8fb992fcd --- /dev/null +++ b/packages/google-cloud-workstations/samples/generated/v1/workstations.update_workstation_config.js @@ -0,0 +1,77 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(workstationConfig, updateMask) { + // [START workstations_v1_generated_Workstations_UpdateWorkstationConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Config to update. + */ + // const workstationConfig = {} + /** + * Required. Mask specifying which fields in the config should be updated. + */ + // const updateMask = {} + /** + * If set, validate the request and preview the review, but do not actually + * apply it. + */ + // const validateOnly = true + /** + * If set, and the config is not found, a new config will be created. + * In this situation, update_mask is ignored. + */ + // const allowMissing = true + + // Imports the Workstations library + const {WorkstationsClient} = require('@google-cloud/workstations').v1; + + // Instantiates a client + const workstationsClient = new WorkstationsClient(); + + async function callUpdateWorkstationConfig() { + // Construct request + const request = { + workstationConfig, + updateMask, + }; + + // Run request + const [operation] = await workstationsClient.updateWorkstationConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateWorkstationConfig(); + // [END workstations_v1_generated_Workstations_UpdateWorkstationConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-workstations/src/index.ts b/packages/google-cloud-workstations/src/index.ts index 4e625c02288..b674558b7a6 100644 --- a/packages/google-cloud-workstations/src/index.ts +++ b/packages/google-cloud-workstations/src/index.ts @@ -16,12 +16,13 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** +import * as v1 from './v1'; import * as v1beta from './v1beta'; const WorkstationsClient = v1beta.WorkstationsClient; type WorkstationsClient = v1beta.WorkstationsClient; -export {v1beta, WorkstationsClient}; -export default {v1beta, WorkstationsClient}; +export {v1, v1beta, WorkstationsClient}; +export default {v1, v1beta, WorkstationsClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-workstations/src/v1/gapic_metadata.json b/packages/google-cloud-workstations/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..aad5c9cc0d2 --- /dev/null +++ b/packages/google-cloud-workstations/src/v1/gapic_metadata.json @@ -0,0 +1,243 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.workstations.v1", + "libraryPackage": "@google-cloud/workstations", + "services": { + "Workstations": { + "clients": { + "grpc": { + "libraryClient": "WorkstationsClient", + "rpcs": { + "GetWorkstationCluster": { + "methods": [ + "getWorkstationCluster" + ] + }, + "GetWorkstationConfig": { + "methods": [ + "getWorkstationConfig" + ] + }, + "GetWorkstation": { + "methods": [ + "getWorkstation" + ] + }, + "GenerateAccessToken": { + "methods": [ + "generateAccessToken" + ] + }, + "CreateWorkstationCluster": { + "methods": [ + "createWorkstationCluster" + ] + }, + "UpdateWorkstationCluster": { + "methods": [ + "updateWorkstationCluster" + ] + }, + "DeleteWorkstationCluster": { + "methods": [ + "deleteWorkstationCluster" + ] + }, + "CreateWorkstationConfig": { + "methods": [ + "createWorkstationConfig" + ] + }, + "UpdateWorkstationConfig": { + "methods": [ + "updateWorkstationConfig" + ] + }, + "DeleteWorkstationConfig": { + "methods": [ + "deleteWorkstationConfig" + ] + }, + "CreateWorkstation": { + "methods": [ + "createWorkstation" + ] + }, + "UpdateWorkstation": { + "methods": [ + "updateWorkstation" + ] + }, + "DeleteWorkstation": { + "methods": [ + "deleteWorkstation" + ] + }, + "StartWorkstation": { + "methods": [ + "startWorkstation" + ] + }, + "StopWorkstation": { + "methods": [ + "stopWorkstation" + ] + }, + "ListWorkstationClusters": { + "methods": [ + "listWorkstationClusters", + "listWorkstationClustersStream", + "listWorkstationClustersAsync" + ] + }, + "ListWorkstationConfigs": { + "methods": [ + "listWorkstationConfigs", + "listWorkstationConfigsStream", + "listWorkstationConfigsAsync" + ] + }, + "ListUsableWorkstationConfigs": { + "methods": [ + "listUsableWorkstationConfigs", + "listUsableWorkstationConfigsStream", + "listUsableWorkstationConfigsAsync" + ] + }, + "ListWorkstations": { + "methods": [ + "listWorkstations", + "listWorkstationsStream", + "listWorkstationsAsync" + ] + }, + "ListUsableWorkstations": { + "methods": [ + "listUsableWorkstations", + "listUsableWorkstationsStream", + "listUsableWorkstationsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "WorkstationsClient", + "rpcs": { + "GetWorkstationCluster": { + "methods": [ + "getWorkstationCluster" + ] + }, + "GetWorkstationConfig": { + "methods": [ + "getWorkstationConfig" + ] + }, + "GetWorkstation": { + "methods": [ + "getWorkstation" + ] + }, + "GenerateAccessToken": { + "methods": [ + "generateAccessToken" + ] + }, + "CreateWorkstationCluster": { + "methods": [ + "createWorkstationCluster" + ] + }, + "UpdateWorkstationCluster": { + "methods": [ + "updateWorkstationCluster" + ] + }, + "DeleteWorkstationCluster": { + "methods": [ + "deleteWorkstationCluster" + ] + }, + "CreateWorkstationConfig": { + "methods": [ + "createWorkstationConfig" + ] + }, + "UpdateWorkstationConfig": { + "methods": [ + "updateWorkstationConfig" + ] + }, + "DeleteWorkstationConfig": { + "methods": [ + "deleteWorkstationConfig" + ] + }, + "CreateWorkstation": { + "methods": [ + "createWorkstation" + ] + }, + "UpdateWorkstation": { + "methods": [ + "updateWorkstation" + ] + }, + "DeleteWorkstation": { + "methods": [ + "deleteWorkstation" + ] + }, + "StartWorkstation": { + "methods": [ + "startWorkstation" + ] + }, + "StopWorkstation": { + "methods": [ + "stopWorkstation" + ] + }, + "ListWorkstationClusters": { + "methods": [ + "listWorkstationClusters", + "listWorkstationClustersStream", + "listWorkstationClustersAsync" + ] + }, + "ListWorkstationConfigs": { + "methods": [ + "listWorkstationConfigs", + "listWorkstationConfigsStream", + "listWorkstationConfigsAsync" + ] + }, + "ListUsableWorkstationConfigs": { + "methods": [ + "listUsableWorkstationConfigs", + "listUsableWorkstationConfigsStream", + "listUsableWorkstationConfigsAsync" + ] + }, + "ListWorkstations": { + "methods": [ + "listWorkstations", + "listWorkstationsStream", + "listWorkstationsAsync" + ] + }, + "ListUsableWorkstations": { + "methods": [ + "listUsableWorkstations", + "listUsableWorkstationsStream", + "listUsableWorkstationsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-workstations/src/v1/index.ts b/packages/google-cloud-workstations/src/v1/index.ts new file mode 100644 index 00000000000..8fd62185321 --- /dev/null +++ b/packages/google-cloud-workstations/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {WorkstationsClient} from './workstations_client'; diff --git a/packages/google-cloud-workstations/src/v1/workstations_client.ts b/packages/google-cloud-workstations/src/v1/workstations_client.ts new file mode 100644 index 00000000000..5f04d5e87a6 --- /dev/null +++ b/packages/google-cloud-workstations/src/v1/workstations_client.ts @@ -0,0 +1,4296 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/workstations_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './workstations_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for interacting with Cloud Workstations. + * @class + * @memberof v1 + */ +export class WorkstationsClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + workstationsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of WorkstationsClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean | "rest"} [options.fallback] - Use HTTP fallback mode. + * Pass "rest" to use HTTP/1.1 REST API instead of gRPC. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new WorkstationsClient({fallback: 'rest'}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof WorkstationsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Load google-gax module synchronously if needed + if (!gaxInstance) { + gaxInstance = require('google-gax') as typeof gax; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest') { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + workstationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}' + ), + workstationClusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}' + ), + workstationConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listWorkstationClusters: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'workstationClusters' + ), + listWorkstationConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'workstationConfigs' + ), + listUsableWorkstationConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'workstationConfigs' + ), + listWorkstations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'workstations' + ), + listUsableWorkstations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'workstations' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createWorkstationClusterResponse = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.WorkstationCluster' + ) as gax.protobuf.Type; + const createWorkstationClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateWorkstationClusterResponse = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.WorkstationCluster' + ) as gax.protobuf.Type; + const updateWorkstationClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteWorkstationClusterResponse = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.WorkstationCluster' + ) as gax.protobuf.Type; + const deleteWorkstationClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createWorkstationConfigResponse = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.WorkstationConfig' + ) as gax.protobuf.Type; + const createWorkstationConfigMetadata = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateWorkstationConfigResponse = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.WorkstationConfig' + ) as gax.protobuf.Type; + const updateWorkstationConfigMetadata = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteWorkstationConfigResponse = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.WorkstationConfig' + ) as gax.protobuf.Type; + const deleteWorkstationConfigMetadata = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createWorkstationResponse = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.Workstation' + ) as gax.protobuf.Type; + const createWorkstationMetadata = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateWorkstationResponse = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.Workstation' + ) as gax.protobuf.Type; + const updateWorkstationMetadata = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteWorkstationResponse = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.Workstation' + ) as gax.protobuf.Type; + const deleteWorkstationMetadata = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.OperationMetadata' + ) as gax.protobuf.Type; + const startWorkstationResponse = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.Workstation' + ) as gax.protobuf.Type; + const startWorkstationMetadata = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.OperationMetadata' + ) as gax.protobuf.Type; + const stopWorkstationResponse = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.Workstation' + ) as gax.protobuf.Type; + const stopWorkstationMetadata = protoFilesRoot.lookup( + '.google.cloud.workstations.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createWorkstationCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createWorkstationClusterResponse.decode.bind( + createWorkstationClusterResponse + ), + createWorkstationClusterMetadata.decode.bind( + createWorkstationClusterMetadata + ) + ), + updateWorkstationCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateWorkstationClusterResponse.decode.bind( + updateWorkstationClusterResponse + ), + updateWorkstationClusterMetadata.decode.bind( + updateWorkstationClusterMetadata + ) + ), + deleteWorkstationCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteWorkstationClusterResponse.decode.bind( + deleteWorkstationClusterResponse + ), + deleteWorkstationClusterMetadata.decode.bind( + deleteWorkstationClusterMetadata + ) + ), + createWorkstationConfig: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createWorkstationConfigResponse.decode.bind( + createWorkstationConfigResponse + ), + createWorkstationConfigMetadata.decode.bind( + createWorkstationConfigMetadata + ) + ), + updateWorkstationConfig: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateWorkstationConfigResponse.decode.bind( + updateWorkstationConfigResponse + ), + updateWorkstationConfigMetadata.decode.bind( + updateWorkstationConfigMetadata + ) + ), + deleteWorkstationConfig: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteWorkstationConfigResponse.decode.bind( + deleteWorkstationConfigResponse + ), + deleteWorkstationConfigMetadata.decode.bind( + deleteWorkstationConfigMetadata + ) + ), + createWorkstation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createWorkstationResponse.decode.bind(createWorkstationResponse), + createWorkstationMetadata.decode.bind(createWorkstationMetadata) + ), + updateWorkstation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateWorkstationResponse.decode.bind(updateWorkstationResponse), + updateWorkstationMetadata.decode.bind(updateWorkstationMetadata) + ), + deleteWorkstation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteWorkstationResponse.decode.bind(deleteWorkstationResponse), + deleteWorkstationMetadata.decode.bind(deleteWorkstationMetadata) + ), + startWorkstation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + startWorkstationResponse.decode.bind(startWorkstationResponse), + startWorkstationMetadata.decode.bind(startWorkstationMetadata) + ), + stopWorkstation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + stopWorkstationResponse.decode.bind(stopWorkstationResponse), + stopWorkstationMetadata.decode.bind(stopWorkstationMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.workstations.v1.Workstations', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.workstationsStub) { + return this.workstationsStub; + } + + // Put together the "service stub" for + // google.cloud.workstations.v1.Workstations. + this.workstationsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.workstations.v1.Workstations' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.workstations.v1.Workstations, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const workstationsStubMethods = [ + 'getWorkstationCluster', + 'listWorkstationClusters', + 'createWorkstationCluster', + 'updateWorkstationCluster', + 'deleteWorkstationCluster', + 'getWorkstationConfig', + 'listWorkstationConfigs', + 'listUsableWorkstationConfigs', + 'createWorkstationConfig', + 'updateWorkstationConfig', + 'deleteWorkstationConfig', + 'getWorkstation', + 'listWorkstations', + 'listUsableWorkstations', + 'createWorkstation', + 'updateWorkstation', + 'deleteWorkstation', + 'startWorkstation', + 'stopWorkstation', + 'generateAccessToken', + ]; + for (const methodName of workstationsStubMethods) { + const callPromise = this.workstationsStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.workstationsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'workstations.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'workstations.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Returns the requested workstation cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the requested resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.workstations.v1.WorkstationCluster | WorkstationCluster}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/workstations.get_workstation_cluster.js + * region_tag:workstations_v1_generated_Workstations_GetWorkstationCluster_async + */ + getWorkstationCluster( + request?: protos.google.cloud.workstations.v1.IGetWorkstationClusterRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.workstations.v1.IWorkstationCluster, + ( + | protos.google.cloud.workstations.v1.IGetWorkstationClusterRequest + | undefined + ), + {} | undefined + ] + >; + getWorkstationCluster( + request: protos.google.cloud.workstations.v1.IGetWorkstationClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.workstations.v1.IWorkstationCluster, + | protos.google.cloud.workstations.v1.IGetWorkstationClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getWorkstationCluster( + request: protos.google.cloud.workstations.v1.IGetWorkstationClusterRequest, + callback: Callback< + protos.google.cloud.workstations.v1.IWorkstationCluster, + | protos.google.cloud.workstations.v1.IGetWorkstationClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getWorkstationCluster( + request?: protos.google.cloud.workstations.v1.IGetWorkstationClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.workstations.v1.IWorkstationCluster, + | protos.google.cloud.workstations.v1.IGetWorkstationClusterRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.workstations.v1.IWorkstationCluster, + | protos.google.cloud.workstations.v1.IGetWorkstationClusterRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.workstations.v1.IWorkstationCluster, + ( + | protos.google.cloud.workstations.v1.IGetWorkstationClusterRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getWorkstationCluster(request, options, callback); + } + /** + * Returns the requested workstation configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the requested resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.workstations.v1.WorkstationConfig | WorkstationConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/workstations.get_workstation_config.js + * region_tag:workstations_v1_generated_Workstations_GetWorkstationConfig_async + */ + getWorkstationConfig( + request?: protos.google.cloud.workstations.v1.IGetWorkstationConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.workstations.v1.IWorkstationConfig, + ( + | protos.google.cloud.workstations.v1.IGetWorkstationConfigRequest + | undefined + ), + {} | undefined + ] + >; + getWorkstationConfig( + request: protos.google.cloud.workstations.v1.IGetWorkstationConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.workstations.v1.IWorkstationConfig, + | protos.google.cloud.workstations.v1.IGetWorkstationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getWorkstationConfig( + request: protos.google.cloud.workstations.v1.IGetWorkstationConfigRequest, + callback: Callback< + protos.google.cloud.workstations.v1.IWorkstationConfig, + | protos.google.cloud.workstations.v1.IGetWorkstationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getWorkstationConfig( + request?: protos.google.cloud.workstations.v1.IGetWorkstationConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.workstations.v1.IWorkstationConfig, + | protos.google.cloud.workstations.v1.IGetWorkstationConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.workstations.v1.IWorkstationConfig, + | protos.google.cloud.workstations.v1.IGetWorkstationConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.workstations.v1.IWorkstationConfig, + ( + | protos.google.cloud.workstations.v1.IGetWorkstationConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getWorkstationConfig(request, options, callback); + } + /** + * Returns the requested workstation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the requested resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.workstations.v1.Workstation | Workstation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/workstations.get_workstation.js + * region_tag:workstations_v1_generated_Workstations_GetWorkstation_async + */ + getWorkstation( + request?: protos.google.cloud.workstations.v1.IGetWorkstationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IGetWorkstationRequest | undefined, + {} | undefined + ] + >; + getWorkstation( + request: protos.google.cloud.workstations.v1.IGetWorkstationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.workstations.v1.IWorkstation, + | protos.google.cloud.workstations.v1.IGetWorkstationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getWorkstation( + request: protos.google.cloud.workstations.v1.IGetWorkstationRequest, + callback: Callback< + protos.google.cloud.workstations.v1.IWorkstation, + | protos.google.cloud.workstations.v1.IGetWorkstationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getWorkstation( + request?: protos.google.cloud.workstations.v1.IGetWorkstationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.workstations.v1.IWorkstation, + | protos.google.cloud.workstations.v1.IGetWorkstationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.workstations.v1.IWorkstation, + | protos.google.cloud.workstations.v1.IGetWorkstationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IGetWorkstationRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getWorkstation(request, options, callback); + } + /** + * Returns a short-lived credential that can be used to send authenticated and + * authorized traffic to a workstation. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.Timestamp} request.expireTime + * Desired expiration time of the access token. This value must + * be at most 24 hours in the future. If a value is not specified, the + * token's expiration time will be set to a default value of 1 hour in the + * future. + * @param {google.protobuf.Duration} request.ttl + * Desired lifetime duration of the access token. This value must + * be at most 24 hours. If a value is not specified, the token's lifetime + * will be set to a default value of 1 hour. + * @param {string} request.workstation + * Required. Name of the workstation for which the access token should be + * generated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.workstations.v1.GenerateAccessTokenResponse | GenerateAccessTokenResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/workstations.generate_access_token.js + * region_tag:workstations_v1_generated_Workstations_GenerateAccessToken_async + */ + generateAccessToken( + request?: protos.google.cloud.workstations.v1.IGenerateAccessTokenRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.workstations.v1.IGenerateAccessTokenResponse, + ( + | protos.google.cloud.workstations.v1.IGenerateAccessTokenRequest + | undefined + ), + {} | undefined + ] + >; + generateAccessToken( + request: protos.google.cloud.workstations.v1.IGenerateAccessTokenRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.workstations.v1.IGenerateAccessTokenResponse, + | protos.google.cloud.workstations.v1.IGenerateAccessTokenRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateAccessToken( + request: protos.google.cloud.workstations.v1.IGenerateAccessTokenRequest, + callback: Callback< + protos.google.cloud.workstations.v1.IGenerateAccessTokenResponse, + | protos.google.cloud.workstations.v1.IGenerateAccessTokenRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateAccessToken( + request?: protos.google.cloud.workstations.v1.IGenerateAccessTokenRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.workstations.v1.IGenerateAccessTokenResponse, + | protos.google.cloud.workstations.v1.IGenerateAccessTokenRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.workstations.v1.IGenerateAccessTokenResponse, + | protos.google.cloud.workstations.v1.IGenerateAccessTokenRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.workstations.v1.IGenerateAccessTokenResponse, + ( + | protos.google.cloud.workstations.v1.IGenerateAccessTokenRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + workstation: request.workstation ?? '', + }); + this.initialize(); + return this.innerApiCalls.generateAccessToken(request, options, callback); + } + + /** + * Creates a new workstation cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource name. + * @param {string} request.workstationClusterId + * Required. ID to use for the workstation cluster. + * @param {google.cloud.workstations.v1.WorkstationCluster} request.workstationCluster + * Required. Workstation cluster to create. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the review, but do not actually + * apply it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.create_workstation_cluster.js + * region_tag:workstations_v1_generated_Workstations_CreateWorkstationCluster_async + */ + createWorkstationCluster( + request?: protos.google.cloud.workstations.v1.ICreateWorkstationClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createWorkstationCluster( + request: protos.google.cloud.workstations.v1.ICreateWorkstationClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createWorkstationCluster( + request: protos.google.cloud.workstations.v1.ICreateWorkstationClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createWorkstationCluster( + request?: protos.google.cloud.workstations.v1.ICreateWorkstationClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createWorkstationCluster( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createWorkstationCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.create_workstation_cluster.js + * region_tag:workstations_v1_generated_Workstations_CreateWorkstationCluster_async + */ + async checkCreateWorkstationClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.workstations.v1.WorkstationCluster, + protos.google.cloud.workstations.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createWorkstationCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.workstations.v1.WorkstationCluster, + protos.google.cloud.workstations.v1.OperationMetadata + >; + } + /** + * Updates an existing workstation cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.workstations.v1.WorkstationCluster} request.workstationCluster + * Required. Workstation cluster to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask that specifies which fields in the workstation cluster + * should be updated. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the review, but do not actually + * apply it. + * @param {boolean} request.allowMissing + * If set, and the workstation cluster is not found, a new workstation + * cluster will be created. In this situation, update_mask is ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.update_workstation_cluster.js + * region_tag:workstations_v1_generated_Workstations_UpdateWorkstationCluster_async + */ + updateWorkstationCluster( + request?: protos.google.cloud.workstations.v1.IUpdateWorkstationClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateWorkstationCluster( + request: protos.google.cloud.workstations.v1.IUpdateWorkstationClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateWorkstationCluster( + request: protos.google.cloud.workstations.v1.IUpdateWorkstationClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateWorkstationCluster( + request?: protos.google.cloud.workstations.v1.IUpdateWorkstationClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'workstation_cluster.name': request.workstationCluster!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateWorkstationCluster( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateWorkstationCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.update_workstation_cluster.js + * region_tag:workstations_v1_generated_Workstations_UpdateWorkstationCluster_async + */ + async checkUpdateWorkstationClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.workstations.v1.WorkstationCluster, + protos.google.cloud.workstations.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateWorkstationCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.workstations.v1.WorkstationCluster, + protos.google.cloud.workstations.v1.OperationMetadata + >; + } + /** + * Deletes the specified workstation cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the workstation cluster to delete. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the review, but do not apply it. + * @param {string} request.etag + * If set, the request will be rejected if the latest version of the + * workstation cluster on the server does not have this etag. + * @param {boolean} request.force + * If set, any workstation configurations and workstations in the + * workstation cluster are also deleted. Otherwise, the request only + * works if the workstation cluster has no configurations or workstations. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.delete_workstation_cluster.js + * region_tag:workstations_v1_generated_Workstations_DeleteWorkstationCluster_async + */ + deleteWorkstationCluster( + request?: protos.google.cloud.workstations.v1.IDeleteWorkstationClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteWorkstationCluster( + request: protos.google.cloud.workstations.v1.IDeleteWorkstationClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteWorkstationCluster( + request: protos.google.cloud.workstations.v1.IDeleteWorkstationClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteWorkstationCluster( + request?: protos.google.cloud.workstations.v1.IDeleteWorkstationClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteWorkstationCluster( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteWorkstationCluster()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.delete_workstation_cluster.js + * region_tag:workstations_v1_generated_Workstations_DeleteWorkstationCluster_async + */ + async checkDeleteWorkstationClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.workstations.v1.WorkstationCluster, + protos.google.cloud.workstations.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteWorkstationCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.workstations.v1.WorkstationCluster, + protos.google.cloud.workstations.v1.OperationMetadata + >; + } + /** + * Creates a new workstation configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource name. + * @param {string} request.workstationConfigId + * Required. ID to use for the config. + * @param {google.cloud.workstations.v1.WorkstationConfig} request.workstationConfig + * Required. Config to create. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the review, but do not actually + * apply it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.create_workstation_config.js + * region_tag:workstations_v1_generated_Workstations_CreateWorkstationConfig_async + */ + createWorkstationConfig( + request?: protos.google.cloud.workstations.v1.ICreateWorkstationConfigRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createWorkstationConfig( + request: protos.google.cloud.workstations.v1.ICreateWorkstationConfigRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createWorkstationConfig( + request: protos.google.cloud.workstations.v1.ICreateWorkstationConfigRequest, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createWorkstationConfig( + request?: protos.google.cloud.workstations.v1.ICreateWorkstationConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createWorkstationConfig( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createWorkstationConfig()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.create_workstation_config.js + * region_tag:workstations_v1_generated_Workstations_CreateWorkstationConfig_async + */ + async checkCreateWorkstationConfigProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.workstations.v1.WorkstationConfig, + protos.google.cloud.workstations.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createWorkstationConfig, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.workstations.v1.WorkstationConfig, + protos.google.cloud.workstations.v1.OperationMetadata + >; + } + /** + * Updates an existing workstation configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.workstations.v1.WorkstationConfig} request.workstationConfig + * Required. Config to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask specifying which fields in the config should be updated. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the review, but do not actually + * apply it. + * @param {boolean} request.allowMissing + * If set, and the config is not found, a new config will be created. + * In this situation, update_mask is ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.update_workstation_config.js + * region_tag:workstations_v1_generated_Workstations_UpdateWorkstationConfig_async + */ + updateWorkstationConfig( + request?: protos.google.cloud.workstations.v1.IUpdateWorkstationConfigRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateWorkstationConfig( + request: protos.google.cloud.workstations.v1.IUpdateWorkstationConfigRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateWorkstationConfig( + request: protos.google.cloud.workstations.v1.IUpdateWorkstationConfigRequest, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateWorkstationConfig( + request?: protos.google.cloud.workstations.v1.IUpdateWorkstationConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'workstation_config.name': request.workstationConfig!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateWorkstationConfig( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateWorkstationConfig()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.update_workstation_config.js + * region_tag:workstations_v1_generated_Workstations_UpdateWorkstationConfig_async + */ + async checkUpdateWorkstationConfigProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.workstations.v1.WorkstationConfig, + protos.google.cloud.workstations.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateWorkstationConfig, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.workstations.v1.WorkstationConfig, + protos.google.cloud.workstations.v1.OperationMetadata + >; + } + /** + * Deletes the specified workstation configuration. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the config to delete. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the review, but do not actually + * apply it. + * @param {string} request.etag + * If set, the request will be rejected if the latest version of the config on + * the server does not have this etag. + * @param {boolean} request.force + * If set, any Workstations in the config will also be deleted. Otherwise, + * the request will work only if the config has no workstations. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.delete_workstation_config.js + * region_tag:workstations_v1_generated_Workstations_DeleteWorkstationConfig_async + */ + deleteWorkstationConfig( + request?: protos.google.cloud.workstations.v1.IDeleteWorkstationConfigRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteWorkstationConfig( + request: protos.google.cloud.workstations.v1.IDeleteWorkstationConfigRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteWorkstationConfig( + request: protos.google.cloud.workstations.v1.IDeleteWorkstationConfigRequest, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteWorkstationConfig( + request?: protos.google.cloud.workstations.v1.IDeleteWorkstationConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteWorkstationConfig( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteWorkstationConfig()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.delete_workstation_config.js + * region_tag:workstations_v1_generated_Workstations_DeleteWorkstationConfig_async + */ + async checkDeleteWorkstationConfigProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.workstations.v1.WorkstationConfig, + protos.google.cloud.workstations.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteWorkstationConfig, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.workstations.v1.WorkstationConfig, + protos.google.cloud.workstations.v1.OperationMetadata + >; + } + /** + * Creates a new workstation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource name. + * @param {string} request.workstationId + * Required. ID to use for the workstation. + * @param {google.cloud.workstations.v1.Workstation} request.workstation + * Required. Workstation to create. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the review, but do not actually + * apply it. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.create_workstation.js + * region_tag:workstations_v1_generated_Workstations_CreateWorkstation_async + */ + createWorkstation( + request?: protos.google.cloud.workstations.v1.ICreateWorkstationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createWorkstation( + request: protos.google.cloud.workstations.v1.ICreateWorkstationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createWorkstation( + request: protos.google.cloud.workstations.v1.ICreateWorkstationRequest, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createWorkstation( + request?: protos.google.cloud.workstations.v1.ICreateWorkstationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createWorkstation(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createWorkstation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.create_workstation.js + * region_tag:workstations_v1_generated_Workstations_CreateWorkstation_async + */ + async checkCreateWorkstationProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.workstations.v1.Workstation, + protos.google.cloud.workstations.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createWorkstation, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.workstations.v1.Workstation, + protos.google.cloud.workstations.v1.OperationMetadata + >; + } + /** + * Updates an existing workstation. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.workstations.v1.Workstation} request.workstation + * Required. Workstation to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask specifying which fields in the config should be updated. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the review, but do not actually + * apply it. + * @param {boolean} request.allowMissing + * If set, and the config is not found, a new config will be created. + * In this situation, update_mask is ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.update_workstation.js + * region_tag:workstations_v1_generated_Workstations_UpdateWorkstation_async + */ + updateWorkstation( + request?: protos.google.cloud.workstations.v1.IUpdateWorkstationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateWorkstation( + request: protos.google.cloud.workstations.v1.IUpdateWorkstationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateWorkstation( + request: protos.google.cloud.workstations.v1.IUpdateWorkstationRequest, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateWorkstation( + request?: protos.google.cloud.workstations.v1.IUpdateWorkstationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'workstation.name': request.workstation!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateWorkstation(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateWorkstation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.update_workstation.js + * region_tag:workstations_v1_generated_Workstations_UpdateWorkstation_async + */ + async checkUpdateWorkstationProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.workstations.v1.Workstation, + protos.google.cloud.workstations.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateWorkstation, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.workstations.v1.Workstation, + protos.google.cloud.workstations.v1.OperationMetadata + >; + } + /** + * Deletes the specified workstation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the workstation to delete. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the review, but do not actually + * apply it. + * @param {string} request.etag + * If set, the request will be rejected if the latest version of the + * workstation on the server does not have this etag. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.delete_workstation.js + * region_tag:workstations_v1_generated_Workstations_DeleteWorkstation_async + */ + deleteWorkstation( + request?: protos.google.cloud.workstations.v1.IDeleteWorkstationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteWorkstation( + request: protos.google.cloud.workstations.v1.IDeleteWorkstationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteWorkstation( + request: protos.google.cloud.workstations.v1.IDeleteWorkstationRequest, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteWorkstation( + request?: protos.google.cloud.workstations.v1.IDeleteWorkstationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteWorkstation(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteWorkstation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.delete_workstation.js + * region_tag:workstations_v1_generated_Workstations_DeleteWorkstation_async + */ + async checkDeleteWorkstationProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.workstations.v1.Workstation, + protos.google.cloud.workstations.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteWorkstation, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.workstations.v1.Workstation, + protos.google.cloud.workstations.v1.OperationMetadata + >; + } + /** + * Starts running a workstation so that users can connect to it. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the workstation to start. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the review, but do not actually + * apply it. + * @param {string} request.etag + * If set, the request will be rejected if the latest version of the + * workstation on the server does not have this etag. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.start_workstation.js + * region_tag:workstations_v1_generated_Workstations_StartWorkstation_async + */ + startWorkstation( + request?: protos.google.cloud.workstations.v1.IStartWorkstationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + startWorkstation( + request: protos.google.cloud.workstations.v1.IStartWorkstationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + startWorkstation( + request: protos.google.cloud.workstations.v1.IStartWorkstationRequest, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + startWorkstation( + request?: protos.google.cloud.workstations.v1.IStartWorkstationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.startWorkstation(request, options, callback); + } + /** + * Check the status of the long running operation returned by `startWorkstation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.start_workstation.js + * region_tag:workstations_v1_generated_Workstations_StartWorkstation_async + */ + async checkStartWorkstationProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.workstations.v1.Workstation, + protos.google.cloud.workstations.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.startWorkstation, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.workstations.v1.Workstation, + protos.google.cloud.workstations.v1.OperationMetadata + >; + } + /** + * Stops running a workstation, reducing costs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the workstation to stop. + * @param {boolean} request.validateOnly + * If set, validate the request and preview the review, but do not actually + * apply it. + * @param {string} request.etag + * If set, the request will be rejected if the latest version of the + * workstation on the server does not have this etag. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.stop_workstation.js + * region_tag:workstations_v1_generated_Workstations_StopWorkstation_async + */ + stopWorkstation( + request?: protos.google.cloud.workstations.v1.IStopWorkstationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + stopWorkstation( + request: protos.google.cloud.workstations.v1.IStopWorkstationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + stopWorkstation( + request: protos.google.cloud.workstations.v1.IStopWorkstationRequest, + callback: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + stopWorkstation( + request?: protos.google.cloud.workstations.v1.IStopWorkstationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.stopWorkstation(request, options, callback); + } + /** + * Check the status of the long running operation returned by `stopWorkstation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/workstations.stop_workstation.js + * region_tag:workstations_v1_generated_Workstations_StopWorkstation_async + */ + async checkStopWorkstationProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.workstations.v1.Workstation, + protos.google.cloud.workstations.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.stopWorkstation, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.workstations.v1.Workstation, + protos.google.cloud.workstations.v1.OperationMetadata + >; + } + /** + * Returns all workstation clusters in the specified location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource name. + * @param {number} request.pageSize + * Maximum number of items to return. + * @param {string} request.pageToken + * next_page_token value returned from a previous List request, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.workstations.v1.WorkstationCluster | WorkstationCluster}. + * 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 `listWorkstationClustersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkstationClusters( + request?: protos.google.cloud.workstations.v1.IListWorkstationClustersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.workstations.v1.IWorkstationCluster[], + protos.google.cloud.workstations.v1.IListWorkstationClustersRequest | null, + protos.google.cloud.workstations.v1.IListWorkstationClustersResponse + ] + >; + listWorkstationClusters( + request: protos.google.cloud.workstations.v1.IListWorkstationClustersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.workstations.v1.IListWorkstationClustersRequest, + | protos.google.cloud.workstations.v1.IListWorkstationClustersResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstationCluster + > + ): void; + listWorkstationClusters( + request: protos.google.cloud.workstations.v1.IListWorkstationClustersRequest, + callback: PaginationCallback< + protos.google.cloud.workstations.v1.IListWorkstationClustersRequest, + | protos.google.cloud.workstations.v1.IListWorkstationClustersResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstationCluster + > + ): void; + listWorkstationClusters( + request?: protos.google.cloud.workstations.v1.IListWorkstationClustersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.workstations.v1.IListWorkstationClustersRequest, + | protos.google.cloud.workstations.v1.IListWorkstationClustersResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstationCluster + >, + callback?: PaginationCallback< + protos.google.cloud.workstations.v1.IListWorkstationClustersRequest, + | protos.google.cloud.workstations.v1.IListWorkstationClustersResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstationCluster + > + ): Promise< + [ + protos.google.cloud.workstations.v1.IWorkstationCluster[], + protos.google.cloud.workstations.v1.IListWorkstationClustersRequest | null, + protos.google.cloud.workstations.v1.IListWorkstationClustersResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listWorkstationClusters( + 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. Parent resource name. + * @param {number} request.pageSize + * Maximum number of items to return. + * @param {string} request.pageToken + * next_page_token value returned from a previous List request, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.workstations.v1.WorkstationCluster | WorkstationCluster} 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 `listWorkstationClustersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkstationClustersStream( + request?: protos.google.cloud.workstations.v1.IListWorkstationClustersRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listWorkstationClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listWorkstationClusters.createStream( + this.innerApiCalls.listWorkstationClusters as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listWorkstationClusters`, 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. Parent resource name. + * @param {number} request.pageSize + * Maximum number of items to return. + * @param {string} request.pageToken + * next_page_token value returned from a previous List request, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.workstations.v1.WorkstationCluster | WorkstationCluster}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/workstations.list_workstation_clusters.js + * region_tag:workstations_v1_generated_Workstations_ListWorkstationClusters_async + */ + listWorkstationClustersAsync( + request?: protos.google.cloud.workstations.v1.IListWorkstationClustersRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listWorkstationClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listWorkstationClusters.asyncIterate( + this.innerApiCalls['listWorkstationClusters'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns all WorkstationConfigs in the specified cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource name. + * @param {number} request.pageSize + * Maximum number of items to return. + * @param {string} request.pageToken + * next_page_token value returned from a previous List request, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.workstations.v1.WorkstationConfig | WorkstationConfig}. + * 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 `listWorkstationConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkstationConfigs( + request?: protos.google.cloud.workstations.v1.IListWorkstationConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.workstations.v1.IWorkstationConfig[], + protos.google.cloud.workstations.v1.IListWorkstationConfigsRequest | null, + protos.google.cloud.workstations.v1.IListWorkstationConfigsResponse + ] + >; + listWorkstationConfigs( + request: protos.google.cloud.workstations.v1.IListWorkstationConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.workstations.v1.IListWorkstationConfigsRequest, + | protos.google.cloud.workstations.v1.IListWorkstationConfigsResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstationConfig + > + ): void; + listWorkstationConfigs( + request: protos.google.cloud.workstations.v1.IListWorkstationConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.workstations.v1.IListWorkstationConfigsRequest, + | protos.google.cloud.workstations.v1.IListWorkstationConfigsResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstationConfig + > + ): void; + listWorkstationConfigs( + request?: protos.google.cloud.workstations.v1.IListWorkstationConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.workstations.v1.IListWorkstationConfigsRequest, + | protos.google.cloud.workstations.v1.IListWorkstationConfigsResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstationConfig + >, + callback?: PaginationCallback< + protos.google.cloud.workstations.v1.IListWorkstationConfigsRequest, + | protos.google.cloud.workstations.v1.IListWorkstationConfigsResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstationConfig + > + ): Promise< + [ + protos.google.cloud.workstations.v1.IWorkstationConfig[], + protos.google.cloud.workstations.v1.IListWorkstationConfigsRequest | null, + protos.google.cloud.workstations.v1.IListWorkstationConfigsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listWorkstationConfigs( + 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. Parent resource name. + * @param {number} request.pageSize + * Maximum number of items to return. + * @param {string} request.pageToken + * next_page_token value returned from a previous List request, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.workstations.v1.WorkstationConfig | WorkstationConfig} 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 `listWorkstationConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkstationConfigsStream( + request?: protos.google.cloud.workstations.v1.IListWorkstationConfigsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listWorkstationConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listWorkstationConfigs.createStream( + this.innerApiCalls.listWorkstationConfigs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listWorkstationConfigs`, 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. Parent resource name. + * @param {number} request.pageSize + * Maximum number of items to return. + * @param {string} request.pageToken + * next_page_token value returned from a previous List request, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.workstations.v1.WorkstationConfig | WorkstationConfig}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/workstations.list_workstation_configs.js + * region_tag:workstations_v1_generated_Workstations_ListWorkstationConfigs_async + */ + listWorkstationConfigsAsync( + request?: protos.google.cloud.workstations.v1.IListWorkstationConfigsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listWorkstationConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listWorkstationConfigs.asyncIterate( + this.innerApiCalls['listWorkstationConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns all workstation configurations in the specified cluster on which + * the caller has the "workstations.workstation.create" permission. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource name. + * @param {number} request.pageSize + * Maximum number of items to return. + * @param {string} request.pageToken + * next_page_token value returned from a previous List request, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.workstations.v1.WorkstationConfig | WorkstationConfig}. + * 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 `listUsableWorkstationConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUsableWorkstationConfigs( + request?: protos.google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.workstations.v1.IWorkstationConfig[], + protos.google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest | null, + protos.google.cloud.workstations.v1.IListUsableWorkstationConfigsResponse + ] + >; + listUsableWorkstationConfigs( + request: protos.google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest, + | protos.google.cloud.workstations.v1.IListUsableWorkstationConfigsResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstationConfig + > + ): void; + listUsableWorkstationConfigs( + request: protos.google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest, + | protos.google.cloud.workstations.v1.IListUsableWorkstationConfigsResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstationConfig + > + ): void; + listUsableWorkstationConfigs( + request?: protos.google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest, + | protos.google.cloud.workstations.v1.IListUsableWorkstationConfigsResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstationConfig + >, + callback?: PaginationCallback< + protos.google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest, + | protos.google.cloud.workstations.v1.IListUsableWorkstationConfigsResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstationConfig + > + ): Promise< + [ + protos.google.cloud.workstations.v1.IWorkstationConfig[], + protos.google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest | null, + protos.google.cloud.workstations.v1.IListUsableWorkstationConfigsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listUsableWorkstationConfigs( + 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. Parent resource name. + * @param {number} request.pageSize + * Maximum number of items to return. + * @param {string} request.pageToken + * next_page_token value returned from a previous List request, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.workstations.v1.WorkstationConfig | WorkstationConfig} 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 `listUsableWorkstationConfigsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUsableWorkstationConfigsStream( + request?: protos.google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsableWorkstationConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsableWorkstationConfigs.createStream( + this.innerApiCalls.listUsableWorkstationConfigs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listUsableWorkstationConfigs`, 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. Parent resource name. + * @param {number} request.pageSize + * Maximum number of items to return. + * @param {string} request.pageToken + * next_page_token value returned from a previous List request, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.workstations.v1.WorkstationConfig | WorkstationConfig}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/workstations.list_usable_workstation_configs.js + * region_tag:workstations_v1_generated_Workstations_ListUsableWorkstationConfigs_async + */ + listUsableWorkstationConfigsAsync( + request?: protos.google.cloud.workstations.v1.IListUsableWorkstationConfigsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsableWorkstationConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsableWorkstationConfigs.asyncIterate( + this.innerApiCalls['listUsableWorkstationConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns all Workstations using the specified config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource name. + * @param {number} request.pageSize + * Maximum number of items to return. + * @param {string} request.pageToken + * next_page_token value returned from a previous List request, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.workstations.v1.Workstation | Workstation}. + * 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 `listWorkstationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkstations( + request?: protos.google.cloud.workstations.v1.IListWorkstationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.workstations.v1.IWorkstation[], + protos.google.cloud.workstations.v1.IListWorkstationsRequest | null, + protos.google.cloud.workstations.v1.IListWorkstationsResponse + ] + >; + listWorkstations( + request: protos.google.cloud.workstations.v1.IListWorkstationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.workstations.v1.IListWorkstationsRequest, + | protos.google.cloud.workstations.v1.IListWorkstationsResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstation + > + ): void; + listWorkstations( + request: protos.google.cloud.workstations.v1.IListWorkstationsRequest, + callback: PaginationCallback< + protos.google.cloud.workstations.v1.IListWorkstationsRequest, + | protos.google.cloud.workstations.v1.IListWorkstationsResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstation + > + ): void; + listWorkstations( + request?: protos.google.cloud.workstations.v1.IListWorkstationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.workstations.v1.IListWorkstationsRequest, + | protos.google.cloud.workstations.v1.IListWorkstationsResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstation + >, + callback?: PaginationCallback< + protos.google.cloud.workstations.v1.IListWorkstationsRequest, + | protos.google.cloud.workstations.v1.IListWorkstationsResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstation + > + ): Promise< + [ + protos.google.cloud.workstations.v1.IWorkstation[], + protos.google.cloud.workstations.v1.IListWorkstationsRequest | null, + protos.google.cloud.workstations.v1.IListWorkstationsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listWorkstations(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. Parent resource name. + * @param {number} request.pageSize + * Maximum number of items to return. + * @param {string} request.pageToken + * next_page_token value returned from a previous List request, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.workstations.v1.Workstation | Workstation} 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 `listWorkstationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listWorkstationsStream( + request?: protos.google.cloud.workstations.v1.IListWorkstationsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listWorkstations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listWorkstations.createStream( + this.innerApiCalls.listWorkstations as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listWorkstations`, 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. Parent resource name. + * @param {number} request.pageSize + * Maximum number of items to return. + * @param {string} request.pageToken + * next_page_token value returned from a previous List request, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.workstations.v1.Workstation | Workstation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/workstations.list_workstations.js + * region_tag:workstations_v1_generated_Workstations_ListWorkstations_async + */ + listWorkstationsAsync( + request?: protos.google.cloud.workstations.v1.IListWorkstationsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listWorkstations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listWorkstations.asyncIterate( + this.innerApiCalls['listWorkstations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Returns all Workstations using the specified config on which the caller has + * the "workstations.workstations.use" permission. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource name. + * @param {number} request.pageSize + * Maximum number of items to return. + * @param {string} request.pageToken + * next_page_token value returned from a previous List request, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link google.cloud.workstations.v1.Workstation | Workstation}. + * 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 `listUsableWorkstationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUsableWorkstations( + request?: protos.google.cloud.workstations.v1.IListUsableWorkstationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.workstations.v1.IWorkstation[], + protos.google.cloud.workstations.v1.IListUsableWorkstationsRequest | null, + protos.google.cloud.workstations.v1.IListUsableWorkstationsResponse + ] + >; + listUsableWorkstations( + request: protos.google.cloud.workstations.v1.IListUsableWorkstationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.workstations.v1.IListUsableWorkstationsRequest, + | protos.google.cloud.workstations.v1.IListUsableWorkstationsResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstation + > + ): void; + listUsableWorkstations( + request: protos.google.cloud.workstations.v1.IListUsableWorkstationsRequest, + callback: PaginationCallback< + protos.google.cloud.workstations.v1.IListUsableWorkstationsRequest, + | protos.google.cloud.workstations.v1.IListUsableWorkstationsResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstation + > + ): void; + listUsableWorkstations( + request?: protos.google.cloud.workstations.v1.IListUsableWorkstationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.workstations.v1.IListUsableWorkstationsRequest, + | protos.google.cloud.workstations.v1.IListUsableWorkstationsResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstation + >, + callback?: PaginationCallback< + protos.google.cloud.workstations.v1.IListUsableWorkstationsRequest, + | protos.google.cloud.workstations.v1.IListUsableWorkstationsResponse + | null + | undefined, + protos.google.cloud.workstations.v1.IWorkstation + > + ): Promise< + [ + protos.google.cloud.workstations.v1.IWorkstation[], + protos.google.cloud.workstations.v1.IListUsableWorkstationsRequest | null, + protos.google.cloud.workstations.v1.IListUsableWorkstationsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listUsableWorkstations( + 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. Parent resource name. + * @param {number} request.pageSize + * Maximum number of items to return. + * @param {string} request.pageToken + * next_page_token value returned from a previous List request, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link google.cloud.workstations.v1.Workstation | Workstation} 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 `listUsableWorkstationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listUsableWorkstationsStream( + request?: protos.google.cloud.workstations.v1.IListUsableWorkstationsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsableWorkstations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsableWorkstations.createStream( + this.innerApiCalls.listUsableWorkstations as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listUsableWorkstations`, 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. Parent resource name. + * @param {number} request.pageSize + * Maximum number of items to return. + * @param {string} request.pageToken + * next_page_token value returned from a previous List request, if any. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.workstations.v1.Workstation | Workstation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1/workstations.list_usable_workstations.js + * region_tag:workstations_v1_generated_Workstations_ListUsableWorkstations_async + */ + listUsableWorkstationsAsync( + request?: protos.google.cloud.workstations.v1.IListUsableWorkstationsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listUsableWorkstations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listUsableWorkstations.asyncIterate( + this.innerApiCalls['listUsableWorkstations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified workstation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} workstation_cluster + * @param {string} workstation_config + * @param {string} workstation + * @returns {string} Resource name string. + */ + workstationPath( + project: string, + location: string, + workstationCluster: string, + workstationConfig: string, + workstation: string + ) { + return this.pathTemplates.workstationPathTemplate.render({ + project: project, + location: location, + workstation_cluster: workstationCluster, + workstation_config: workstationConfig, + workstation: workstation, + }); + } + + /** + * Parse the project from Workstation resource. + * + * @param {string} workstationName + * A fully-qualified path representing Workstation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkstationName(workstationName: string) { + return this.pathTemplates.workstationPathTemplate.match(workstationName) + .project; + } + + /** + * Parse the location from Workstation resource. + * + * @param {string} workstationName + * A fully-qualified path representing Workstation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkstationName(workstationName: string) { + return this.pathTemplates.workstationPathTemplate.match(workstationName) + .location; + } + + /** + * Parse the workstation_cluster from Workstation resource. + * + * @param {string} workstationName + * A fully-qualified path representing Workstation resource. + * @returns {string} A string representing the workstation_cluster. + */ + matchWorkstationClusterFromWorkstationName(workstationName: string) { + return this.pathTemplates.workstationPathTemplate.match(workstationName) + .workstation_cluster; + } + + /** + * Parse the workstation_config from Workstation resource. + * + * @param {string} workstationName + * A fully-qualified path representing Workstation resource. + * @returns {string} A string representing the workstation_config. + */ + matchWorkstationConfigFromWorkstationName(workstationName: string) { + return this.pathTemplates.workstationPathTemplate.match(workstationName) + .workstation_config; + } + + /** + * Parse the workstation from Workstation resource. + * + * @param {string} workstationName + * A fully-qualified path representing Workstation resource. + * @returns {string} A string representing the workstation. + */ + matchWorkstationFromWorkstationName(workstationName: string) { + return this.pathTemplates.workstationPathTemplate.match(workstationName) + .workstation; + } + + /** + * Return a fully-qualified workstationCluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} workstation_cluster + * @returns {string} Resource name string. + */ + workstationClusterPath( + project: string, + location: string, + workstationCluster: string + ) { + return this.pathTemplates.workstationClusterPathTemplate.render({ + project: project, + location: location, + workstation_cluster: workstationCluster, + }); + } + + /** + * Parse the project from WorkstationCluster resource. + * + * @param {string} workstationClusterName + * A fully-qualified path representing WorkstationCluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkstationClusterName(workstationClusterName: string) { + return this.pathTemplates.workstationClusterPathTemplate.match( + workstationClusterName + ).project; + } + + /** + * Parse the location from WorkstationCluster resource. + * + * @param {string} workstationClusterName + * A fully-qualified path representing WorkstationCluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkstationClusterName(workstationClusterName: string) { + return this.pathTemplates.workstationClusterPathTemplate.match( + workstationClusterName + ).location; + } + + /** + * Parse the workstation_cluster from WorkstationCluster resource. + * + * @param {string} workstationClusterName + * A fully-qualified path representing WorkstationCluster resource. + * @returns {string} A string representing the workstation_cluster. + */ + matchWorkstationClusterFromWorkstationClusterName( + workstationClusterName: string + ) { + return this.pathTemplates.workstationClusterPathTemplate.match( + workstationClusterName + ).workstation_cluster; + } + + /** + * Return a fully-qualified workstationConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} workstation_cluster + * @param {string} workstation_config + * @returns {string} Resource name string. + */ + workstationConfigPath( + project: string, + location: string, + workstationCluster: string, + workstationConfig: string + ) { + return this.pathTemplates.workstationConfigPathTemplate.render({ + project: project, + location: location, + workstation_cluster: workstationCluster, + workstation_config: workstationConfig, + }); + } + + /** + * Parse the project from WorkstationConfig resource. + * + * @param {string} workstationConfigName + * A fully-qualified path representing WorkstationConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromWorkstationConfigName(workstationConfigName: string) { + return this.pathTemplates.workstationConfigPathTemplate.match( + workstationConfigName + ).project; + } + + /** + * Parse the location from WorkstationConfig resource. + * + * @param {string} workstationConfigName + * A fully-qualified path representing WorkstationConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromWorkstationConfigName(workstationConfigName: string) { + return this.pathTemplates.workstationConfigPathTemplate.match( + workstationConfigName + ).location; + } + + /** + * Parse the workstation_cluster from WorkstationConfig resource. + * + * @param {string} workstationConfigName + * A fully-qualified path representing WorkstationConfig resource. + * @returns {string} A string representing the workstation_cluster. + */ + matchWorkstationClusterFromWorkstationConfigName( + workstationConfigName: string + ) { + return this.pathTemplates.workstationConfigPathTemplate.match( + workstationConfigName + ).workstation_cluster; + } + + /** + * Parse the workstation_config from WorkstationConfig resource. + * + * @param {string} workstationConfigName + * A fully-qualified path representing WorkstationConfig resource. + * @returns {string} A string representing the workstation_config. + */ + matchWorkstationConfigFromWorkstationConfigName( + workstationConfigName: string + ) { + return this.pathTemplates.workstationConfigPathTemplate.match( + workstationConfigName + ).workstation_config; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + if (this.workstationsStub && !this._terminated) { + return this.workstationsStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-workstations/src/v1/workstations_client_config.json b/packages/google-cloud-workstations/src/v1/workstations_client_config.json new file mode 100644 index 00000000000..eadd39f3056 --- /dev/null +++ b/packages/google-cloud-workstations/src/v1/workstations_client_config.json @@ -0,0 +1,138 @@ +{ + "interfaces": { + "google.cloud.workstations.v1.Workstations": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetWorkstationCluster": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListWorkstationClusters": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateWorkstationCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateWorkstationCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteWorkstationCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetWorkstationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListWorkstationConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListUsableWorkstationConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateWorkstationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateWorkstationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteWorkstationConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetWorkstation": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListWorkstations": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListUsableWorkstations": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateWorkstation": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateWorkstation": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteWorkstation": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StartWorkstation": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StopWorkstation": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GenerateAccessToken": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-workstations/src/v1/workstations_proto_list.json b/packages/google-cloud-workstations/src/v1/workstations_proto_list.json new file mode 100644 index 00000000000..e55bee79a1c --- /dev/null +++ b/packages/google-cloud-workstations/src/v1/workstations_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/workstations/v1/workstations.proto" +] diff --git a/packages/google-cloud-workstations/test/gapic_workstations_v1.ts b/packages/google-cloud-workstations/test/gapic_workstations_v1.ts new file mode 100644 index 00000000000..4b3a2c8db3a --- /dev/null +++ b/packages/google-cloud-workstations/test/gapic_workstations_v1.ts @@ -0,0 +1,5891 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as workstationsModule from '../src'; + +import {PassThrough} from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + LocationProtos, +} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.WorkstationsClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = workstationsModule.v1.WorkstationsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = workstationsModule.v1.WorkstationsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = workstationsModule.v1.WorkstationsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new workstationsModule.v1.WorkstationsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new workstationsModule.v1.WorkstationsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.workstationsStub, undefined); + await client.initialize(); + assert(client.workstationsStub); + }); + + it('has close method for the initialized client', done => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.workstationsStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.workstationsStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getWorkstationCluster', () => { + it('invokes getWorkstationCluster without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.GetWorkstationClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.GetWorkstationClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationCluster() + ); + client.innerApiCalls.getWorkstationCluster = + stubSimpleCall(expectedResponse); + const [response] = await client.getWorkstationCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getWorkstationCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWorkstationCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWorkstationCluster without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.GetWorkstationClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.GetWorkstationClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationCluster() + ); + client.innerApiCalls.getWorkstationCluster = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getWorkstationCluster( + request, + ( + err?: Error | null, + result?: protos.google.cloud.workstations.v1.IWorkstationCluster | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getWorkstationCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWorkstationCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWorkstationCluster with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.GetWorkstationClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.GetWorkstationClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getWorkstationCluster = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getWorkstationCluster(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getWorkstationCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWorkstationCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWorkstationCluster with closed client', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.GetWorkstationClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.GetWorkstationClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getWorkstationCluster(request), + expectedError + ); + }); + }); + + describe('getWorkstationConfig', () => { + it('invokes getWorkstationConfig without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.GetWorkstationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.GetWorkstationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ); + client.innerApiCalls.getWorkstationConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.getWorkstationConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getWorkstationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWorkstationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWorkstationConfig without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.GetWorkstationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.GetWorkstationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ); + client.innerApiCalls.getWorkstationConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getWorkstationConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.workstations.v1.IWorkstationConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getWorkstationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWorkstationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWorkstationConfig with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.GetWorkstationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.GetWorkstationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getWorkstationConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getWorkstationConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getWorkstationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWorkstationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWorkstationConfig with closed client', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.GetWorkstationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.GetWorkstationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getWorkstationConfig(request), expectedError); + }); + }); + + describe('getWorkstation', () => { + it('invokes getWorkstation without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.GetWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.GetWorkstationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ); + client.innerApiCalls.getWorkstation = stubSimpleCall(expectedResponse); + const [response] = await client.getWorkstation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWorkstation without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.GetWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.GetWorkstationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ); + client.innerApiCalls.getWorkstation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getWorkstation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.workstations.v1.IWorkstation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWorkstation with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.GetWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.GetWorkstationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getWorkstation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getWorkstation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getWorkstation with closed client', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.GetWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.GetWorkstationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getWorkstation(request), expectedError); + }); + }); + + describe('generateAccessToken', () => { + it('invokes generateAccessToken without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.GenerateAccessTokenRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.GenerateAccessTokenRequest', + ['workstation'] + ); + request.workstation = defaultValue1; + const expectedHeaderRequestParams = `workstation=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.workstations.v1.GenerateAccessTokenResponse() + ); + client.innerApiCalls.generateAccessToken = + stubSimpleCall(expectedResponse); + const [response] = await client.generateAccessToken(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateAccessToken as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateAccessToken as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateAccessToken without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.GenerateAccessTokenRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.GenerateAccessTokenRequest', + ['workstation'] + ); + request.workstation = defaultValue1; + const expectedHeaderRequestParams = `workstation=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.workstations.v1.GenerateAccessTokenResponse() + ); + client.innerApiCalls.generateAccessToken = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateAccessToken( + request, + ( + err?: Error | null, + result?: protos.google.cloud.workstations.v1.IGenerateAccessTokenResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateAccessToken as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateAccessToken as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateAccessToken with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.GenerateAccessTokenRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.GenerateAccessTokenRequest', + ['workstation'] + ); + request.workstation = defaultValue1; + const expectedHeaderRequestParams = `workstation=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateAccessToken = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.generateAccessToken(request), expectedError); + const actualRequest = ( + client.innerApiCalls.generateAccessToken as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateAccessToken as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateAccessToken with closed client', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.GenerateAccessTokenRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.GenerateAccessTokenRequest', + ['workstation'] + ); + request.workstation = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.generateAccessToken(request), expectedError); + }); + }); + + describe('createWorkstationCluster', () => { + it('invokes createWorkstationCluster without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.CreateWorkstationClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.CreateWorkstationClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createWorkstationCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createWorkstationCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createWorkstationCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkstationCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWorkstationCluster without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.CreateWorkstationClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.CreateWorkstationClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createWorkstationCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createWorkstationCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createWorkstationCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkstationCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWorkstationCluster with call error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.CreateWorkstationClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.CreateWorkstationClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkstationCluster = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createWorkstationCluster(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createWorkstationCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkstationCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWorkstationCluster with LRO error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.CreateWorkstationClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.CreateWorkstationClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkstationCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createWorkstationCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createWorkstationCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkstationCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateWorkstationClusterProgress without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkCreateWorkstationClusterProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateWorkstationClusterProgress with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkCreateWorkstationClusterProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateWorkstationCluster', () => { + it('invokes updateWorkstationCluster without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.UpdateWorkstationClusterRequest() + ); + request.workstationCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.UpdateWorkstationClusterRequest', + ['workstationCluster', 'name'] + ); + request.workstationCluster.name = defaultValue1; + const expectedHeaderRequestParams = `workstation_cluster.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateWorkstationCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateWorkstationCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateWorkstationCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkstationCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWorkstationCluster without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.UpdateWorkstationClusterRequest() + ); + request.workstationCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.UpdateWorkstationClusterRequest', + ['workstationCluster', 'name'] + ); + request.workstationCluster.name = defaultValue1; + const expectedHeaderRequestParams = `workstation_cluster.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateWorkstationCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateWorkstationCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateWorkstationCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkstationCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWorkstationCluster with call error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.UpdateWorkstationClusterRequest() + ); + request.workstationCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.UpdateWorkstationClusterRequest', + ['workstationCluster', 'name'] + ); + request.workstationCluster.name = defaultValue1; + const expectedHeaderRequestParams = `workstation_cluster.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWorkstationCluster = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateWorkstationCluster(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateWorkstationCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkstationCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWorkstationCluster with LRO error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.UpdateWorkstationClusterRequest() + ); + request.workstationCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.UpdateWorkstationClusterRequest', + ['workstationCluster', 'name'] + ); + request.workstationCluster.name = defaultValue1; + const expectedHeaderRequestParams = `workstation_cluster.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWorkstationCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateWorkstationCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateWorkstationCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkstationCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateWorkstationClusterProgress without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkUpdateWorkstationClusterProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateWorkstationClusterProgress with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkUpdateWorkstationClusterProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteWorkstationCluster', () => { + it('invokes deleteWorkstationCluster without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.DeleteWorkstationClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.DeleteWorkstationClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteWorkstationCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteWorkstationCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteWorkstationCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkstationCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWorkstationCluster without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.DeleteWorkstationClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.DeleteWorkstationClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteWorkstationCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteWorkstationCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.workstations.v1.IWorkstationCluster, + protos.google.cloud.workstations.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteWorkstationCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkstationCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWorkstationCluster with call error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.DeleteWorkstationClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.DeleteWorkstationClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkstationCluster = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteWorkstationCluster(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteWorkstationCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkstationCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWorkstationCluster with LRO error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.DeleteWorkstationClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.DeleteWorkstationClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkstationCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteWorkstationCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteWorkstationCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkstationCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteWorkstationClusterProgress without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkDeleteWorkstationClusterProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteWorkstationClusterProgress with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkDeleteWorkstationClusterProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createWorkstationConfig', () => { + it('invokes createWorkstationConfig without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.CreateWorkstationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.CreateWorkstationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createWorkstationConfig = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createWorkstationConfig(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createWorkstationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkstationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWorkstationConfig without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.CreateWorkstationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.CreateWorkstationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createWorkstationConfig = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createWorkstationConfig( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createWorkstationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkstationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWorkstationConfig with call error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.CreateWorkstationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.CreateWorkstationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkstationConfig = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createWorkstationConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createWorkstationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkstationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWorkstationConfig with LRO error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.CreateWorkstationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.CreateWorkstationConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkstationConfig = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createWorkstationConfig(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createWorkstationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkstationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateWorkstationConfigProgress without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkCreateWorkstationConfigProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateWorkstationConfigProgress with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkCreateWorkstationConfigProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateWorkstationConfig', () => { + it('invokes updateWorkstationConfig without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.UpdateWorkstationConfigRequest() + ); + request.workstationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.UpdateWorkstationConfigRequest', + ['workstationConfig', 'name'] + ); + request.workstationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `workstation_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateWorkstationConfig = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateWorkstationConfig(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateWorkstationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkstationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWorkstationConfig without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.UpdateWorkstationConfigRequest() + ); + request.workstationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.UpdateWorkstationConfigRequest', + ['workstationConfig', 'name'] + ); + request.workstationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `workstation_config.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateWorkstationConfig = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateWorkstationConfig( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateWorkstationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkstationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWorkstationConfig with call error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.UpdateWorkstationConfigRequest() + ); + request.workstationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.UpdateWorkstationConfigRequest', + ['workstationConfig', 'name'] + ); + request.workstationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `workstation_config.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWorkstationConfig = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateWorkstationConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateWorkstationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkstationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWorkstationConfig with LRO error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.UpdateWorkstationConfigRequest() + ); + request.workstationConfig ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.UpdateWorkstationConfigRequest', + ['workstationConfig', 'name'] + ); + request.workstationConfig.name = defaultValue1; + const expectedHeaderRequestParams = `workstation_config.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWorkstationConfig = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateWorkstationConfig(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateWorkstationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkstationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateWorkstationConfigProgress without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkUpdateWorkstationConfigProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateWorkstationConfigProgress with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkUpdateWorkstationConfigProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteWorkstationConfig', () => { + it('invokes deleteWorkstationConfig without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.DeleteWorkstationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.DeleteWorkstationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteWorkstationConfig = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteWorkstationConfig(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteWorkstationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkstationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWorkstationConfig without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.DeleteWorkstationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.DeleteWorkstationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteWorkstationConfig = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteWorkstationConfig( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.workstations.v1.IWorkstationConfig, + protos.google.cloud.workstations.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteWorkstationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkstationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWorkstationConfig with call error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.DeleteWorkstationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.DeleteWorkstationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkstationConfig = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteWorkstationConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteWorkstationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkstationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWorkstationConfig with LRO error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.DeleteWorkstationConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.DeleteWorkstationConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkstationConfig = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteWorkstationConfig(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteWorkstationConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkstationConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteWorkstationConfigProgress without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkDeleteWorkstationConfigProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteWorkstationConfigProgress with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkDeleteWorkstationConfigProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createWorkstation', () => { + it('invokes createWorkstation without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.CreateWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.CreateWorkstationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createWorkstation = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createWorkstation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWorkstation without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.CreateWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.CreateWorkstationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createWorkstation = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createWorkstation( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWorkstation with call error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.CreateWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.CreateWorkstationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkstation = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createWorkstation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createWorkstation with LRO error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.CreateWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.CreateWorkstationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createWorkstation = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createWorkstation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateWorkstationProgress without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkCreateWorkstationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateWorkstationProgress with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkCreateWorkstationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateWorkstation', () => { + it('invokes updateWorkstation without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.UpdateWorkstationRequest() + ); + request.workstation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.UpdateWorkstationRequest', + ['workstation', 'name'] + ); + request.workstation.name = defaultValue1; + const expectedHeaderRequestParams = `workstation.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateWorkstation = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateWorkstation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWorkstation without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.UpdateWorkstationRequest() + ); + request.workstation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.UpdateWorkstationRequest', + ['workstation', 'name'] + ); + request.workstation.name = defaultValue1; + const expectedHeaderRequestParams = `workstation.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateWorkstation = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateWorkstation( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWorkstation with call error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.UpdateWorkstationRequest() + ); + request.workstation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.UpdateWorkstationRequest', + ['workstation', 'name'] + ); + request.workstation.name = defaultValue1; + const expectedHeaderRequestParams = `workstation.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWorkstation = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateWorkstation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateWorkstation with LRO error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.UpdateWorkstationRequest() + ); + request.workstation ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.UpdateWorkstationRequest', + ['workstation', 'name'] + ); + request.workstation.name = defaultValue1; + const expectedHeaderRequestParams = `workstation.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateWorkstation = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateWorkstation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateWorkstationProgress without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkUpdateWorkstationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateWorkstationProgress with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkUpdateWorkstationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteWorkstation', () => { + it('invokes deleteWorkstation without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.DeleteWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.DeleteWorkstationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteWorkstation = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteWorkstation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWorkstation without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.DeleteWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.DeleteWorkstationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteWorkstation = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteWorkstation( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWorkstation with call error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.DeleteWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.DeleteWorkstationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkstation = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteWorkstation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteWorkstation with LRO error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.DeleteWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.DeleteWorkstationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteWorkstation = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteWorkstation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteWorkstationProgress without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkDeleteWorkstationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteWorkstationProgress with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkDeleteWorkstationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('startWorkstation', () => { + it('invokes startWorkstation without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.StartWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.StartWorkstationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startWorkstation = + stubLongRunningCall(expectedResponse); + const [operation] = await client.startWorkstation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startWorkstation without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.StartWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.StartWorkstationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.startWorkstation = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.startWorkstation( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.startWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startWorkstation with call error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.StartWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.StartWorkstationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startWorkstation = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.startWorkstation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.startWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes startWorkstation with LRO error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.StartWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.StartWorkstationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.startWorkstation = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.startWorkstation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.startWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.startWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkStartWorkstationProgress without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkStartWorkstationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkStartWorkstationProgress with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkStartWorkstationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('stopWorkstation', () => { + it('invokes stopWorkstation without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.StopWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.StopWorkstationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.stopWorkstation = + stubLongRunningCall(expectedResponse); + const [operation] = await client.stopWorkstation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopWorkstation without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.StopWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.StopWorkstationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.stopWorkstation = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.stopWorkstation( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.workstations.v1.IWorkstation, + protos.google.cloud.workstations.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.stopWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopWorkstation with call error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.StopWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.StopWorkstationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopWorkstation = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.stopWorkstation(request), expectedError); + const actualRequest = ( + client.innerApiCalls.stopWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes stopWorkstation with LRO error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.StopWorkstationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.StopWorkstationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.stopWorkstation = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.stopWorkstation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.stopWorkstation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.stopWorkstation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkStopWorkstationProgress without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkStopWorkstationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkStopWorkstationProgress with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + 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.checkStopWorkstationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listWorkstationClusters', () => { + it('invokes listWorkstationClusters without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationCluster() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationCluster() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationCluster() + ), + ]; + client.innerApiCalls.listWorkstationClusters = + stubSimpleCall(expectedResponse); + const [response] = await client.listWorkstationClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listWorkstationClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWorkstationClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWorkstationClusters without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationCluster() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationCluster() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationCluster() + ), + ]; + client.innerApiCalls.listWorkstationClusters = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listWorkstationClusters( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.workstations.v1.IWorkstationCluster[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listWorkstationClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWorkstationClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWorkstationClusters with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listWorkstationClusters = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listWorkstationClusters(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listWorkstationClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWorkstationClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWorkstationClustersStream without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationCluster() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationCluster() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationCluster() + ), + ]; + client.descriptors.page.listWorkstationClusters.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listWorkstationClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.workstations.v1.WorkstationCluster[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.workstations.v1.WorkstationCluster + ) => { + 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.listWorkstationClusters + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listWorkstationClusters, request) + ); + assert( + ( + client.descriptors.page.listWorkstationClusters + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listWorkstationClustersStream with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkstationClusters.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listWorkstationClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.workstations.v1.WorkstationCluster[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.workstations.v1.WorkstationCluster + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listWorkstationClusters + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listWorkstationClusters, request) + ); + assert( + ( + client.descriptors.page.listWorkstationClusters + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listWorkstationClusters without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationCluster() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationCluster() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationCluster() + ), + ]; + client.descriptors.page.listWorkstationClusters.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.workstations.v1.IWorkstationCluster[] = + []; + const iterable = client.listWorkstationClustersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listWorkstationClusters + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listWorkstationClusters + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listWorkstationClusters with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkstationClusters.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listWorkstationClustersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.workstations.v1.IWorkstationCluster[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listWorkstationClusters + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listWorkstationClusters + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listWorkstationConfigs', () => { + it('invokes listWorkstationConfigs without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + ]; + client.innerApiCalls.listWorkstationConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.listWorkstationConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listWorkstationConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWorkstationConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWorkstationConfigs without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + ]; + client.innerApiCalls.listWorkstationConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listWorkstationConfigs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.workstations.v1.IWorkstationConfig[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listWorkstationConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWorkstationConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWorkstationConfigs with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listWorkstationConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listWorkstationConfigs(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listWorkstationConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWorkstationConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWorkstationConfigsStream without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + ]; + client.descriptors.page.listWorkstationConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listWorkstationConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.workstations.v1.WorkstationConfig[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.workstations.v1.WorkstationConfig) => { + 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.listWorkstationConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listWorkstationConfigs, request) + ); + assert( + ( + client.descriptors.page.listWorkstationConfigs + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listWorkstationConfigsStream with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkstationConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listWorkstationConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.workstations.v1.WorkstationConfig[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.workstations.v1.WorkstationConfig) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listWorkstationConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listWorkstationConfigs, request) + ); + assert( + ( + client.descriptors.page.listWorkstationConfigs + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listWorkstationConfigs without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + ]; + client.descriptors.page.listWorkstationConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.workstations.v1.IWorkstationConfig[] = + []; + const iterable = client.listWorkstationConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listWorkstationConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listWorkstationConfigs + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listWorkstationConfigs with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkstationConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listWorkstationConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.workstations.v1.IWorkstationConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listWorkstationConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listWorkstationConfigs + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listUsableWorkstationConfigs', () => { + it('invokes listUsableWorkstationConfigs without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + ]; + client.innerApiCalls.listUsableWorkstationConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.listUsableWorkstationConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listUsableWorkstationConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listUsableWorkstationConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsableWorkstationConfigs without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + ]; + client.innerApiCalls.listUsableWorkstationConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listUsableWorkstationConfigs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.workstations.v1.IWorkstationConfig[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listUsableWorkstationConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listUsableWorkstationConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsableWorkstationConfigs with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listUsableWorkstationConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listUsableWorkstationConfigs(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listUsableWorkstationConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listUsableWorkstationConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsableWorkstationConfigsStream without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + ]; + client.descriptors.page.listUsableWorkstationConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listUsableWorkstationConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.workstations.v1.WorkstationConfig[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.workstations.v1.WorkstationConfig) => { + 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.listUsableWorkstationConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listUsableWorkstationConfigs, + request + ) + ); + assert( + ( + client.descriptors.page.listUsableWorkstationConfigs + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listUsableWorkstationConfigsStream with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsableWorkstationConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listUsableWorkstationConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.workstations.v1.WorkstationConfig[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.workstations.v1.WorkstationConfig) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listUsableWorkstationConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith( + client.innerApiCalls.listUsableWorkstationConfigs, + request + ) + ); + assert( + ( + client.descriptors.page.listUsableWorkstationConfigs + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsableWorkstationConfigs without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.WorkstationConfig() + ), + ]; + client.descriptors.page.listUsableWorkstationConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.workstations.v1.IWorkstationConfig[] = + []; + const iterable = client.listUsableWorkstationConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listUsableWorkstationConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listUsableWorkstationConfigs + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsableWorkstationConfigs with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsableWorkstationConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listUsableWorkstationConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.workstations.v1.IWorkstationConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listUsableWorkstationConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listUsableWorkstationConfigs + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listWorkstations', () => { + it('invokes listWorkstations without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + ]; + client.innerApiCalls.listWorkstations = stubSimpleCall(expectedResponse); + const [response] = await client.listWorkstations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listWorkstations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWorkstations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWorkstations without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + ]; + client.innerApiCalls.listWorkstations = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listWorkstations( + request, + ( + err?: Error | null, + result?: protos.google.cloud.workstations.v1.IWorkstation[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listWorkstations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWorkstations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWorkstations with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listWorkstations = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listWorkstations(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listWorkstations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listWorkstations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listWorkstationsStream without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + ]; + client.descriptors.page.listWorkstations.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listWorkstationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.workstations.v1.Workstation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.workstations.v1.Workstation) => { + 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.listWorkstations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listWorkstations, request) + ); + assert( + (client.descriptors.page.listWorkstations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listWorkstationsStream with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkstations.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listWorkstationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.workstations.v1.Workstation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.workstations.v1.Workstation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listWorkstations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listWorkstations, request) + ); + assert( + (client.descriptors.page.listWorkstations.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listWorkstations without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + ]; + client.descriptors.page.listWorkstations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.workstations.v1.IWorkstation[] = []; + const iterable = client.listWorkstationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listWorkstations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listWorkstations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listWorkstations with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListWorkstationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListWorkstationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listWorkstations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listWorkstationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.workstations.v1.IWorkstation[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listWorkstations.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listWorkstations.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listUsableWorkstations', () => { + it('invokes listUsableWorkstations without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListUsableWorkstationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListUsableWorkstationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + ]; + client.innerApiCalls.listUsableWorkstations = + stubSimpleCall(expectedResponse); + const [response] = await client.listUsableWorkstations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listUsableWorkstations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listUsableWorkstations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsableWorkstations without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListUsableWorkstationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListUsableWorkstationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + ]; + client.innerApiCalls.listUsableWorkstations = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listUsableWorkstations( + request, + ( + err?: Error | null, + result?: protos.google.cloud.workstations.v1.IWorkstation[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listUsableWorkstations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listUsableWorkstations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsableWorkstations with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListUsableWorkstationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListUsableWorkstationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listUsableWorkstations = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listUsableWorkstations(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listUsableWorkstations as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listUsableWorkstations as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listUsableWorkstationsStream without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListUsableWorkstationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListUsableWorkstationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + ]; + client.descriptors.page.listUsableWorkstations.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listUsableWorkstationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.workstations.v1.Workstation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.workstations.v1.Workstation) => { + 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.listUsableWorkstations + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listUsableWorkstations, request) + ); + assert( + ( + client.descriptors.page.listUsableWorkstations + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listUsableWorkstationsStream with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListUsableWorkstationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListUsableWorkstationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsableWorkstations.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listUsableWorkstationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.workstations.v1.Workstation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.workstations.v1.Workstation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listUsableWorkstations + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listUsableWorkstations, request) + ); + assert( + ( + client.descriptors.page.listUsableWorkstations + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsableWorkstations without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListUsableWorkstationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListUsableWorkstationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + generateSampleMessage( + new protos.google.cloud.workstations.v1.Workstation() + ), + ]; + client.descriptors.page.listUsableWorkstations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.workstations.v1.IWorkstation[] = []; + const iterable = client.listUsableWorkstationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listUsableWorkstations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listUsableWorkstations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listUsableWorkstations with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.workstations.v1.ListUsableWorkstationsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.workstations.v1.ListUsableWorkstationsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listUsableWorkstations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listUsableWorkstationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.workstations.v1.IWorkstation[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listUsableWorkstations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listUsableWorkstations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('workstation', () => { + const fakePath = '/rendered/path/workstation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + workstation_cluster: 'workstationClusterValue', + workstation_config: 'workstationConfigValue', + workstation: 'workstationValue', + }; + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.workstationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.workstationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('workstationPath', () => { + const result = client.workstationPath( + 'projectValue', + 'locationValue', + 'workstationClusterValue', + 'workstationConfigValue', + 'workstationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.workstationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromWorkstationName', () => { + const result = client.matchProjectFromWorkstationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.workstationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromWorkstationName', () => { + const result = client.matchLocationFromWorkstationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.workstationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchWorkstationClusterFromWorkstationName', () => { + const result = + client.matchWorkstationClusterFromWorkstationName(fakePath); + assert.strictEqual(result, 'workstationClusterValue'); + assert( + (client.pathTemplates.workstationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchWorkstationConfigFromWorkstationName', () => { + const result = + client.matchWorkstationConfigFromWorkstationName(fakePath); + assert.strictEqual(result, 'workstationConfigValue'); + assert( + (client.pathTemplates.workstationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchWorkstationFromWorkstationName', () => { + const result = client.matchWorkstationFromWorkstationName(fakePath); + assert.strictEqual(result, 'workstationValue'); + assert( + (client.pathTemplates.workstationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('workstationCluster', () => { + const fakePath = '/rendered/path/workstationCluster'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + workstation_cluster: 'workstationClusterValue', + }; + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.workstationClusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.workstationClusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('workstationClusterPath', () => { + const result = client.workstationClusterPath( + 'projectValue', + 'locationValue', + 'workstationClusterValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.workstationClusterPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromWorkstationClusterName', () => { + const result = client.matchProjectFromWorkstationClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.workstationClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromWorkstationClusterName', () => { + const result = client.matchLocationFromWorkstationClusterName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.workstationClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchWorkstationClusterFromWorkstationClusterName', () => { + const result = + client.matchWorkstationClusterFromWorkstationClusterName(fakePath); + assert.strictEqual(result, 'workstationClusterValue'); + assert( + ( + client.pathTemplates.workstationClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('workstationConfig', () => { + const fakePath = '/rendered/path/workstationConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + workstation_cluster: 'workstationClusterValue', + workstation_config: 'workstationConfigValue', + }; + const client = new workstationsModule.v1.WorkstationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.workstationConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.workstationConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('workstationConfigPath', () => { + const result = client.workstationConfigPath( + 'projectValue', + 'locationValue', + 'workstationClusterValue', + 'workstationConfigValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.workstationConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromWorkstationConfigName', () => { + const result = client.matchProjectFromWorkstationConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.workstationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromWorkstationConfigName', () => { + const result = client.matchLocationFromWorkstationConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.workstationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchWorkstationClusterFromWorkstationConfigName', () => { + const result = + client.matchWorkstationClusterFromWorkstationConfigName(fakePath); + assert.strictEqual(result, 'workstationClusterValue'); + assert( + ( + client.pathTemplates.workstationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchWorkstationConfigFromWorkstationConfigName', () => { + const result = + client.matchWorkstationConfigFromWorkstationConfigName(fakePath); + assert.strictEqual(result, 'workstationConfigValue'); + assert( + ( + client.pathTemplates.workstationConfigPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); From 8feed0b5a0efd92744d5296fef21f4b7741f3764 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 7 Apr 2023 21:49:32 -0700 Subject: [PATCH 2/2] feat: [security] added ignore_dependent_resources to DeleteCaPoolRequest, DeleteCertificateAuthorityRequest, DisableCertificateAuthorityRequest (#4152) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: added ignore_dependent_resources to DeleteCaPoolRequest, DeleteCertificateAuthorityRequest, DisableCertificateAuthorityRequest PiperOrigin-RevId: 522096199 Source-Link: https://github.com/googleapis/googleapis/commit/d9592ed448f89a398fac1a613b22d81a1f5f7ffe Source-Link: https://github.com/googleapis/googleapis-gen/commit/0ab428e3934981db9c8c7bf17b1fea5d74682afb Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXNlY3VyaXR5LXByaXZhdGVjYS8uT3dsQm90LnlhbWwiLCJoIjoiMGFiNDI4ZTM5MzQ5ODFkYjljOGM3YmYxN2IxZmVhNWQ3NDY4MmFmYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- .../security/privateca/v1/resources.proto | 4 +- .../cloud/security/privateca/v1/service.proto | 21 +++++- .../protos/protos.d.ts | 18 +++++ .../protos/protos.js | 69 +++++++++++++++++++ .../protos/protos.json | 21 ++++++ ...ficate_authority_service.delete_ca_pool.js | 7 ++ ...ty_service.delete_certificate_authority.js | 7 ++ ...y_service.disable_certificate_authority.js | 7 ++ ...ta.google.cloud.security.privateca.v1.json | 20 ++++-- ...ogle.cloud.security.privateca.v1beta1.json | 2 +- .../certificate_authority_service_client.ts | 15 ++++ 11 files changed, 183 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/resources.proto b/packages/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/resources.proto index 2e346af28ae..b64be7bc73f 100644 --- a/packages/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/resources.proto +++ b/packages/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -1431,7 +1431,7 @@ enum SubjectRequestMode { DEFAULT = 1; // A mode reserved for special cases. Indicates that the certificate should - // have one or more SPIFFE + // have one SPIFFE // [SubjectAltNames][google.cloud.security.privateca.v1.SubjectAltNames] set // by the service based on the caller's identity. This mode will ignore any // explicitly specified [Subject][google.cloud.security.privateca.v1.Subject] diff --git a/packages/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/service.proto b/packages/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/service.proto index 7ff8b8d248c..b90a374d6e4 100644 --- a/packages/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/service.proto +++ b/packages/google-cloud-security-privateca/protos/google/cloud/security/privateca/v1/service.proto @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/security/privateca/v1/resources.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -720,6 +721,12 @@ message DisableCertificateAuthorityRequest { // The request ID must be a valid UUID with the exception that zero UUID is // not supported (00000000-0000-0000-0000-000000000000). string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This field allows this CA to be disabled even if it's being + // depended on by another resource. However, doing so may result in unintended + // and unrecoverable effects on any dependent resource(s) since the CA will + // no longer be able to issue certificates. + bool ignore_dependent_resources = 3 [(google.api.field_behavior) = OPTIONAL]; } // Request message for @@ -903,6 +910,12 @@ message DeleteCertificateAuthorityRequest { // soon as possible without a 30-day grace period where undeletion would have // been allowed. If you proceed, there will be no way to recover this CA. bool skip_grace_period = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This field allows this ca to be deleted even if it's being + // depended on by another resource. However, doing so may result in unintended + // and unrecoverable effects on any dependent resource(s) since the CA will + // no longer be able to issue certificates. + bool ignore_dependent_resources = 6 [(google.api.field_behavior) = OPTIONAL]; } // Request message for @@ -1025,6 +1038,12 @@ message DeleteCaPoolRequest { // The request ID must be a valid UUID with the exception that zero UUID is // not supported (00000000-0000-0000-0000-000000000000). string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This field allows this pool to be deleted even if it's being + // depended on by another resource. However, doing so may result in unintended + // and unrecoverable effects on any dependent resource(s) since the pool will + // no longer be able to issue certificates. + bool ignore_dependent_resources = 4 [(google.api.field_behavior) = OPTIONAL]; } // Request message for diff --git a/packages/google-cloud-security-privateca/protos/protos.d.ts b/packages/google-cloud-security-privateca/protos/protos.d.ts index 4028729b926..61df49d732b 100644 --- a/packages/google-cloud-security-privateca/protos/protos.d.ts +++ b/packages/google-cloud-security-privateca/protos/protos.d.ts @@ -5969,6 +5969,9 @@ export namespace google { /** DisableCertificateAuthorityRequest requestId */ requestId?: (string|null); + + /** DisableCertificateAuthorityRequest ignoreDependentResources */ + ignoreDependentResources?: (boolean|null); } /** Represents a DisableCertificateAuthorityRequest. */ @@ -5986,6 +5989,9 @@ export namespace google { /** DisableCertificateAuthorityRequest requestId. */ public requestId: string; + /** DisableCertificateAuthorityRequest ignoreDependentResources. */ + public ignoreDependentResources: boolean; + /** * Creates a new DisableCertificateAuthorityRequest instance using the specified properties. * @param [properties] Properties to set @@ -6805,6 +6811,9 @@ export namespace google { /** DeleteCertificateAuthorityRequest skipGracePeriod */ skipGracePeriod?: (boolean|null); + + /** DeleteCertificateAuthorityRequest ignoreDependentResources */ + ignoreDependentResources?: (boolean|null); } /** Represents a DeleteCertificateAuthorityRequest. */ @@ -6828,6 +6837,9 @@ export namespace google { /** DeleteCertificateAuthorityRequest skipGracePeriod. */ public skipGracePeriod: boolean; + /** DeleteCertificateAuthorityRequest ignoreDependentResources. */ + public ignoreDependentResources: boolean; + /** * Creates a new DeleteCertificateAuthorityRequest instance using the specified properties. * @param [properties] Properties to set @@ -7247,6 +7259,9 @@ export namespace google { /** DeleteCaPoolRequest requestId */ requestId?: (string|null); + + /** DeleteCaPoolRequest ignoreDependentResources */ + ignoreDependentResources?: (boolean|null); } /** Represents a DeleteCaPoolRequest. */ @@ -7264,6 +7279,9 @@ export namespace google { /** DeleteCaPoolRequest requestId. */ public requestId: string; + /** DeleteCaPoolRequest ignoreDependentResources. */ + public ignoreDependentResources: boolean; + /** * Creates a new DeleteCaPoolRequest instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-cloud-security-privateca/protos/protos.js b/packages/google-cloud-security-privateca/protos/protos.js index 6cfadbc42a9..d8781e003e8 100644 --- a/packages/google-cloud-security-privateca/protos/protos.js +++ b/packages/google-cloud-security-privateca/protos/protos.js @@ -15345,6 +15345,7 @@ * @interface IDisableCertificateAuthorityRequest * @property {string|null} [name] DisableCertificateAuthorityRequest name * @property {string|null} [requestId] DisableCertificateAuthorityRequest requestId + * @property {boolean|null} [ignoreDependentResources] DisableCertificateAuthorityRequest ignoreDependentResources */ /** @@ -15378,6 +15379,14 @@ */ DisableCertificateAuthorityRequest.prototype.requestId = ""; + /** + * DisableCertificateAuthorityRequest ignoreDependentResources. + * @member {boolean} ignoreDependentResources + * @memberof google.cloud.security.privateca.v1.DisableCertificateAuthorityRequest + * @instance + */ + DisableCertificateAuthorityRequest.prototype.ignoreDependentResources = false; + /** * Creates a new DisableCertificateAuthorityRequest instance using the specified properties. * @function create @@ -15406,6 +15415,8 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.ignoreDependentResources != null && Object.hasOwnProperty.call(message, "ignoreDependentResources")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.ignoreDependentResources); return writer; }; @@ -15448,6 +15459,10 @@ message.requestId = reader.string(); break; } + case 3: { + message.ignoreDependentResources = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -15489,6 +15504,9 @@ if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; + if (message.ignoreDependentResources != null && message.hasOwnProperty("ignoreDependentResources")) + if (typeof message.ignoreDependentResources !== "boolean") + return "ignoreDependentResources: boolean expected"; return null; }; @@ -15508,6 +15526,8 @@ message.name = String(object.name); if (object.requestId != null) message.requestId = String(object.requestId); + if (object.ignoreDependentResources != null) + message.ignoreDependentResources = Boolean(object.ignoreDependentResources); return message; }; @@ -15527,11 +15547,14 @@ if (options.defaults) { object.name = ""; object.requestId = ""; + object.ignoreDependentResources = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; + if (message.ignoreDependentResources != null && message.hasOwnProperty("ignoreDependentResources")) + object.ignoreDependentResources = message.ignoreDependentResources; return object; }; @@ -17221,6 +17244,7 @@ * @property {string|null} [requestId] DeleteCertificateAuthorityRequest requestId * @property {boolean|null} [ignoreActiveCertificates] DeleteCertificateAuthorityRequest ignoreActiveCertificates * @property {boolean|null} [skipGracePeriod] DeleteCertificateAuthorityRequest skipGracePeriod + * @property {boolean|null} [ignoreDependentResources] DeleteCertificateAuthorityRequest ignoreDependentResources */ /** @@ -17270,6 +17294,14 @@ */ DeleteCertificateAuthorityRequest.prototype.skipGracePeriod = false; + /** + * DeleteCertificateAuthorityRequest ignoreDependentResources. + * @member {boolean} ignoreDependentResources + * @memberof google.cloud.security.privateca.v1.DeleteCertificateAuthorityRequest + * @instance + */ + DeleteCertificateAuthorityRequest.prototype.ignoreDependentResources = false; + /** * Creates a new DeleteCertificateAuthorityRequest instance using the specified properties. * @function create @@ -17302,6 +17334,8 @@ writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ignoreActiveCertificates); if (message.skipGracePeriod != null && Object.hasOwnProperty.call(message, "skipGracePeriod")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.skipGracePeriod); + if (message.ignoreDependentResources != null && Object.hasOwnProperty.call(message, "ignoreDependentResources")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.ignoreDependentResources); return writer; }; @@ -17352,6 +17386,10 @@ message.skipGracePeriod = reader.bool(); break; } + case 6: { + message.ignoreDependentResources = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -17399,6 +17437,9 @@ if (message.skipGracePeriod != null && message.hasOwnProperty("skipGracePeriod")) if (typeof message.skipGracePeriod !== "boolean") return "skipGracePeriod: boolean expected"; + if (message.ignoreDependentResources != null && message.hasOwnProperty("ignoreDependentResources")) + if (typeof message.ignoreDependentResources !== "boolean") + return "ignoreDependentResources: boolean expected"; return null; }; @@ -17422,6 +17463,8 @@ message.ignoreActiveCertificates = Boolean(object.ignoreActiveCertificates); if (object.skipGracePeriod != null) message.skipGracePeriod = Boolean(object.skipGracePeriod); + if (object.ignoreDependentResources != null) + message.ignoreDependentResources = Boolean(object.ignoreDependentResources); return message; }; @@ -17443,6 +17486,7 @@ object.requestId = ""; object.ignoreActiveCertificates = false; object.skipGracePeriod = false; + object.ignoreDependentResources = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -17452,6 +17496,8 @@ object.ignoreActiveCertificates = message.ignoreActiveCertificates; if (message.skipGracePeriod != null && message.hasOwnProperty("skipGracePeriod")) object.skipGracePeriod = message.skipGracePeriod; + if (message.ignoreDependentResources != null && message.hasOwnProperty("ignoreDependentResources")) + object.ignoreDependentResources = message.ignoreDependentResources; return object; }; @@ -18290,6 +18336,7 @@ * @interface IDeleteCaPoolRequest * @property {string|null} [name] DeleteCaPoolRequest name * @property {string|null} [requestId] DeleteCaPoolRequest requestId + * @property {boolean|null} [ignoreDependentResources] DeleteCaPoolRequest ignoreDependentResources */ /** @@ -18323,6 +18370,14 @@ */ DeleteCaPoolRequest.prototype.requestId = ""; + /** + * DeleteCaPoolRequest ignoreDependentResources. + * @member {boolean} ignoreDependentResources + * @memberof google.cloud.security.privateca.v1.DeleteCaPoolRequest + * @instance + */ + DeleteCaPoolRequest.prototype.ignoreDependentResources = false; + /** * Creates a new DeleteCaPoolRequest instance using the specified properties. * @function create @@ -18351,6 +18406,8 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.ignoreDependentResources != null && Object.hasOwnProperty.call(message, "ignoreDependentResources")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.ignoreDependentResources); return writer; }; @@ -18393,6 +18450,10 @@ message.requestId = reader.string(); break; } + case 4: { + message.ignoreDependentResources = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -18434,6 +18495,9 @@ if (message.requestId != null && message.hasOwnProperty("requestId")) if (!$util.isString(message.requestId)) return "requestId: string expected"; + if (message.ignoreDependentResources != null && message.hasOwnProperty("ignoreDependentResources")) + if (typeof message.ignoreDependentResources !== "boolean") + return "ignoreDependentResources: boolean expected"; return null; }; @@ -18453,6 +18517,8 @@ message.name = String(object.name); if (object.requestId != null) message.requestId = String(object.requestId); + if (object.ignoreDependentResources != null) + message.ignoreDependentResources = Boolean(object.ignoreDependentResources); return message; }; @@ -18472,11 +18538,14 @@ if (options.defaults) { object.name = ""; object.requestId = ""; + object.ignoreDependentResources = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.requestId != null && message.hasOwnProperty("requestId")) object.requestId = message.requestId; + if (message.ignoreDependentResources != null && message.hasOwnProperty("ignoreDependentResources")) + object.ignoreDependentResources = message.ignoreDependentResources; return object; }; diff --git a/packages/google-cloud-security-privateca/protos/protos.json b/packages/google-cloud-security-privateca/protos/protos.json index 1c541a3ef7f..82212527dde 100644 --- a/packages/google-cloud-security-privateca/protos/protos.json +++ b/packages/google-cloud-security-privateca/protos/protos.json @@ -2254,6 +2254,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "ignoreDependentResources": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -2418,6 +2425,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "ignoreDependentResources": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -2520,6 +2534,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "ignoreDependentResources": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, diff --git a/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_ca_pool.js b/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_ca_pool.js index 2b85c08dccb..c30b6b35e7b 100644 --- a/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_ca_pool.js +++ b/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_ca_pool.js @@ -48,6 +48,13 @@ function main(name) { * not supported (00000000-0000-0000-0000-000000000000). */ // const requestId = 'abc123' + /** + * Optional. This field allows this pool to be deleted even if it's being + * depended on by another resource. However, doing so may result in unintended + * and unrecoverable effects on any dependent resource(s) since the pool will + * no longer be able to issue certificates. + */ + // const ignoreDependentResources = true // Imports the Privateca library const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; diff --git a/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_authority.js b/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_authority.js index 9662247bed1..5613ee70043 100644 --- a/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_authority.js +++ b/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.delete_certificate_authority.js @@ -59,6 +59,13 @@ function main(name) { * been allowed. If you proceed, there will be no way to recover this CA. */ // const skipGracePeriod = true + /** + * Optional. This field allows this ca to be deleted even if it's being + * depended on by another resource. However, doing so may result in unintended + * and unrecoverable effects on any dependent resource(s) since the CA will + * no longer be able to issue certificates. + */ + // const ignoreDependentResources = true // Imports the Privateca library const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; diff --git a/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.disable_certificate_authority.js b/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.disable_certificate_authority.js index 88c3ea36a2e..bb5335c9437 100644 --- a/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.disable_certificate_authority.js +++ b/packages/google-cloud-security-privateca/samples/generated/v1/certificate_authority_service.disable_certificate_authority.js @@ -48,6 +48,13 @@ function main(name) { * not supported (00000000-0000-0000-0000-000000000000). */ // const requestId = 'abc123' + /** + * Optional. This field allows this CA to be disabled even if it's being + * depended on by another resource. However, doing so may result in unintended + * and unrecoverable effects on any dependent resource(s) since the CA will + * no longer be able to issue certificates. + */ + // const ignoreDependentResources = true // Imports the Privateca library const {CertificateAuthorityServiceClient} = require('@google-cloud/security-private-ca').v1; diff --git a/packages/google-cloud-security-privateca/samples/generated/v1/snippet_metadata.google.cloud.security.privateca.v1.json b/packages/google-cloud-security-privateca/samples/generated/v1/snippet_metadata.google.cloud.security.privateca.v1.json index 475df11ed12..b92b2d8d91a 100644 --- a/packages/google-cloud-security-privateca/samples/generated/v1/snippet_metadata.google.cloud.security.privateca.v1.json +++ b/packages/google-cloud-security-privateca/samples/generated/v1/snippet_metadata.google.cloud.security.privateca.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-privateca", - "version": "4.2.0", + "version": "4.3.0", "language": "TYPESCRIPT", "apis": [ { @@ -378,7 +378,7 @@ "segments": [ { "start": 25, - "end": 70, + "end": 77, "type": "FULL" } ], @@ -394,6 +394,10 @@ { "name": "request_id", "type": "TYPE_STRING" + }, + { + "name": "ignore_dependent_resources", + "type": "TYPE_BOOL" } ], "resultType": ".google.longrunning.Operation", @@ -646,7 +650,7 @@ "segments": [ { "start": 25, - "end": 81, + "end": 88, "type": "FULL" } ], @@ -670,6 +674,10 @@ { "name": "skip_grace_period", "type": "TYPE_BOOL" + }, + { + "name": "ignore_dependent_resources", + "type": "TYPE_BOOL" } ], "resultType": ".google.longrunning.Operation", @@ -942,7 +950,7 @@ "segments": [ { "start": 25, - "end": 70, + "end": 77, "type": "FULL" } ], @@ -958,6 +966,10 @@ { "name": "request_id", "type": "TYPE_STRING" + }, + { + "name": "ignore_dependent_resources", + "type": "TYPE_BOOL" } ], "resultType": ".google.longrunning.Operation", diff --git a/packages/google-cloud-security-privateca/samples/generated/v1beta1/snippet_metadata.google.cloud.security.privateca.v1beta1.json b/packages/google-cloud-security-privateca/samples/generated/v1beta1/snippet_metadata.google.cloud.security.privateca.v1beta1.json index 8db85e71689..bfa9e6a95a6 100644 --- a/packages/google-cloud-security-privateca/samples/generated/v1beta1/snippet_metadata.google.cloud.security.privateca.v1beta1.json +++ b/packages/google-cloud-security-privateca/samples/generated/v1beta1/snippet_metadata.google.cloud.security.privateca.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-privateca", - "version": "4.2.0", + "version": "4.3.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts b/packages/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts index c2a52e2601a..d61307af585 100644 --- a/packages/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts +++ b/packages/google-cloud-security-privateca/src/v1/certificate_authority_service_client.ts @@ -2189,6 +2189,11 @@ export class CertificateAuthorityServiceClient { * * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.ignoreDependentResources] + * Optional. This field allows this CA to be disabled even if it's being + * depended on by another resource. However, doing so may result in unintended + * and unrecoverable effects on any dependent resource(s) since the CA will + * no longer be able to issue certificates. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2674,6 +2679,11 @@ export class CertificateAuthorityServiceClient { * Optional. If this flag is set, the Certificate Authority will be deleted as * soon as possible without a 30-day grace period where undeletion would have * been allowed. If you proceed, there will be no way to recover this CA. + * @param {boolean} [request.ignoreDependentResources] + * Optional. This field allows this ca to be deleted even if it's being + * depended on by another resource. However, doing so may result in unintended + * and unrecoverable effects on any dependent resource(s) since the CA will + * no longer be able to issue certificates. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -3308,6 +3318,11 @@ export class CertificateAuthorityServiceClient { * * The request ID must be a valid UUID with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.ignoreDependentResources] + * Optional. This field allows this pool to be deleted even if it's being + * depended on by another resource. However, doing so may result in unintended + * and unrecoverable effects on any dependent resource(s) since the pool will + * no longer be able to issue certificates. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array.