# 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/errors" require "google/cloud/networkservices/v1/network_services_pb" require "google/cloud/network_services/v1/network_services/rest/service_stub" require "google/cloud/location/rest" require "google/iam/v1/rest" module Google module Cloud module NetworkServices module V1 module NetworkServices module Rest ## # REST client for the NetworkServices service. # # Service describing handlers for resources. # class Client # @private API_VERSION = "" # @private DEFAULT_ENDPOINT_TEMPLATE = "networkservices.$UNIVERSE_DOMAIN$" include Paths # @private attr_reader :network_services_stub ## # Configure the NetworkServices Client class. # # See {::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client::Configuration} # for a description of the configuration fields. # # @example # # # Modify the configuration for all NetworkServices clients # ::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.configure do |config| # config.timeout = 10.0 # end # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # def self.configure @configure ||= begin namespace = ["Google", "Cloud", "NetworkServices", "V1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config.timeout = 60.0 default_config end yield @configure if block_given? @configure end ## # Configure the NetworkServices Client instance. # # The configuration is set to the derived mode, meaning that values can be changed, # but structural changes (adding new fields, etc.) are not allowed. Structural changes # should be made on {Client.configure}. # # See {::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client::Configuration} # for a description of the configuration fields. # # @yield [config] Configure the Client client. # @yieldparam config [Client::Configuration] # # @return [Client::Configuration] # def configure yield @config if block_given? @config end ## # The effective universe domain # # @return [String] # def universe_domain @network_services_stub.universe_domain end ## # Create a new NetworkServices REST client object. # # @example # # # Create a client using the default configuration # client = ::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a client using a custom configuration # client = ::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new do |config| # config.timeout = 10.0 # end # # @yield [config] Configure the NetworkServices client. # @yieldparam config [Client::Configuration] # def initialize # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.endpoint.nil? || (@config.endpoint == Configuration::DEFAULT_ENDPOINT && !@config.endpoint.split(".").first.include?("-")) credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_client = ::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Operations.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint config.universe_domain = @config.universe_domain end @network_services_stub = ::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::ServiceStub.new( endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, credentials: credentials ) @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @network_services_stub.endpoint config.universe_domain = @network_services_stub.universe_domain config.bindings_override = @config.bindings_override end @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @network_services_stub.endpoint config.universe_domain = @network_services_stub.universe_domain config.bindings_override = @config.bindings_override end end ## # Get the associated client for long-running operations. # # @return [::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Operations] # attr_reader :operations_client ## # Get the associated client for mix-in of the Locations. # # @return [Google::Cloud::Location::Locations::Rest::Client] # attr_reader :location_client ## # Get the associated client for mix-in of the IAMPolicy. # # @return [Google::Iam::V1::IAMPolicy::Rest::Client] # attr_reader :iam_policy_client # Service calls ## # Lists EndpointPolicies in a given project and location. # # @overload list_endpoint_policies(request, options = nil) # Pass arguments to `list_endpoint_policies` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::ListEndpointPoliciesRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::ListEndpointPoliciesRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload list_endpoint_policies(parent: nil, page_size: nil, page_token: nil) # Pass arguments to `list_endpoint_policies` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The project and location from which the EndpointPolicies should # be listed, specified in the format `projects/*/locations/global`. # @param page_size [::Integer] # Maximum number of EndpointPolicies to return per call. # @param page_token [::String] # The value returned by the last `ListEndpointPoliciesResponse` # Indicates that this is a continuation of a prior # `ListEndpointPolicies` call, and that the system should return the # next page of data. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::EndpointPolicy>] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::EndpointPolicy>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::ListEndpointPoliciesRequest.new # # # Call the list_endpoint_policies method. # result = client.list_endpoint_policies request # # # The returned object is of type Gapic::PagedEnumerable. You can iterate # # over elements, and API calls will be issued to fetch pages as needed. # result.each do |item| # # Each element is of type ::Google::Cloud::NetworkServices::V1::EndpointPolicy. # p item # end # def list_endpoint_policies request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::ListEndpointPoliciesRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.list_endpoint_policies.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_endpoint_policies.timeout, metadata: call_metadata, retry_policy: @config.rpcs.list_endpoint_policies.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.list_endpoint_policies request, options do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @network_services_stub, :list_endpoint_policies, "endpoint_policies", request, result, options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets details of a single EndpointPolicy. # # @overload get_endpoint_policy(request, options = nil) # Pass arguments to `get_endpoint_policy` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::GetEndpointPolicyRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::GetEndpointPolicyRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload get_endpoint_policy(name: nil) # Pass arguments to `get_endpoint_policy` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. A name of the EndpointPolicy to get. Must be in the format # `projects/*/locations/global/endpointPolicies/*`. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::NetworkServices::V1::EndpointPolicy] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::NetworkServices::V1::EndpointPolicy] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::GetEndpointPolicyRequest.new # # # Call the get_endpoint_policy method. # result = client.get_endpoint_policy request # # # The returned object is of type Google::Cloud::NetworkServices::V1::EndpointPolicy. # p result # def get_endpoint_policy request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::GetEndpointPolicyRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.get_endpoint_policy.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_endpoint_policy.timeout, metadata: call_metadata, retry_policy: @config.rpcs.get_endpoint_policy.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.get_endpoint_policy request, options do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates a new EndpointPolicy in a given project and location. # # @overload create_endpoint_policy(request, options = nil) # Pass arguments to `create_endpoint_policy` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::CreateEndpointPolicyRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::CreateEndpointPolicyRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload create_endpoint_policy(parent: nil, endpoint_policy_id: nil, endpoint_policy: nil) # Pass arguments to `create_endpoint_policy` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The parent resource of the EndpointPolicy. Must be in the # format `projects/*/locations/global`. # @param endpoint_policy_id [::String] # Required. Short name of the EndpointPolicy resource to be created. # E.g. "CustomECS". # @param endpoint_policy [::Google::Cloud::NetworkServices::V1::EndpointPolicy, ::Hash] # Required. EndpointPolicy resource to be created. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::CreateEndpointPolicyRequest.new # # # Call the create_endpoint_policy method. # result = client.create_endpoint_policy request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def create_endpoint_policy request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::CreateEndpointPolicyRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.create_endpoint_policy.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_endpoint_policy.timeout, metadata: call_metadata, retry_policy: @config.rpcs.create_endpoint_policy.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.create_endpoint_policy request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Updates the parameters of a single EndpointPolicy. # # @overload update_endpoint_policy(request, options = nil) # Pass arguments to `update_endpoint_policy` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::UpdateEndpointPolicyRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::UpdateEndpointPolicyRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload update_endpoint_policy(update_mask: nil, endpoint_policy: nil) # Pass arguments to `update_endpoint_policy` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Optional. Field mask is used to specify the fields to be overwritten in the # EndpointPolicy resource by the update. # The fields specified in the update_mask are relative to the resource, not # the full request. A field will be overwritten if it is in the mask. If the # user does not provide a mask then all fields will be overwritten. # @param endpoint_policy [::Google::Cloud::NetworkServices::V1::EndpointPolicy, ::Hash] # Required. Updated EndpointPolicy resource. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::UpdateEndpointPolicyRequest.new # # # Call the update_endpoint_policy method. # result = client.update_endpoint_policy request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def update_endpoint_policy request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::UpdateEndpointPolicyRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.update_endpoint_policy.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.update_endpoint_policy.timeout, metadata: call_metadata, retry_policy: @config.rpcs.update_endpoint_policy.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.update_endpoint_policy request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Deletes a single EndpointPolicy. # # @overload delete_endpoint_policy(request, options = nil) # Pass arguments to `delete_endpoint_policy` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::DeleteEndpointPolicyRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::DeleteEndpointPolicyRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload delete_endpoint_policy(name: nil) # Pass arguments to `delete_endpoint_policy` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. A name of the EndpointPolicy to delete. Must be in the format # `projects/*/locations/global/endpointPolicies/*`. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::DeleteEndpointPolicyRequest.new # # # Call the delete_endpoint_policy method. # result = client.delete_endpoint_policy request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def delete_endpoint_policy request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::DeleteEndpointPolicyRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.delete_endpoint_policy.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_endpoint_policy.timeout, metadata: call_metadata, retry_policy: @config.rpcs.delete_endpoint_policy.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.delete_endpoint_policy request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists Gateways in a given project and location. # # @overload list_gateways(request, options = nil) # Pass arguments to `list_gateways` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::ListGatewaysRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::ListGatewaysRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload list_gateways(parent: nil, page_size: nil, page_token: nil) # Pass arguments to `list_gateways` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The project and location from which the Gateways should be # listed, specified in the format `projects/*/locations/*`. # @param page_size [::Integer] # Maximum number of Gateways to return per call. # @param page_token [::String] # The value returned by the last `ListGatewaysResponse` # Indicates that this is a continuation of a prior `ListGateways` call, # and that the system should return the next page of data. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::Gateway>] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::Gateway>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::ListGatewaysRequest.new # # # Call the list_gateways method. # result = client.list_gateways request # # # The returned object is of type Gapic::PagedEnumerable. You can iterate # # over elements, and API calls will be issued to fetch pages as needed. # result.each do |item| # # Each element is of type ::Google::Cloud::NetworkServices::V1::Gateway. # p item # end # def list_gateways request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::ListGatewaysRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.list_gateways.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_gateways.timeout, metadata: call_metadata, retry_policy: @config.rpcs.list_gateways.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.list_gateways request, options do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @network_services_stub, :list_gateways, "gateways", request, result, options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets details of a single Gateway. # # @overload get_gateway(request, options = nil) # Pass arguments to `get_gateway` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::GetGatewayRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::GetGatewayRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload get_gateway(name: nil) # Pass arguments to `get_gateway` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. A name of the Gateway to get. Must be in the format # `projects/*/locations/*/gateways/*`. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::NetworkServices::V1::Gateway] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::NetworkServices::V1::Gateway] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::GetGatewayRequest.new # # # Call the get_gateway method. # result = client.get_gateway request # # # The returned object is of type Google::Cloud::NetworkServices::V1::Gateway. # p result # def get_gateway request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::GetGatewayRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.get_gateway.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_gateway.timeout, metadata: call_metadata, retry_policy: @config.rpcs.get_gateway.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.get_gateway request, options do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates a new Gateway in a given project and location. # # @overload create_gateway(request, options = nil) # Pass arguments to `create_gateway` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::CreateGatewayRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::CreateGatewayRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload create_gateway(parent: nil, gateway_id: nil, gateway: nil) # Pass arguments to `create_gateway` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The parent resource of the Gateway. Must be in the # format `projects/*/locations/*`. # @param gateway_id [::String] # Required. Short name of the Gateway resource to be created. # @param gateway [::Google::Cloud::NetworkServices::V1::Gateway, ::Hash] # Required. Gateway resource to be created. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::CreateGatewayRequest.new # # # Call the create_gateway method. # result = client.create_gateway request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def create_gateway request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::CreateGatewayRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.create_gateway.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_gateway.timeout, metadata: call_metadata, retry_policy: @config.rpcs.create_gateway.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.create_gateway request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Updates the parameters of a single Gateway. # # @overload update_gateway(request, options = nil) # Pass arguments to `update_gateway` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::UpdateGatewayRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::UpdateGatewayRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload update_gateway(update_mask: nil, gateway: nil) # Pass arguments to `update_gateway` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Optional. Field mask is used to specify the fields to be overwritten in the # Gateway resource by the update. # The fields specified in the update_mask are relative to the resource, not # the full request. A field will be overwritten if it is in the mask. If the # user does not provide a mask then all fields will be overwritten. # @param gateway [::Google::Cloud::NetworkServices::V1::Gateway, ::Hash] # Required. Updated Gateway resource. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::UpdateGatewayRequest.new # # # Call the update_gateway method. # result = client.update_gateway request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def update_gateway request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::UpdateGatewayRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.update_gateway.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.update_gateway.timeout, metadata: call_metadata, retry_policy: @config.rpcs.update_gateway.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.update_gateway request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Deletes a single Gateway. # # @overload delete_gateway(request, options = nil) # Pass arguments to `delete_gateway` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::DeleteGatewayRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::DeleteGatewayRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload delete_gateway(name: nil) # Pass arguments to `delete_gateway` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. A name of the Gateway to delete. Must be in the format # `projects/*/locations/*/gateways/*`. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::DeleteGatewayRequest.new # # # Call the delete_gateway method. # result = client.delete_gateway request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def delete_gateway request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::DeleteGatewayRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.delete_gateway.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_gateway.timeout, metadata: call_metadata, retry_policy: @config.rpcs.delete_gateway.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.delete_gateway request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists GrpcRoutes in a given project and location. # # @overload list_grpc_routes(request, options = nil) # Pass arguments to `list_grpc_routes` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::ListGrpcRoutesRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::ListGrpcRoutesRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload list_grpc_routes(parent: nil, page_size: nil, page_token: nil) # Pass arguments to `list_grpc_routes` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The project and location from which the GrpcRoutes should be # listed, specified in the format `projects/*/locations/global`. # @param page_size [::Integer] # Maximum number of GrpcRoutes to return per call. # @param page_token [::String] # The value returned by the last `ListGrpcRoutesResponse` # Indicates that this is a continuation of a prior `ListGrpcRoutes` call, # and that the system should return the next page of data. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::GrpcRoute>] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::GrpcRoute>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::ListGrpcRoutesRequest.new # # # Call the list_grpc_routes method. # result = client.list_grpc_routes request # # # The returned object is of type Gapic::PagedEnumerable. You can iterate # # over elements, and API calls will be issued to fetch pages as needed. # result.each do |item| # # Each element is of type ::Google::Cloud::NetworkServices::V1::GrpcRoute. # p item # end # def list_grpc_routes request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::ListGrpcRoutesRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.list_grpc_routes.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_grpc_routes.timeout, metadata: call_metadata, retry_policy: @config.rpcs.list_grpc_routes.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.list_grpc_routes request, options do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @network_services_stub, :list_grpc_routes, "grpc_routes", request, result, options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets details of a single GrpcRoute. # # @overload get_grpc_route(request, options = nil) # Pass arguments to `get_grpc_route` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::GetGrpcRouteRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::GetGrpcRouteRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload get_grpc_route(name: nil) # Pass arguments to `get_grpc_route` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. A name of the GrpcRoute to get. Must be in the format # `projects/*/locations/global/grpcRoutes/*`. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::NetworkServices::V1::GrpcRoute] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::NetworkServices::V1::GrpcRoute] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::GetGrpcRouteRequest.new # # # Call the get_grpc_route method. # result = client.get_grpc_route request # # # The returned object is of type Google::Cloud::NetworkServices::V1::GrpcRoute. # p result # def get_grpc_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::GetGrpcRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.get_grpc_route.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_grpc_route.timeout, metadata: call_metadata, retry_policy: @config.rpcs.get_grpc_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.get_grpc_route request, options do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates a new GrpcRoute in a given project and location. # # @overload create_grpc_route(request, options = nil) # Pass arguments to `create_grpc_route` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::CreateGrpcRouteRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::CreateGrpcRouteRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload create_grpc_route(parent: nil, grpc_route_id: nil, grpc_route: nil) # Pass arguments to `create_grpc_route` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The parent resource of the GrpcRoute. Must be in the # format `projects/*/locations/global`. # @param grpc_route_id [::String] # Required. Short name of the GrpcRoute resource to be created. # @param grpc_route [::Google::Cloud::NetworkServices::V1::GrpcRoute, ::Hash] # Required. GrpcRoute resource to be created. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::CreateGrpcRouteRequest.new # # # Call the create_grpc_route method. # result = client.create_grpc_route request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def create_grpc_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::CreateGrpcRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.create_grpc_route.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_grpc_route.timeout, metadata: call_metadata, retry_policy: @config.rpcs.create_grpc_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.create_grpc_route request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Updates the parameters of a single GrpcRoute. # # @overload update_grpc_route(request, options = nil) # Pass arguments to `update_grpc_route` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::UpdateGrpcRouteRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::UpdateGrpcRouteRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload update_grpc_route(update_mask: nil, grpc_route: nil) # Pass arguments to `update_grpc_route` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Optional. Field mask is used to specify the fields to be overwritten in the # GrpcRoute resource by the update. # The fields specified in the update_mask are relative to the resource, not # the full request. A field will be overwritten if it is in the mask. If the # user does not provide a mask then all fields will be overwritten. # @param grpc_route [::Google::Cloud::NetworkServices::V1::GrpcRoute, ::Hash] # Required. Updated GrpcRoute resource. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::UpdateGrpcRouteRequest.new # # # Call the update_grpc_route method. # result = client.update_grpc_route request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def update_grpc_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::UpdateGrpcRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.update_grpc_route.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.update_grpc_route.timeout, metadata: call_metadata, retry_policy: @config.rpcs.update_grpc_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.update_grpc_route request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Deletes a single GrpcRoute. # # @overload delete_grpc_route(request, options = nil) # Pass arguments to `delete_grpc_route` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::DeleteGrpcRouteRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::DeleteGrpcRouteRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload delete_grpc_route(name: nil) # Pass arguments to `delete_grpc_route` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. A name of the GrpcRoute to delete. Must be in the format # `projects/*/locations/global/grpcRoutes/*`. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::DeleteGrpcRouteRequest.new # # # Call the delete_grpc_route method. # result = client.delete_grpc_route request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def delete_grpc_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::DeleteGrpcRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.delete_grpc_route.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_grpc_route.timeout, metadata: call_metadata, retry_policy: @config.rpcs.delete_grpc_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.delete_grpc_route request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists HttpRoute in a given project and location. # # @overload list_http_routes(request, options = nil) # Pass arguments to `list_http_routes` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::ListHttpRoutesRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::ListHttpRoutesRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload list_http_routes(parent: nil, page_size: nil, page_token: nil) # Pass arguments to `list_http_routes` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The project and location from which the HttpRoutes should be # listed, specified in the format `projects/*/locations/global`. # @param page_size [::Integer] # Maximum number of HttpRoutes to return per call. # @param page_token [::String] # The value returned by the last `ListHttpRoutesResponse` # Indicates that this is a continuation of a prior `ListHttpRoutes` call, # and that the system should return the next page of data. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::HttpRoute>] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::HttpRoute>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::ListHttpRoutesRequest.new # # # Call the list_http_routes method. # result = client.list_http_routes request # # # The returned object is of type Gapic::PagedEnumerable. You can iterate # # over elements, and API calls will be issued to fetch pages as needed. # result.each do |item| # # Each element is of type ::Google::Cloud::NetworkServices::V1::HttpRoute. # p item # end # def list_http_routes request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::ListHttpRoutesRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.list_http_routes.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_http_routes.timeout, metadata: call_metadata, retry_policy: @config.rpcs.list_http_routes.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.list_http_routes request, options do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @network_services_stub, :list_http_routes, "http_routes", request, result, options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets details of a single HttpRoute. # # @overload get_http_route(request, options = nil) # Pass arguments to `get_http_route` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::GetHttpRouteRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::GetHttpRouteRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload get_http_route(name: nil) # Pass arguments to `get_http_route` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. A name of the HttpRoute to get. Must be in the format # `projects/*/locations/global/httpRoutes/*`. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::NetworkServices::V1::HttpRoute] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::NetworkServices::V1::HttpRoute] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::GetHttpRouteRequest.new # # # Call the get_http_route method. # result = client.get_http_route request # # # The returned object is of type Google::Cloud::NetworkServices::V1::HttpRoute. # p result # def get_http_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::GetHttpRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.get_http_route.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_http_route.timeout, metadata: call_metadata, retry_policy: @config.rpcs.get_http_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.get_http_route request, options do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates a new HttpRoute in a given project and location. # # @overload create_http_route(request, options = nil) # Pass arguments to `create_http_route` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::CreateHttpRouteRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::CreateHttpRouteRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload create_http_route(parent: nil, http_route_id: nil, http_route: nil) # Pass arguments to `create_http_route` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The parent resource of the HttpRoute. Must be in the # format `projects/*/locations/global`. # @param http_route_id [::String] # Required. Short name of the HttpRoute resource to be created. # @param http_route [::Google::Cloud::NetworkServices::V1::HttpRoute, ::Hash] # Required. HttpRoute resource to be created. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::CreateHttpRouteRequest.new # # # Call the create_http_route method. # result = client.create_http_route request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def create_http_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::CreateHttpRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.create_http_route.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_http_route.timeout, metadata: call_metadata, retry_policy: @config.rpcs.create_http_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.create_http_route request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Updates the parameters of a single HttpRoute. # # @overload update_http_route(request, options = nil) # Pass arguments to `update_http_route` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::UpdateHttpRouteRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::UpdateHttpRouteRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload update_http_route(update_mask: nil, http_route: nil) # Pass arguments to `update_http_route` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Optional. Field mask is used to specify the fields to be overwritten in the # HttpRoute resource by the update. # The fields specified in the update_mask are relative to the resource, not # the full request. A field will be overwritten if it is in the mask. If the # user does not provide a mask then all fields will be overwritten. # @param http_route [::Google::Cloud::NetworkServices::V1::HttpRoute, ::Hash] # Required. Updated HttpRoute resource. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::UpdateHttpRouteRequest.new # # # Call the update_http_route method. # result = client.update_http_route request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def update_http_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::UpdateHttpRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.update_http_route.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.update_http_route.timeout, metadata: call_metadata, retry_policy: @config.rpcs.update_http_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.update_http_route request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Deletes a single HttpRoute. # # @overload delete_http_route(request, options = nil) # Pass arguments to `delete_http_route` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::DeleteHttpRouteRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::DeleteHttpRouteRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload delete_http_route(name: nil) # Pass arguments to `delete_http_route` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. A name of the HttpRoute to delete. Must be in the format # `projects/*/locations/global/httpRoutes/*`. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::DeleteHttpRouteRequest.new # # # Call the delete_http_route method. # result = client.delete_http_route request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def delete_http_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::DeleteHttpRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.delete_http_route.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_http_route.timeout, metadata: call_metadata, retry_policy: @config.rpcs.delete_http_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.delete_http_route request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists TcpRoute in a given project and location. # # @overload list_tcp_routes(request, options = nil) # Pass arguments to `list_tcp_routes` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::ListTcpRoutesRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::ListTcpRoutesRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload list_tcp_routes(parent: nil, page_size: nil, page_token: nil) # Pass arguments to `list_tcp_routes` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The project and location from which the TcpRoutes should be # listed, specified in the format `projects/*/locations/global`. # @param page_size [::Integer] # Maximum number of TcpRoutes to return per call. # @param page_token [::String] # The value returned by the last `ListTcpRoutesResponse` # Indicates that this is a continuation of a prior `ListTcpRoutes` call, # and that the system should return the next page of data. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::TcpRoute>] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::TcpRoute>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::ListTcpRoutesRequest.new # # # Call the list_tcp_routes method. # result = client.list_tcp_routes request # # # The returned object is of type Gapic::PagedEnumerable. You can iterate # # over elements, and API calls will be issued to fetch pages as needed. # result.each do |item| # # Each element is of type ::Google::Cloud::NetworkServices::V1::TcpRoute. # p item # end # def list_tcp_routes request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::ListTcpRoutesRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.list_tcp_routes.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_tcp_routes.timeout, metadata: call_metadata, retry_policy: @config.rpcs.list_tcp_routes.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.list_tcp_routes request, options do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @network_services_stub, :list_tcp_routes, "tcp_routes", request, result, options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets details of a single TcpRoute. # # @overload get_tcp_route(request, options = nil) # Pass arguments to `get_tcp_route` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::GetTcpRouteRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::GetTcpRouteRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload get_tcp_route(name: nil) # Pass arguments to `get_tcp_route` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. A name of the TcpRoute to get. Must be in the format # `projects/*/locations/global/tcpRoutes/*`. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::NetworkServices::V1::TcpRoute] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::NetworkServices::V1::TcpRoute] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::GetTcpRouteRequest.new # # # Call the get_tcp_route method. # result = client.get_tcp_route request # # # The returned object is of type Google::Cloud::NetworkServices::V1::TcpRoute. # p result # def get_tcp_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::GetTcpRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.get_tcp_route.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_tcp_route.timeout, metadata: call_metadata, retry_policy: @config.rpcs.get_tcp_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.get_tcp_route request, options do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates a new TcpRoute in a given project and location. # # @overload create_tcp_route(request, options = nil) # Pass arguments to `create_tcp_route` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::CreateTcpRouteRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::CreateTcpRouteRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload create_tcp_route(parent: nil, tcp_route_id: nil, tcp_route: nil) # Pass arguments to `create_tcp_route` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The parent resource of the TcpRoute. Must be in the # format `projects/*/locations/global`. # @param tcp_route_id [::String] # Required. Short name of the TcpRoute resource to be created. # @param tcp_route [::Google::Cloud::NetworkServices::V1::TcpRoute, ::Hash] # Required. TcpRoute resource to be created. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::CreateTcpRouteRequest.new # # # Call the create_tcp_route method. # result = client.create_tcp_route request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def create_tcp_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::CreateTcpRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.create_tcp_route.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_tcp_route.timeout, metadata: call_metadata, retry_policy: @config.rpcs.create_tcp_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.create_tcp_route request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Updates the parameters of a single TcpRoute. # # @overload update_tcp_route(request, options = nil) # Pass arguments to `update_tcp_route` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::UpdateTcpRouteRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::UpdateTcpRouteRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload update_tcp_route(update_mask: nil, tcp_route: nil) # Pass arguments to `update_tcp_route` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Optional. Field mask is used to specify the fields to be overwritten in the # TcpRoute resource by the update. # The fields specified in the update_mask are relative to the resource, not # the full request. A field will be overwritten if it is in the mask. If the # user does not provide a mask then all fields will be overwritten. # @param tcp_route [::Google::Cloud::NetworkServices::V1::TcpRoute, ::Hash] # Required. Updated TcpRoute resource. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::UpdateTcpRouteRequest.new # # # Call the update_tcp_route method. # result = client.update_tcp_route request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def update_tcp_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::UpdateTcpRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.update_tcp_route.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.update_tcp_route.timeout, metadata: call_metadata, retry_policy: @config.rpcs.update_tcp_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.update_tcp_route request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Deletes a single TcpRoute. # # @overload delete_tcp_route(request, options = nil) # Pass arguments to `delete_tcp_route` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::DeleteTcpRouteRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::DeleteTcpRouteRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload delete_tcp_route(name: nil) # Pass arguments to `delete_tcp_route` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. A name of the TcpRoute to delete. Must be in the format # `projects/*/locations/global/tcpRoutes/*`. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::DeleteTcpRouteRequest.new # # # Call the delete_tcp_route method. # result = client.delete_tcp_route request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def delete_tcp_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::DeleteTcpRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.delete_tcp_route.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_tcp_route.timeout, metadata: call_metadata, retry_policy: @config.rpcs.delete_tcp_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.delete_tcp_route request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists TlsRoute in a given project and location. # # @overload list_tls_routes(request, options = nil) # Pass arguments to `list_tls_routes` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::ListTlsRoutesRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::ListTlsRoutesRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload list_tls_routes(parent: nil, page_size: nil, page_token: nil) # Pass arguments to `list_tls_routes` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The project and location from which the TlsRoutes should be # listed, specified in the format `projects/*/locations/global`. # @param page_size [::Integer] # Maximum number of TlsRoutes to return per call. # @param page_token [::String] # The value returned by the last `ListTlsRoutesResponse` # Indicates that this is a continuation of a prior `ListTlsRoutes` call, # and that the system should return the next page of data. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::TlsRoute>] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::TlsRoute>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::ListTlsRoutesRequest.new # # # Call the list_tls_routes method. # result = client.list_tls_routes request # # # The returned object is of type Gapic::PagedEnumerable. You can iterate # # over elements, and API calls will be issued to fetch pages as needed. # result.each do |item| # # Each element is of type ::Google::Cloud::NetworkServices::V1::TlsRoute. # p item # end # def list_tls_routes request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::ListTlsRoutesRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.list_tls_routes.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_tls_routes.timeout, metadata: call_metadata, retry_policy: @config.rpcs.list_tls_routes.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.list_tls_routes request, options do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @network_services_stub, :list_tls_routes, "tls_routes", request, result, options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets details of a single TlsRoute. # # @overload get_tls_route(request, options = nil) # Pass arguments to `get_tls_route` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::GetTlsRouteRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::GetTlsRouteRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload get_tls_route(name: nil) # Pass arguments to `get_tls_route` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. A name of the TlsRoute to get. Must be in the format # `projects/*/locations/global/tlsRoutes/*`. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::NetworkServices::V1::TlsRoute] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::NetworkServices::V1::TlsRoute] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::GetTlsRouteRequest.new # # # Call the get_tls_route method. # result = client.get_tls_route request # # # The returned object is of type Google::Cloud::NetworkServices::V1::TlsRoute. # p result # def get_tls_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::GetTlsRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.get_tls_route.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_tls_route.timeout, metadata: call_metadata, retry_policy: @config.rpcs.get_tls_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.get_tls_route request, options do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates a new TlsRoute in a given project and location. # # @overload create_tls_route(request, options = nil) # Pass arguments to `create_tls_route` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::CreateTlsRouteRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::CreateTlsRouteRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload create_tls_route(parent: nil, tls_route_id: nil, tls_route: nil) # Pass arguments to `create_tls_route` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The parent resource of the TlsRoute. Must be in the # format `projects/*/locations/global`. # @param tls_route_id [::String] # Required. Short name of the TlsRoute resource to be created. # @param tls_route [::Google::Cloud::NetworkServices::V1::TlsRoute, ::Hash] # Required. TlsRoute resource to be created. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::CreateTlsRouteRequest.new # # # Call the create_tls_route method. # result = client.create_tls_route request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def create_tls_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::CreateTlsRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.create_tls_route.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_tls_route.timeout, metadata: call_metadata, retry_policy: @config.rpcs.create_tls_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.create_tls_route request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Updates the parameters of a single TlsRoute. # # @overload update_tls_route(request, options = nil) # Pass arguments to `update_tls_route` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::UpdateTlsRouteRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::UpdateTlsRouteRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload update_tls_route(update_mask: nil, tls_route: nil) # Pass arguments to `update_tls_route` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Optional. Field mask is used to specify the fields to be overwritten in the # TlsRoute resource by the update. # The fields specified in the update_mask are relative to the resource, not # the full request. A field will be overwritten if it is in the mask. If the # user does not provide a mask then all fields will be overwritten. # @param tls_route [::Google::Cloud::NetworkServices::V1::TlsRoute, ::Hash] # Required. Updated TlsRoute resource. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::UpdateTlsRouteRequest.new # # # Call the update_tls_route method. # result = client.update_tls_route request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def update_tls_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::UpdateTlsRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.update_tls_route.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.update_tls_route.timeout, metadata: call_metadata, retry_policy: @config.rpcs.update_tls_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.update_tls_route request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Deletes a single TlsRoute. # # @overload delete_tls_route(request, options = nil) # Pass arguments to `delete_tls_route` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::DeleteTlsRouteRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::DeleteTlsRouteRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload delete_tls_route(name: nil) # Pass arguments to `delete_tls_route` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. A name of the TlsRoute to delete. Must be in the format # `projects/*/locations/global/tlsRoutes/*`. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::DeleteTlsRouteRequest.new # # # Call the delete_tls_route method. # result = client.delete_tls_route request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def delete_tls_route request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::DeleteTlsRouteRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.delete_tls_route.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_tls_route.timeout, metadata: call_metadata, retry_policy: @config.rpcs.delete_tls_route.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.delete_tls_route request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists ServiceBinding in a given project and location. # # @overload list_service_bindings(request, options = nil) # Pass arguments to `list_service_bindings` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::ListServiceBindingsRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::ListServiceBindingsRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload list_service_bindings(parent: nil, page_size: nil, page_token: nil) # Pass arguments to `list_service_bindings` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The project and location from which the ServiceBindings should be # listed, specified in the format `projects/*/locations/global`. # @param page_size [::Integer] # Maximum number of ServiceBindings to return per call. # @param page_token [::String] # The value returned by the last `ListServiceBindingsResponse` # Indicates that this is a continuation of a prior `ListRouters` call, # and that the system should return the next page of data. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::ServiceBinding>] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::ServiceBinding>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::ListServiceBindingsRequest.new # # # Call the list_service_bindings method. # result = client.list_service_bindings request # # # The returned object is of type Gapic::PagedEnumerable. You can iterate # # over elements, and API calls will be issued to fetch pages as needed. # result.each do |item| # # Each element is of type ::Google::Cloud::NetworkServices::V1::ServiceBinding. # p item # end # def list_service_bindings request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::ListServiceBindingsRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.list_service_bindings.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_service_bindings.timeout, metadata: call_metadata, retry_policy: @config.rpcs.list_service_bindings.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.list_service_bindings request, options do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @network_services_stub, :list_service_bindings, "service_bindings", request, result, options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets details of a single ServiceBinding. # # @overload get_service_binding(request, options = nil) # Pass arguments to `get_service_binding` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::GetServiceBindingRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::GetServiceBindingRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload get_service_binding(name: nil) # Pass arguments to `get_service_binding` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. A name of the ServiceBinding to get. Must be in the format # `projects/*/locations/global/serviceBindings/*`. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::NetworkServices::V1::ServiceBinding] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::NetworkServices::V1::ServiceBinding] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::GetServiceBindingRequest.new # # # Call the get_service_binding method. # result = client.get_service_binding request # # # The returned object is of type Google::Cloud::NetworkServices::V1::ServiceBinding. # p result # def get_service_binding request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::GetServiceBindingRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.get_service_binding.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_service_binding.timeout, metadata: call_metadata, retry_policy: @config.rpcs.get_service_binding.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.get_service_binding request, options do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates a new ServiceBinding in a given project and location. # # @overload create_service_binding(request, options = nil) # Pass arguments to `create_service_binding` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::CreateServiceBindingRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::CreateServiceBindingRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload create_service_binding(parent: nil, service_binding_id: nil, service_binding: nil) # Pass arguments to `create_service_binding` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The parent resource of the ServiceBinding. Must be in the # format `projects/*/locations/global`. # @param service_binding_id [::String] # Required. Short name of the ServiceBinding resource to be created. # @param service_binding [::Google::Cloud::NetworkServices::V1::ServiceBinding, ::Hash] # Required. ServiceBinding resource to be created. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::CreateServiceBindingRequest.new # # # Call the create_service_binding method. # result = client.create_service_binding request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def create_service_binding request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::CreateServiceBindingRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.create_service_binding.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_service_binding.timeout, metadata: call_metadata, retry_policy: @config.rpcs.create_service_binding.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.create_service_binding request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Deletes a single ServiceBinding. # # @overload delete_service_binding(request, options = nil) # Pass arguments to `delete_service_binding` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::DeleteServiceBindingRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::DeleteServiceBindingRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload delete_service_binding(name: nil) # Pass arguments to `delete_service_binding` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. A name of the ServiceBinding to delete. Must be in the format # `projects/*/locations/global/serviceBindings/*`. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::DeleteServiceBindingRequest.new # # # Call the delete_service_binding method. # result = client.delete_service_binding request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def delete_service_binding request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::DeleteServiceBindingRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.delete_service_binding.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_service_binding.timeout, metadata: call_metadata, retry_policy: @config.rpcs.delete_service_binding.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.delete_service_binding request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Lists Meshes in a given project and location. # # @overload list_meshes(request, options = nil) # Pass arguments to `list_meshes` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::ListMeshesRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::ListMeshesRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload list_meshes(parent: nil, page_size: nil, page_token: nil) # Pass arguments to `list_meshes` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The project and location from which the Meshes should be # listed, specified in the format `projects/*/locations/global`. # @param page_size [::Integer] # Maximum number of Meshes to return per call. # @param page_token [::String] # The value returned by the last `ListMeshesResponse` # Indicates that this is a continuation of a prior `ListMeshes` call, # and that the system should return the next page of data. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::Mesh>] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::NetworkServices::V1::Mesh>] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::ListMeshesRequest.new # # # Call the list_meshes method. # result = client.list_meshes request # # # The returned object is of type Gapic::PagedEnumerable. You can iterate # # over elements, and API calls will be issued to fetch pages as needed. # result.each do |item| # # Each element is of type ::Google::Cloud::NetworkServices::V1::Mesh. # p item # end # def list_meshes request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::ListMeshesRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.list_meshes.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_meshes.timeout, metadata: call_metadata, retry_policy: @config.rpcs.list_meshes.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.list_meshes request, options do |result, operation| result = ::Gapic::Rest::PagedEnumerable.new @network_services_stub, :list_meshes, "meshes", request, result, options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Gets details of a single Mesh. # # @overload get_mesh(request, options = nil) # Pass arguments to `get_mesh` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::GetMeshRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::GetMeshRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload get_mesh(name: nil) # Pass arguments to `get_mesh` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. A name of the Mesh to get. Must be in the format # `projects/*/locations/global/meshes/*`. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Google::Cloud::NetworkServices::V1::Mesh] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Google::Cloud::NetworkServices::V1::Mesh] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::GetMeshRequest.new # # # Call the get_mesh method. # result = client.get_mesh request # # # The returned object is of type Google::Cloud::NetworkServices::V1::Mesh. # p result # def get_mesh request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::GetMeshRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.get_mesh.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.get_mesh.timeout, metadata: call_metadata, retry_policy: @config.rpcs.get_mesh.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.get_mesh request, options do |result, operation| yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Creates a new Mesh in a given project and location. # # @overload create_mesh(request, options = nil) # Pass arguments to `create_mesh` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::CreateMeshRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::CreateMeshRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload create_mesh(parent: nil, mesh_id: nil, mesh: nil) # Pass arguments to `create_mesh` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] # Required. The parent resource of the Mesh. Must be in the # format `projects/*/locations/global`. # @param mesh_id [::String] # Required. Short name of the Mesh resource to be created. # @param mesh [::Google::Cloud::NetworkServices::V1::Mesh, ::Hash] # Required. Mesh resource to be created. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::CreateMeshRequest.new # # # Call the create_mesh method. # result = client.create_mesh request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def create_mesh request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::CreateMeshRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.create_mesh.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_mesh.timeout, metadata: call_metadata, retry_policy: @config.rpcs.create_mesh.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.create_mesh request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Updates the parameters of a single Mesh. # # @overload update_mesh(request, options = nil) # Pass arguments to `update_mesh` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::UpdateMeshRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::UpdateMeshRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload update_mesh(update_mask: nil, mesh: nil) # Pass arguments to `update_mesh` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Optional. Field mask is used to specify the fields to be overwritten in the # Mesh resource by the update. # The fields specified in the update_mask are relative to the resource, not # the full request. A field will be overwritten if it is in the mask. If the # user does not provide a mask then all fields will be overwritten. # @param mesh [::Google::Cloud::NetworkServices::V1::Mesh, ::Hash] # Required. Updated Mesh resource. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::UpdateMeshRequest.new # # # Call the update_mesh method. # result = client.update_mesh request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def update_mesh request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::UpdateMeshRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.update_mesh.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.update_mesh.timeout, metadata: call_metadata, retry_policy: @config.rpcs.update_mesh.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.update_mesh request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Deletes a single Mesh. # # @overload delete_mesh(request, options = nil) # Pass arguments to `delete_mesh` via a request object, either of type # {::Google::Cloud::NetworkServices::V1::DeleteMeshRequest} or an equivalent Hash. # # @param request [::Google::Cloud::NetworkServices::V1::DeleteMeshRequest, ::Hash] # A request object representing the call parameters. Required. To specify no # parameters, or to keep all the default parameter values, pass an empty Hash. # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # # @overload delete_mesh(name: nil) # Pass arguments to `delete_mesh` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] # Required. A name of the Mesh to delete. Must be in the format # `projects/*/locations/global/meshes/*`. # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Operation] # @yieldparam operation [::Gapic::Rest::TransportOperation] # # @return [::Gapic::Operation] # # @raise [::Google::Cloud::Error] if the REST call is aborted. # # @example Basic example # require "google/cloud/network_services/v1" # # # Create a client object. The client can be reused for multiple calls. # client = Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new # # # Create a request. To set request fields, pass in keyword arguments. # request = Google::Cloud::NetworkServices::V1::DeleteMeshRequest.new # # # Call the delete_mesh method. # result = client.delete_mesh request # # # The returned object is of type Gapic::Operation. You can use it to # # check the status of an operation, cancel it, or wait for results. # # Here is how to wait for a response. # result.wait_until_done! timeout: 60 # if result.response? # p result.response # else # puts "No response received." # end # def delete_mesh request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkServices::V1::DeleteMeshRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults call_metadata = @config.rpcs.delete_mesh.metadata.to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::NetworkServices::V1::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.delete_mesh.timeout, metadata: call_metadata, retry_policy: @config.rpcs.delete_mesh.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @network_services_stub.delete_mesh request, options do |result, operation| result = ::Gapic::Operation.new result, @operations_client, options: options yield result, operation if block_given? return result end rescue ::Gapic::Rest::Error => e raise ::Google::Cloud::Error.from_error(e) end ## # Configuration class for the NetworkServices REST API. # # This class represents the configuration for NetworkServices REST, # providing control over timeouts, retry behavior, logging, transport # parameters, and other low-level controls. Certain parameters can also be # applied individually to specific RPCs. See # {::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client::Configuration::Rpcs} # for a list of RPCs that can be configured independently. # # Configuration can be applied globally to all clients, or to a single client # on construction. # # @example # # # Modify the global config, setting the timeout for # # list_endpoint_policies to 20 seconds, # # and all remaining timeouts to 10 seconds. # ::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.configure do |config| # config.timeout = 10.0 # config.rpcs.list_endpoint_policies.timeout = 20.0 # end # # # Apply the above configuration only to a new client. # client = ::Google::Cloud::NetworkServices::V1::NetworkServices::Rest::Client.new do |config| # config.timeout = 10.0 # config.rpcs.list_endpoint_policies.timeout = 20.0 # end # # @!attribute [rw] endpoint # A custom service endpoint, as a hostname or hostname:port. The default is # nil, indicating to use the default endpoint in the current universe domain. # @return [::String,nil] # @!attribute [rw] credentials # Credentials to send with calls. You may provide any of the following types: # * (`String`) The path to a service account key file in JSON format # * (`Hash`) A service account key as a Hash # * (`Google::Auth::Credentials`) A googleauth credentials object # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) # * (`Signet::OAuth2::Client`) A signet oauth2 client object # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) # * (`nil`) indicating no credentials # @return [::Object] # @!attribute [rw] scope # The OAuth scopes # @return [::Array<::String>] # @!attribute [rw] lib_name # The library name as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] lib_version # The library version as recorded in instrumentation and logging # @return [::String] # @!attribute [rw] timeout # The call timeout in seconds. # @return [::Numeric] # @!attribute [rw] metadata # Additional headers to be sent with the call. # @return [::Hash{::Symbol=>::String}] # @!attribute [rw] retry_policy # The retry policy. The value is a hash with the following keys: # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # @return [::Hash] # @!attribute [rw] quota_project # A separate project against which to charge quota. # @return [::String] # @!attribute [rw] universe_domain # The universe domain within which to make requests. This determines the # default endpoint URL. The default value of nil uses the environment # universe (usually the default "googleapis.com" universe). # @return [::String,nil] # class Configuration extend ::Gapic::Config # @private # The endpoint specific to the default "googleapis.com" universe. Deprecated. DEFAULT_ENDPOINT = "networkservices.googleapis.com" config_attr :endpoint, nil, ::String, nil config_attr :credentials, nil do |value| allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] allowed.any? { |klass| klass === value } end config_attr :scope, nil, ::String, ::Array, nil config_attr :lib_name, nil, ::String, nil config_attr :lib_version, nil, ::String, nil config_attr :timeout, nil, ::Numeric, nil config_attr :metadata, nil, ::Hash, nil config_attr :retry_policy, nil, ::Hash, ::Proc, nil config_attr :quota_project, nil, ::String, nil config_attr :universe_domain, nil, ::String, nil # @private # Overrides for http bindings for the RPCs of this service # are only used when this service is used as mixin, and only # by the host service. # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] config_attr :bindings_override, {}, ::Hash, nil # @private def initialize parent_config = nil @parent_config = parent_config unless parent_config.nil? yield self if block_given? end ## # Configurations for individual RPCs # @return [Rpcs] # def rpcs @rpcs ||= begin parent_rpcs = nil parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) Rpcs.new parent_rpcs end end ## # Configuration RPC class for the NetworkServices API. # # Includes fields providing the configuration for each RPC in this service. # Each configuration object is of type `Gapic::Config::Method` and includes # the following configuration fields: # # * `timeout` (*type:* `Numeric`) - The call timeout in seconds # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields # include the following keys: # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. # * `:retry_codes` (*type:* `Array`) - The error codes that should # trigger a retry. # class Rpcs ## # RPC-specific configuration for `list_endpoint_policies` # @return [::Gapic::Config::Method] # attr_reader :list_endpoint_policies ## # RPC-specific configuration for `get_endpoint_policy` # @return [::Gapic::Config::Method] # attr_reader :get_endpoint_policy ## # RPC-specific configuration for `create_endpoint_policy` # @return [::Gapic::Config::Method] # attr_reader :create_endpoint_policy ## # RPC-specific configuration for `update_endpoint_policy` # @return [::Gapic::Config::Method] # attr_reader :update_endpoint_policy ## # RPC-specific configuration for `delete_endpoint_policy` # @return [::Gapic::Config::Method] # attr_reader :delete_endpoint_policy ## # RPC-specific configuration for `list_gateways` # @return [::Gapic::Config::Method] # attr_reader :list_gateways ## # RPC-specific configuration for `get_gateway` # @return [::Gapic::Config::Method] # attr_reader :get_gateway ## # RPC-specific configuration for `create_gateway` # @return [::Gapic::Config::Method] # attr_reader :create_gateway ## # RPC-specific configuration for `update_gateway` # @return [::Gapic::Config::Method] # attr_reader :update_gateway ## # RPC-specific configuration for `delete_gateway` # @return [::Gapic::Config::Method] # attr_reader :delete_gateway ## # RPC-specific configuration for `list_grpc_routes` # @return [::Gapic::Config::Method] # attr_reader :list_grpc_routes ## # RPC-specific configuration for `get_grpc_route` # @return [::Gapic::Config::Method] # attr_reader :get_grpc_route ## # RPC-specific configuration for `create_grpc_route` # @return [::Gapic::Config::Method] # attr_reader :create_grpc_route ## # RPC-specific configuration for `update_grpc_route` # @return [::Gapic::Config::Method] # attr_reader :update_grpc_route ## # RPC-specific configuration for `delete_grpc_route` # @return [::Gapic::Config::Method] # attr_reader :delete_grpc_route ## # RPC-specific configuration for `list_http_routes` # @return [::Gapic::Config::Method] # attr_reader :list_http_routes ## # RPC-specific configuration for `get_http_route` # @return [::Gapic::Config::Method] # attr_reader :get_http_route ## # RPC-specific configuration for `create_http_route` # @return [::Gapic::Config::Method] # attr_reader :create_http_route ## # RPC-specific configuration for `update_http_route` # @return [::Gapic::Config::Method] # attr_reader :update_http_route ## # RPC-specific configuration for `delete_http_route` # @return [::Gapic::Config::Method] # attr_reader :delete_http_route ## # RPC-specific configuration for `list_tcp_routes` # @return [::Gapic::Config::Method] # attr_reader :list_tcp_routes ## # RPC-specific configuration for `get_tcp_route` # @return [::Gapic::Config::Method] # attr_reader :get_tcp_route ## # RPC-specific configuration for `create_tcp_route` # @return [::Gapic::Config::Method] # attr_reader :create_tcp_route ## # RPC-specific configuration for `update_tcp_route` # @return [::Gapic::Config::Method] # attr_reader :update_tcp_route ## # RPC-specific configuration for `delete_tcp_route` # @return [::Gapic::Config::Method] # attr_reader :delete_tcp_route ## # RPC-specific configuration for `list_tls_routes` # @return [::Gapic::Config::Method] # attr_reader :list_tls_routes ## # RPC-specific configuration for `get_tls_route` # @return [::Gapic::Config::Method] # attr_reader :get_tls_route ## # RPC-specific configuration for `create_tls_route` # @return [::Gapic::Config::Method] # attr_reader :create_tls_route ## # RPC-specific configuration for `update_tls_route` # @return [::Gapic::Config::Method] # attr_reader :update_tls_route ## # RPC-specific configuration for `delete_tls_route` # @return [::Gapic::Config::Method] # attr_reader :delete_tls_route ## # RPC-specific configuration for `list_service_bindings` # @return [::Gapic::Config::Method] # attr_reader :list_service_bindings ## # RPC-specific configuration for `get_service_binding` # @return [::Gapic::Config::Method] # attr_reader :get_service_binding ## # RPC-specific configuration for `create_service_binding` # @return [::Gapic::Config::Method] # attr_reader :create_service_binding ## # RPC-specific configuration for `delete_service_binding` # @return [::Gapic::Config::Method] # attr_reader :delete_service_binding ## # RPC-specific configuration for `list_meshes` # @return [::Gapic::Config::Method] # attr_reader :list_meshes ## # RPC-specific configuration for `get_mesh` # @return [::Gapic::Config::Method] # attr_reader :get_mesh ## # RPC-specific configuration for `create_mesh` # @return [::Gapic::Config::Method] # attr_reader :create_mesh ## # RPC-specific configuration for `update_mesh` # @return [::Gapic::Config::Method] # attr_reader :update_mesh ## # RPC-specific configuration for `delete_mesh` # @return [::Gapic::Config::Method] # attr_reader :delete_mesh # @private def initialize parent_rpcs = nil list_endpoint_policies_config = parent_rpcs.list_endpoint_policies if parent_rpcs.respond_to? :list_endpoint_policies @list_endpoint_policies = ::Gapic::Config::Method.new list_endpoint_policies_config get_endpoint_policy_config = parent_rpcs.get_endpoint_policy if parent_rpcs.respond_to? :get_endpoint_policy @get_endpoint_policy = ::Gapic::Config::Method.new get_endpoint_policy_config create_endpoint_policy_config = parent_rpcs.create_endpoint_policy if parent_rpcs.respond_to? :create_endpoint_policy @create_endpoint_policy = ::Gapic::Config::Method.new create_endpoint_policy_config update_endpoint_policy_config = parent_rpcs.update_endpoint_policy if parent_rpcs.respond_to? :update_endpoint_policy @update_endpoint_policy = ::Gapic::Config::Method.new update_endpoint_policy_config delete_endpoint_policy_config = parent_rpcs.delete_endpoint_policy if parent_rpcs.respond_to? :delete_endpoint_policy @delete_endpoint_policy = ::Gapic::Config::Method.new delete_endpoint_policy_config list_gateways_config = parent_rpcs.list_gateways if parent_rpcs.respond_to? :list_gateways @list_gateways = ::Gapic::Config::Method.new list_gateways_config get_gateway_config = parent_rpcs.get_gateway if parent_rpcs.respond_to? :get_gateway @get_gateway = ::Gapic::Config::Method.new get_gateway_config create_gateway_config = parent_rpcs.create_gateway if parent_rpcs.respond_to? :create_gateway @create_gateway = ::Gapic::Config::Method.new create_gateway_config update_gateway_config = parent_rpcs.update_gateway if parent_rpcs.respond_to? :update_gateway @update_gateway = ::Gapic::Config::Method.new update_gateway_config delete_gateway_config = parent_rpcs.delete_gateway if parent_rpcs.respond_to? :delete_gateway @delete_gateway = ::Gapic::Config::Method.new delete_gateway_config list_grpc_routes_config = parent_rpcs.list_grpc_routes if parent_rpcs.respond_to? :list_grpc_routes @list_grpc_routes = ::Gapic::Config::Method.new list_grpc_routes_config get_grpc_route_config = parent_rpcs.get_grpc_route if parent_rpcs.respond_to? :get_grpc_route @get_grpc_route = ::Gapic::Config::Method.new get_grpc_route_config create_grpc_route_config = parent_rpcs.create_grpc_route if parent_rpcs.respond_to? :create_grpc_route @create_grpc_route = ::Gapic::Config::Method.new create_grpc_route_config update_grpc_route_config = parent_rpcs.update_grpc_route if parent_rpcs.respond_to? :update_grpc_route @update_grpc_route = ::Gapic::Config::Method.new update_grpc_route_config delete_grpc_route_config = parent_rpcs.delete_grpc_route if parent_rpcs.respond_to? :delete_grpc_route @delete_grpc_route = ::Gapic::Config::Method.new delete_grpc_route_config list_http_routes_config = parent_rpcs.list_http_routes if parent_rpcs.respond_to? :list_http_routes @list_http_routes = ::Gapic::Config::Method.new list_http_routes_config get_http_route_config = parent_rpcs.get_http_route if parent_rpcs.respond_to? :get_http_route @get_http_route = ::Gapic::Config::Method.new get_http_route_config create_http_route_config = parent_rpcs.create_http_route if parent_rpcs.respond_to? :create_http_route @create_http_route = ::Gapic::Config::Method.new create_http_route_config update_http_route_config = parent_rpcs.update_http_route if parent_rpcs.respond_to? :update_http_route @update_http_route = ::Gapic::Config::Method.new update_http_route_config delete_http_route_config = parent_rpcs.delete_http_route if parent_rpcs.respond_to? :delete_http_route @delete_http_route = ::Gapic::Config::Method.new delete_http_route_config list_tcp_routes_config = parent_rpcs.list_tcp_routes if parent_rpcs.respond_to? :list_tcp_routes @list_tcp_routes = ::Gapic::Config::Method.new list_tcp_routes_config get_tcp_route_config = parent_rpcs.get_tcp_route if parent_rpcs.respond_to? :get_tcp_route @get_tcp_route = ::Gapic::Config::Method.new get_tcp_route_config create_tcp_route_config = parent_rpcs.create_tcp_route if parent_rpcs.respond_to? :create_tcp_route @create_tcp_route = ::Gapic::Config::Method.new create_tcp_route_config update_tcp_route_config = parent_rpcs.update_tcp_route if parent_rpcs.respond_to? :update_tcp_route @update_tcp_route = ::Gapic::Config::Method.new update_tcp_route_config delete_tcp_route_config = parent_rpcs.delete_tcp_route if parent_rpcs.respond_to? :delete_tcp_route @delete_tcp_route = ::Gapic::Config::Method.new delete_tcp_route_config list_tls_routes_config = parent_rpcs.list_tls_routes if parent_rpcs.respond_to? :list_tls_routes @list_tls_routes = ::Gapic::Config::Method.new list_tls_routes_config get_tls_route_config = parent_rpcs.get_tls_route if parent_rpcs.respond_to? :get_tls_route @get_tls_route = ::Gapic::Config::Method.new get_tls_route_config create_tls_route_config = parent_rpcs.create_tls_route if parent_rpcs.respond_to? :create_tls_route @create_tls_route = ::Gapic::Config::Method.new create_tls_route_config update_tls_route_config = parent_rpcs.update_tls_route if parent_rpcs.respond_to? :update_tls_route @update_tls_route = ::Gapic::Config::Method.new update_tls_route_config delete_tls_route_config = parent_rpcs.delete_tls_route if parent_rpcs.respond_to? :delete_tls_route @delete_tls_route = ::Gapic::Config::Method.new delete_tls_route_config list_service_bindings_config = parent_rpcs.list_service_bindings if parent_rpcs.respond_to? :list_service_bindings @list_service_bindings = ::Gapic::Config::Method.new list_service_bindings_config get_service_binding_config = parent_rpcs.get_service_binding if parent_rpcs.respond_to? :get_service_binding @get_service_binding = ::Gapic::Config::Method.new get_service_binding_config create_service_binding_config = parent_rpcs.create_service_binding if parent_rpcs.respond_to? :create_service_binding @create_service_binding = ::Gapic::Config::Method.new create_service_binding_config delete_service_binding_config = parent_rpcs.delete_service_binding if parent_rpcs.respond_to? :delete_service_binding @delete_service_binding = ::Gapic::Config::Method.new delete_service_binding_config list_meshes_config = parent_rpcs.list_meshes if parent_rpcs.respond_to? :list_meshes @list_meshes = ::Gapic::Config::Method.new list_meshes_config get_mesh_config = parent_rpcs.get_mesh if parent_rpcs.respond_to? :get_mesh @get_mesh = ::Gapic::Config::Method.new get_mesh_config create_mesh_config = parent_rpcs.create_mesh if parent_rpcs.respond_to? :create_mesh @create_mesh = ::Gapic::Config::Method.new create_mesh_config update_mesh_config = parent_rpcs.update_mesh if parent_rpcs.respond_to? :update_mesh @update_mesh = ::Gapic::Config::Method.new update_mesh_config delete_mesh_config = parent_rpcs.delete_mesh if parent_rpcs.respond_to? :delete_mesh @delete_mesh = ::Gapic::Config::Method.new delete_mesh_config yield self if block_given? end end end end end end end end end end