# frozen_string_literal: true # Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! require "google/cloud/workstations/v1/workstations_pb" module Google module Cloud module Workstations module V1 module Workstations module Rest ## # REST service stub for the Workstations service. # Service stub contains baseline method implementations # including transcoding, making the REST call, and deserialing the response. # class ServiceStub def initialize endpoint:, endpoint_template:, universe_domain:, credentials: # These require statements are intentionally placed here to initialize # the REST modules only when it's required. require "gapic/rest" @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, endpoint_template: endpoint_template, universe_domain: universe_domain, credentials: credentials, numeric_enums: true, raise_faraday_errors: false end ## # The effective universe domain # # @return [String] # def universe_domain @client_stub.universe_domain end ## # The effective endpoint # # @return [String] # def endpoint @client_stub.endpoint end ## # Baseline implementation for the get_workstation_cluster REST call # # @param request_pb [::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::Workstations::V1::WorkstationCluster] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Workstations::V1::WorkstationCluster] # A result object deserialized from the server's reply def get_workstation_cluster request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_get_workstation_cluster_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Cloud::Workstations::V1::WorkstationCluster.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the list_workstation_clusters REST call # # @param request_pb [::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::Workstations::V1::ListWorkstationClustersResponse] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Workstations::V1::ListWorkstationClustersResponse] # A result object deserialized from the server's reply def list_workstation_clusters request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_list_workstation_clusters_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Cloud::Workstations::V1::ListWorkstationClustersResponse.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the create_workstation_cluster REST call # # @param request_pb [::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Longrunning::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Longrunning::Operation] # A result object deserialized from the server's reply def create_workstation_cluster request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_create_workstation_cluster_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the update_workstation_cluster REST call # # @param request_pb [::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Longrunning::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Longrunning::Operation] # A result object deserialized from the server's reply def update_workstation_cluster request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_update_workstation_cluster_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the delete_workstation_cluster REST call # # @param request_pb [::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Longrunning::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Longrunning::Operation] # A result object deserialized from the server's reply def delete_workstation_cluster request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_delete_workstation_cluster_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the get_workstation_config REST call # # @param request_pb [::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::Workstations::V1::WorkstationConfig] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Workstations::V1::WorkstationConfig] # A result object deserialized from the server's reply def get_workstation_config request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_get_workstation_config_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Cloud::Workstations::V1::WorkstationConfig.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the list_workstation_configs REST call # # @param request_pb [::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::Workstations::V1::ListWorkstationConfigsResponse] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Workstations::V1::ListWorkstationConfigsResponse] # A result object deserialized from the server's reply def list_workstation_configs request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_list_workstation_configs_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Cloud::Workstations::V1::ListWorkstationConfigsResponse.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the list_usable_workstation_configs REST call # # @param request_pb [::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsResponse] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsResponse] # A result object deserialized from the server's reply def list_usable_workstation_configs request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_list_usable_workstation_configs_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsResponse.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the create_workstation_config REST call # # @param request_pb [::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Longrunning::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Longrunning::Operation] # A result object deserialized from the server's reply def create_workstation_config request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_create_workstation_config_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the update_workstation_config REST call # # @param request_pb [::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Longrunning::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Longrunning::Operation] # A result object deserialized from the server's reply def update_workstation_config request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_update_workstation_config_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the delete_workstation_config REST call # # @param request_pb [::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Longrunning::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Longrunning::Operation] # A result object deserialized from the server's reply def delete_workstation_config request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_delete_workstation_config_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the get_workstation REST call # # @param request_pb [::Google::Cloud::Workstations::V1::GetWorkstationRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::Workstations::V1::Workstation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Workstations::V1::Workstation] # A result object deserialized from the server's reply def get_workstation request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_get_workstation_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Cloud::Workstations::V1::Workstation.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the list_workstations REST call # # @param request_pb [::Google::Cloud::Workstations::V1::ListWorkstationsRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::Workstations::V1::ListWorkstationsResponse] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Workstations::V1::ListWorkstationsResponse] # A result object deserialized from the server's reply def list_workstations request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_list_workstations_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Cloud::Workstations::V1::ListWorkstationsResponse.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the list_usable_workstations REST call # # @param request_pb [::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::Workstations::V1::ListUsableWorkstationsResponse] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Workstations::V1::ListUsableWorkstationsResponse] # A result object deserialized from the server's reply def list_usable_workstations request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_list_usable_workstations_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Cloud::Workstations::V1::ListUsableWorkstationsResponse.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the create_workstation REST call # # @param request_pb [::Google::Cloud::Workstations::V1::CreateWorkstationRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Longrunning::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Longrunning::Operation] # A result object deserialized from the server's reply def create_workstation request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_create_workstation_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the update_workstation REST call # # @param request_pb [::Google::Cloud::Workstations::V1::UpdateWorkstationRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Longrunning::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Longrunning::Operation] # A result object deserialized from the server's reply def update_workstation request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_update_workstation_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the delete_workstation REST call # # @param request_pb [::Google::Cloud::Workstations::V1::DeleteWorkstationRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Longrunning::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Longrunning::Operation] # A result object deserialized from the server's reply def delete_workstation request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_delete_workstation_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the start_workstation REST call # # @param request_pb [::Google::Cloud::Workstations::V1::StartWorkstationRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Longrunning::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Longrunning::Operation] # A result object deserialized from the server's reply def start_workstation request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_start_workstation_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the stop_workstation REST call # # @param request_pb [::Google::Cloud::Workstations::V1::StopWorkstationRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Longrunning::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Longrunning::Operation] # A result object deserialized from the server's reply def stop_workstation request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_stop_workstation_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # Baseline implementation for the generate_access_token REST call # # @param request_pb [::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest] # A request object representing the call parameters. Required. # @param options [::Gapic::CallOptions] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse] # A result object deserialized from the server's reply def generate_access_token request_pb, options = nil raise ::ArgumentError, "request must be provided" if request_pb.nil? verb, uri, query_string_params, body = ServiceStub.transcode_generate_access_token_request request_pb query_string_params = if query_string_params.any? query_string_params.to_h { |p| p.split "=", 2 } else {} end response = @client_stub.make_http_request( verb, uri: uri, body: body || "", params: query_string_params, options: options ) operation = ::Gapic::Rest::TransportOperation.new response result = ::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse.decode_json response.body, ignore_unknown_fields: true yield result, operation if block_given? result end ## # @private # # GRPC transcoding helper method for the get_workstation_cluster REST call # # @param request_pb [::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_get_workstation_cluster_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :get, uri_template: "/v1/{name}", matches: [ ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the list_workstation_clusters REST call # # @param request_pb [::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_list_workstation_clusters_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :get, uri_template: "/v1/{parent}/workstationClusters", matches: [ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the create_workstation_cluster REST call # # @param request_pb [::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_create_workstation_cluster_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :post, uri_template: "/v1/{parent}/workstationClusters", body: "workstation_cluster", matches: [ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the update_workstation_cluster REST call # # @param request_pb [::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_update_workstation_cluster_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :patch, uri_template: "/v1/{workstation_cluster.name}", body: "workstation_cluster", matches: [ ["workstation_cluster.name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the delete_workstation_cluster REST call # # @param request_pb [::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_delete_workstation_cluster_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", matches: [ ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the get_workstation_config REST call # # @param request_pb [::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_get_workstation_config_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :get, uri_template: "/v1/{name}", matches: [ ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the list_workstation_configs REST call # # @param request_pb [::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_list_workstation_configs_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :get, uri_template: "/v1/{parent}/workstationConfigs", matches: [ ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the list_usable_workstation_configs REST call # # @param request_pb [::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_list_usable_workstation_configs_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :get, uri_template: "/v1/{parent}/workstationConfigs:listUsable", matches: [ ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the create_workstation_config REST call # # @param request_pb [::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_create_workstation_config_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :post, uri_template: "/v1/{parent}/workstationConfigs", body: "workstation_config", matches: [ ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the update_workstation_config REST call # # @param request_pb [::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_update_workstation_config_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :patch, uri_template: "/v1/{workstation_config.name}", body: "workstation_config", matches: [ ["workstation_config.name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the delete_workstation_config REST call # # @param request_pb [::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_delete_workstation_config_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", matches: [ ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the get_workstation REST call # # @param request_pb [::Google::Cloud::Workstations::V1::GetWorkstationRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_get_workstation_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :get, uri_template: "/v1/{name}", matches: [ ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the list_workstations REST call # # @param request_pb [::Google::Cloud::Workstations::V1::ListWorkstationsRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_list_workstations_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :get, uri_template: "/v1/{parent}/workstations", matches: [ ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the list_usable_workstations REST call # # @param request_pb [::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_list_usable_workstations_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :get, uri_template: "/v1/{parent}/workstations:listUsable", matches: [ ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the create_workstation REST call # # @param request_pb [::Google::Cloud::Workstations::V1::CreateWorkstationRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_create_workstation_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :post, uri_template: "/v1/{parent}/workstations", body: "workstation", matches: [ ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the update_workstation REST call # # @param request_pb [::Google::Cloud::Workstations::V1::UpdateWorkstationRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_update_workstation_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :patch, uri_template: "/v1/{workstation.name}", body: "workstation", matches: [ ["workstation.name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the delete_workstation REST call # # @param request_pb [::Google::Cloud::Workstations::V1::DeleteWorkstationRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_delete_workstation_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :delete, uri_template: "/v1/{name}", matches: [ ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the start_workstation REST call # # @param request_pb [::Google::Cloud::Workstations::V1::StartWorkstationRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_start_workstation_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :post, uri_template: "/v1/{name}:start", body: "*", matches: [ ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the stop_workstation REST call # # @param request_pb [::Google::Cloud::Workstations::V1::StopWorkstationRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_stop_workstation_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :post, uri_template: "/v1/{name}:stop", body: "*", matches: [ ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end ## # @private # # GRPC transcoding helper method for the generate_access_token REST call # # @param request_pb [::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest] # A request object representing the call parameters. Required. # @return [Array(String, [String, nil], Hash{String => String})] # Uri, Body, Query string parameters def self.transcode_generate_access_token_request request_pb transcoder = Gapic::Rest::GrpcTranscoder.new .with_bindings( uri_method: :post, uri_template: "/v1/{workstation}:generateAccessToken", body: "*", matches: [ ["workstation", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] ] ) transcoder.transcode request_pb end end end end end end end end