lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb in google-cloud-compute-v1-1.6.0 vs lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb in google-cloud-compute-v1-1.7.0
- old
+ new
@@ -84,10 +84,12 @@
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
}
default_config.rpcs.patch.timeout = 600.0
+ default_config.rpcs.set_labels.timeout = 600.0
+
default_config
end
yield @configure if block_given?
@configure
end
@@ -603,10 +605,88 @@
gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
raise ::Google::Cloud::Error.from_error(gapic_error)
end
##
+ # Sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation.
+ #
+ # @overload set_labels(request, options = nil)
+ # Pass arguments to `set_labels` via a request object, either of type
+ # {::Google::Cloud::Compute::V1::SetLabelsInterconnectAttachmentRequest} or an equivalent Hash.
+ #
+ # @param request [::Google::Cloud::Compute::V1::SetLabelsInterconnectAttachmentRequest, ::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.
+ # Note: currently retry functionality is not implemented. While it is possible
+ # to set it using ::Gapic::CallOptions, it will not be applied
+ #
+ # @overload set_labels(project: nil, region: nil, region_set_labels_request_resource: nil, request_id: nil, resource: nil)
+ # Pass arguments to `set_labels` 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 project [::String]
+ # Project ID for this request.
+ # @param region [::String]
+ # The region for this request.
+ # @param region_set_labels_request_resource [::Google::Cloud::Compute::V1::RegionSetLabelsRequest, ::Hash]
+ # The body resource for this request
+ # @param request_id [::String]
+ # An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
+ # @param resource [::String]
+ # Name or id of the resource for this request.
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
+ # @yieldparam response [::Faraday::Response]
+ #
+ # @return [::Gapic::GenericLRO::Operation]
+ #
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
+ def set_labels request, options = nil
+ raise ::ArgumentError, "request must be provided" if request.nil?
+
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetLabelsInterconnectAttachmentRequest
+
+ # 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.set_labels.metadata.to_h
+
+ # Set x-goog-api-client header
+ 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::Compute::V1::VERSION,
+ transports_version_send: [:rest]
+
+ options.apply_defaults timeout: @config.rpcs.set_labels.timeout,
+ metadata: call_metadata
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
+
+ @interconnect_attachments_stub.set_labels request, options do |result, response|
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
+ operation: result,
+ client: region_operations,
+ request_values: {
+ "project" => request.project,
+ "region" => request.region
+ },
+ options: options
+ )
+ yield result, response if block_given?
+ return result
+ end
+ rescue ::Faraday::Error => e
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
+ raise ::Google::Cloud::Error.from_error(gapic_error)
+ end
+
+ ##
# Configuration class for the InterconnectAttachments REST API.
#
# This class represents the configuration for InterconnectAttachments REST,
# providing control over credentials, timeouts, retry behavior, logging.
#
@@ -731,10 +811,15 @@
##
# RPC-specific configuration for `patch`
# @return [::Gapic::Config::Method]
#
attr_reader :patch
+ ##
+ # RPC-specific configuration for `set_labels`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :set_labels
# @private
def initialize parent_rpcs = nil
aggregated_list_config = parent_rpcs.aggregated_list if parent_rpcs.respond_to? :aggregated_list
@aggregated_list = ::Gapic::Config::Method.new aggregated_list_config
@@ -746,9 +831,11 @@
@insert = ::Gapic::Config::Method.new insert_config
list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
@list = ::Gapic::Config::Method.new list_config
patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
@patch = ::Gapic::Config::Method.new patch_config
+ set_labels_config = parent_rpcs.set_labels if parent_rpcs.respond_to? :set_labels
+ @set_labels = ::Gapic::Config::Method.new set_labels_config
yield self if block_given?
end
end
end