lib/google/cloud/compute/v1/instances/rest/client.rb in google-cloud-compute-v1-0.2.0 vs lib/google/cloud/compute/v1/instances/rest/client.rb in google-cloud-compute-v1-0.3.0
- old
+ new
@@ -16,10 +16,11 @@
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
require "google/cloud/errors"
require "google/cloud/compute/v1/compute_pb"
+require "google/cloud/compute/v1/instances/rest/service_stub"
module Google
module Cloud
module Compute
module V1
@@ -29,29 +30,26 @@
# REST client for the Instances service.
#
# The Instances API.
#
class Client
- include GrpcTranscoding
-
# @private
attr_reader :instances_stub
##
# Configure the Instances Client class.
#
# See {::Google::Cloud::Compute::V1::Instances::Rest::Client::Configuration}
# for a description of the configuration fields.
#
- # ## Example
+ # @example
#
- # To modify the configuration for all Instances clients:
+ # # Modify the configuration for all Instances clients
+ # ::Google::Cloud::Compute::V1::Instances::Rest::Client.configure do |config|
+ # config.timeout = 10.0
+ # end
#
- # ::Google::Cloud::Compute::V1::Instances::Rest::Client.configure do |config|
- # config.timeout = 10.0
- # end
- #
# @yield [config] Configure the Client client.
# @yieldparam config [Client::Configuration]
#
# @return [Client::Configuration]
#
@@ -64,10 +62,124 @@
break parent_const.configure if parent_const.respond_to? :configure
namespace.pop
end
default_config = Client::Configuration.new parent_config
+ default_config.rpcs.add_access_config.timeout = 600.0
+
+ default_config.rpcs.add_resource_policies.timeout = 600.0
+
+ default_config.rpcs.aggregated_list.timeout = 600.0
+ default_config.rpcs.aggregated_list.retry_policy = {
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
+ }
+
+ default_config.rpcs.attach_disk.timeout = 600.0
+
+ default_config.rpcs.bulk_insert.timeout = 600.0
+
+ default_config.rpcs.delete.timeout = 600.0
+
+ default_config.rpcs.delete_access_config.timeout = 600.0
+
+ default_config.rpcs.detach_disk.timeout = 600.0
+
+ default_config.rpcs.get.timeout = 600.0
+ default_config.rpcs.get.retry_policy = {
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
+ }
+
+ default_config.rpcs.get_effective_firewalls.timeout = 600.0
+ default_config.rpcs.get_effective_firewalls.retry_policy = {
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
+ }
+
+ default_config.rpcs.get_guest_attributes.timeout = 600.0
+ default_config.rpcs.get_guest_attributes.retry_policy = {
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
+ }
+
+ default_config.rpcs.get_iam_policy.timeout = 600.0
+ default_config.rpcs.get_iam_policy.retry_policy = {
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
+ }
+
+ default_config.rpcs.get_screenshot.timeout = 600.0
+ default_config.rpcs.get_screenshot.retry_policy = {
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
+ }
+
+ default_config.rpcs.get_serial_port_output.timeout = 600.0
+ default_config.rpcs.get_serial_port_output.retry_policy = {
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
+ }
+
+ default_config.rpcs.get_shielded_instance_identity.timeout = 600.0
+ default_config.rpcs.get_shielded_instance_identity.retry_policy = {
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
+ }
+
+ default_config.rpcs.insert.timeout = 600.0
+
+ default_config.rpcs.list.timeout = 600.0
+ default_config.rpcs.list.retry_policy = {
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
+ }
+
+ default_config.rpcs.list_referrers.timeout = 600.0
+ default_config.rpcs.list_referrers.retry_policy = {
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
+ }
+
+ default_config.rpcs.remove_resource_policies.timeout = 600.0
+
+ default_config.rpcs.reset.timeout = 600.0
+
+ default_config.rpcs.set_deletion_protection.timeout = 600.0
+
+ default_config.rpcs.set_disk_auto_delete.timeout = 600.0
+
+ default_config.rpcs.set_iam_policy.timeout = 600.0
+
+ default_config.rpcs.set_labels.timeout = 600.0
+
+ default_config.rpcs.set_machine_resources.timeout = 600.0
+
+ default_config.rpcs.set_machine_type.timeout = 600.0
+
+ default_config.rpcs.set_metadata.timeout = 600.0
+
+ default_config.rpcs.set_min_cpu_platform.timeout = 600.0
+
+ default_config.rpcs.set_scheduling.timeout = 600.0
+
+ default_config.rpcs.set_service_account.timeout = 600.0
+
+ default_config.rpcs.set_shielded_instance_integrity_policy.timeout = 600.0
+
+ default_config.rpcs.set_tags.timeout = 600.0
+
+ default_config.rpcs.simulate_maintenance_event.timeout = 600.0
+
+ default_config.rpcs.start.timeout = 600.0
+
+ default_config.rpcs.start_with_encryption_key.timeout = 600.0
+
+ default_config.rpcs.stop.timeout = 600.0
+
+ default_config.rpcs.test_iam_permissions.timeout = 600.0
+
+ default_config.rpcs.update.timeout = 600.0
+
+ default_config.rpcs.update_access_config.timeout = 600.0
+
+ default_config.rpcs.update_display_device.timeout = 600.0
+
+ default_config.rpcs.update_network_interface.timeout = 600.0
+
+ default_config.rpcs.update_shielded_instance_config.timeout = 600.0
+
default_config
end
yield @configure if block_given?
@configure
end
@@ -93,46 +205,38 @@
end
##
# Create a new Instances REST client object.
#
- # ## Examples
+ # @example
#
- # To create a new Instances REST client with the default
- # configuration:
+ # # Create a client using the default configuration
+ # client = ::Google::Cloud::Compute::V1::Instances::Rest::Client.new
#
- # client = ::Google::Cloud::Compute::V1::Instances::Rest::Client.new
+ # # Create a client using a custom configuration
+ # client = ::Google::Cloud::Compute::V1::Instances::Rest::Client.new do |config|
+ # config.timeout = 10.0
+ # end
#
- # To create a new Instances REST client with a custom
- # configuration:
- #
- # client = ::Google::Cloud::Compute::V1::Instances::Rest::Client.new do |config|
- # config.timeout = 10.0
- # end
- #
# @yield [config] Configure the Instances client.
# @yieldparam config [Client::Configuration]
#
def initialize
- # These require statements are intentionally placed here to initialize
- # the REST modules only when it's required.
- require "gapic/rest"
-
# Create the configuration object
@config = Configuration.new Client.configure
# Yield the configuration if needed
yield @config if block_given?
# Create credentials
credentials = @config.credentials
credentials ||= Credentials.default scope: @config.scope
- if credentials.is_a?(String) || credentials.is_a?(Hash)
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
credentials = Credentials.new credentials, scope: @config.scope
end
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: @config.endpoint, credentials: credentials
+ @instances_stub = ::Google::Cloud::Compute::V1::Instances::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
end
# Service calls
##
@@ -169,15 +273,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def add_access_config request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -185,32 +289,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.add_access_config.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.add_access_config.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_add_access_config request
- response = @client_stub.make_post_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.add_access_config request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -246,15 +347,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def add_resource_policies request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -262,32 +363,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.add_resource_policies.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.add_resource_policies.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_add_resource_policies request
- response = @client_stub.make_post_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.add_resource_policies request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -332,16 +430,16 @@
# @param page_token [::String]
# Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
# @param project [::String]
# Project ID for this request.
# @param return_partial_success [::Boolean]
- # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::InstanceAggregatedList]
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::InstancesScopedList>]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::InstanceAggregatedList]
+ # @return [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::InstancesScopedList>]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def aggregated_list request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -349,31 +447,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.aggregated_list.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.aggregated_list.timeout,
metadata: call_metadata
- uri, _body, query_string_params = transcode_aggregated_list request
- response = @client_stub.make_get_request(
- uri: uri,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::InstanceAggregatedList.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.aggregated_list request, options do |result, response|
+ result = ::Gapic::Rest::PagedEnumerable.new @instances_stub, :aggregated_list, "items", request, result, 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
@@ -411,15 +507,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def attach_disk request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -427,39 +523,108 @@
# 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 = {}
+ call_metadata = @config.rpcs.attach_disk.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.attach_disk.timeout,
+ metadata: call_metadata
+
options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
+
+ @instances_stub.attach_disk request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
+
+ ##
+ # Creates multiple instances. Count specifies the number of instances to create.
+ #
+ # @overload bulk_insert(request, options = nil)
+ # Pass arguments to `bulk_insert` via a request object, either of type
+ # {::Google::Cloud::Compute::V1::BulkInsertInstanceRequest} or an equivalent Hash.
+ #
+ # @param request [::Google::Cloud::Compute::V1::BulkInsertInstanceRequest, ::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 bulk_insert(bulk_insert_instance_resource_resource: nil, project: nil, request_id: nil, zone: nil)
+ # Pass arguments to `bulk_insert` 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 bulk_insert_instance_resource_resource [::Google::Cloud::Compute::V1::BulkInsertInstanceResource, ::Hash]
+ # The body resource for this request
+ # @param project [::String]
+ # Project ID 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 zone [::String]
+ # The name of the zone for this request.
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
+ # @yieldparam response [::Faraday::Response]
+ #
+ # @return [::Gapic::Rest::BaseOperation]
+ #
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
+ def bulk_insert request, options = nil
+ raise ::ArgumentError, "request must be provided" if request.nil?
+
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::BulkInsertInstanceRequest
+
+ # 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.bulk_insert.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.bulk_insert.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_attach_disk request
- response = @client_stub.make_post_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.bulk_insert request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
##
- # Deletes the specified Instance resource. For more information, see Stopping or Deleting an Instance.
+ # Deletes the specified Instance resource. For more information, see Deleting an instance.
#
# @overload delete(request, options = nil)
# Pass arguments to `delete` via a request object, either of type
# {::Google::Cloud::Compute::V1::DeleteInstanceRequest} or an equivalent Hash.
#
@@ -486,15 +651,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def delete request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -502,31 +667,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.delete.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
metadata: call_metadata
- uri, _body, query_string_params = transcode_delete request
- response = @client_stub.make_delete_request(
- uri: uri,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.delete request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -564,15 +727,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def delete_access_config request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -580,31 +743,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.delete_access_config.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.delete_access_config.timeout,
metadata: call_metadata
- uri, _body, query_string_params = transcode_delete_access_config request
- response = @client_stub.make_post_request(
- uri: uri,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.delete_access_config request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -640,15 +801,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def detach_disk request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -656,31 +817,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.detach_disk.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.detach_disk.timeout,
metadata: call_metadata
- uri, _body, query_string_params = transcode_detach_disk request
- response = @client_stub.make_post_request(
- uri: uri,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.detach_disk request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -708,11 +867,11 @@
# Name of the instance resource to return.
# @param project [::String]
# Project ID for this request.
# @param zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
+ # @yield [result, response] Access the result along with the Faraday response object
# @yieldparam result [::Google::Cloud::Compute::V1::Instance]
# @yieldparam response [::Faraday::Response]
#
# @return [::Google::Cloud::Compute::V1::Instance]
#
@@ -724,30 +883,95 @@
# 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 = {}
+ call_metadata = @config.rpcs.get.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.get.timeout,
+ metadata: call_metadata
+
options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
+
+ @instances_stub.get request, options do |result, response|
+ 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
+
+ ##
+ # Returns effective firewalls applied to an interface of the instance.
+ #
+ # @overload get_effective_firewalls(request, options = nil)
+ # Pass arguments to `get_effective_firewalls` via a request object, either of type
+ # {::Google::Cloud::Compute::V1::GetEffectiveFirewallsInstanceRequest} or an equivalent Hash.
+ #
+ # @param request [::Google::Cloud::Compute::V1::GetEffectiveFirewallsInstanceRequest, ::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 get_effective_firewalls(instance: nil, network_interface: nil, project: nil, zone: nil)
+ # Pass arguments to `get_effective_firewalls` 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 instance [::String]
+ # Name of the instance scoping this request.
+ # @param network_interface [::String]
+ # The name of the network interface to get the effective firewalls.
+ # @param project [::String]
+ # Project ID for this request.
+ # @param zone [::String]
+ # The name of the zone for this request.
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Google::Cloud::Compute::V1::InstancesGetEffectiveFirewallsResponse]
+ # @yieldparam response [::Faraday::Response]
+ #
+ # @return [::Google::Cloud::Compute::V1::InstancesGetEffectiveFirewallsResponse]
+ #
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
+ def get_effective_firewalls request, options = nil
+ raise ::ArgumentError, "request must be provided" if request.nil?
+
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetEffectiveFirewallsInstanceRequest
+
+ # 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_effective_firewalls.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.get_effective_firewalls.timeout,
metadata: call_metadata
- uri, _body, _query_string_params = transcode_get request
- response = @client_stub.make_get_request(
- uri: uri,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Instance.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.get_effective_firewalls request, options do |result, response|
+ 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
@@ -779,11 +1003,11 @@
# Specifies the guest attributes path to be queried.
# @param variable_key [::String]
# Specifies the key for the guest attributes entry.
# @param zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
+ # @yield [result, response] Access the result along with the Faraday response object
# @yieldparam result [::Google::Cloud::Compute::V1::GuestAttributes]
# @yieldparam response [::Faraday::Response]
#
# @return [::Google::Cloud::Compute::V1::GuestAttributes]
#
@@ -795,31 +1019,28 @@
# 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 = {}
+ call_metadata = @config.rpcs.get_guest_attributes.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.get_guest_attributes.timeout,
metadata: call_metadata
- uri, _body, query_string_params = transcode_get_guest_attributes request
- response = @client_stub.make_get_request(
- uri: uri,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::GuestAttributes.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.get_guest_attributes request, options do |result, response|
+ 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
@@ -849,11 +1070,11 @@
# Project ID for this request.
# @param resource [::String]
# Name or id of the resource for this request.
# @param zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
+ # @yield [result, response] Access the result along with the Faraday response object
# @yieldparam result [::Google::Cloud::Compute::V1::Policy]
# @yieldparam response [::Faraday::Response]
#
# @return [::Google::Cloud::Compute::V1::Policy]
#
@@ -865,31 +1086,28 @@
# 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 = {}
+ call_metadata = @config.rpcs.get_iam_policy.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
metadata: call_metadata
- uri, _body, query_string_params = transcode_get_iam_policy request
- response = @client_stub.make_get_request(
- uri: uri,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.get_iam_policy request, options do |result, response|
+ 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
@@ -917,11 +1135,11 @@
# Name of the instance scoping this request.
# @param project [::String]
# Project ID for this request.
# @param zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
+ # @yield [result, response] Access the result along with the Faraday response object
# @yieldparam result [::Google::Cloud::Compute::V1::Screenshot]
# @yieldparam response [::Faraday::Response]
#
# @return [::Google::Cloud::Compute::V1::Screenshot]
#
@@ -933,30 +1151,28 @@
# 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 = {}
+ call_metadata = @config.rpcs.get_screenshot.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.get_screenshot.timeout,
metadata: call_metadata
- uri, _body, _query_string_params = transcode_get_screenshot request
- response = @client_stub.make_get_request(
- uri: uri,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Screenshot.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.get_screenshot request, options do |result, response|
+ 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
@@ -984,19 +1200,19 @@
# Name of the instance for this request.
# @param port [::Integer]
# Specifies which COM or serial port to retrieve data from.
# @param project [::String]
# Project ID for this request.
- # @param start [::String]
+ # @param start [::Integer]
# Specifies the starting byte position of the output to return. To start with the first byte of output to the specified port, omit this field or set it to `0`.
#
# If the output for that byte position is available, this field matches the `start` parameter sent with the request. If the amount of serial console output exceeds the size of the buffer (1 MB), the oldest output is discarded and is no longer available. If the requested start position refers to discarded output, the start position is adjusted to the oldest output still available, and the adjusted start position is returned as the `start` property value.
#
# You can also provide a negative start position, which translates to the most recent number of bytes written to the serial port. For example, -3 is interpreted as the most recent 3 bytes written to the serial console.
# @param zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
+ # @yield [result, response] Access the result along with the Faraday response object
# @yieldparam result [::Google::Cloud::Compute::V1::SerialPortOutput]
# @yieldparam response [::Faraday::Response]
#
# @return [::Google::Cloud::Compute::V1::SerialPortOutput]
#
@@ -1008,31 +1224,28 @@
# 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 = {}
+ call_metadata = @config.rpcs.get_serial_port_output.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.get_serial_port_output.timeout,
metadata: call_metadata
- uri, _body, query_string_params = transcode_get_serial_port_output request
- response = @client_stub.make_get_request(
- uri: uri,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::SerialPortOutput.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.get_serial_port_output request, options do |result, response|
+ 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
@@ -1060,11 +1273,11 @@
# Name or id of the instance scoping this request.
# @param project [::String]
# Project ID for this request.
# @param zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
+ # @yield [result, response] Access the result along with the Faraday response object
# @yieldparam result [::Google::Cloud::Compute::V1::ShieldedInstanceIdentity]
# @yieldparam response [::Faraday::Response]
#
# @return [::Google::Cloud::Compute::V1::ShieldedInstanceIdentity]
#
@@ -1076,30 +1289,28 @@
# 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 = {}
+ call_metadata = @config.rpcs.get_shielded_instance_identity.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.get_shielded_instance_identity.timeout,
metadata: call_metadata
- uri, _body, _query_string_params = transcode_get_shielded_instance_identity request
- response = @client_stub.make_get_request(
- uri: uri,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::ShieldedInstanceIdentity.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.get_shielded_instance_identity request, options do |result, response|
+ 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
@@ -1140,15 +1351,15 @@
# - https://www.googleapis.com/compute/v1/projects/project/global/instanceTemplates/instanceTemplate
# - projects/project/global/instanceTemplates/instanceTemplate
# - global/instanceTemplates/instanceTemplate
# @param zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def insert request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -1156,32 +1367,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.insert.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_insert request
- response = @client_stub.make_post_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.insert request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -1224,18 +1432,18 @@
# @param page_token [::String]
# Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
# @param project [::String]
# Project ID for this request.
# @param return_partial_success [::Boolean]
- # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
# @param zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::InstanceList]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Instance>]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::InstanceList]
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Instance>]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def list request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -1243,31 +1451,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.list.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
metadata: call_metadata
- uri, _body, query_string_params = transcode_list request
- response = @client_stub.make_get_request(
- uri: uri,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::InstanceList.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.list request, options do |result, response|
+ result = ::Gapic::Rest::PagedEnumerable.new @instances_stub, :list, "items", request, result, 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
@@ -1312,18 +1518,18 @@
# @param page_token [::String]
# Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
# @param project [::String]
# Project ID for this request.
# @param return_partial_success [::Boolean]
- # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
# @param zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::InstanceListReferrers]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Reference>]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::InstanceListReferrers]
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Reference>]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def list_referrers request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -1331,31 +1537,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.list_referrers.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.list_referrers.timeout,
metadata: call_metadata
- uri, _body, query_string_params = transcode_list_referrers request
- response = @client_stub.make_get_request(
- uri: uri,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::InstanceListReferrers.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.list_referrers request, options do |result, response|
+ result = ::Gapic::Rest::PagedEnumerable.new @instances_stub, :list_referrers, "items", request, result, 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
@@ -1391,15 +1595,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def remove_resource_policies request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -1407,32 +1611,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.remove_resource_policies.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.remove_resource_policies.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_remove_resource_policies request
- response = @client_stub.make_post_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.remove_resource_policies request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -1466,15 +1667,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def reset request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -1482,31 +1683,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.reset.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.reset.timeout,
metadata: call_metadata
- uri, _body, query_string_params = transcode_reset request
- response = @client_stub.make_post_request(
- uri: uri,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.reset request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -1542,15 +1741,15 @@
# 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.
# @param zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def set_deletion_protection request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -1558,31 +1757,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.set_deletion_protection.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.set_deletion_protection.timeout,
metadata: call_metadata
- uri, _body, query_string_params = transcode_set_deletion_protection request
- response = @client_stub.make_post_request(
- uri: uri,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.set_deletion_protection request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -1620,15 +1817,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def set_disk_auto_delete request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -1636,31 +1833,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.set_disk_auto_delete.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.set_disk_auto_delete.timeout,
metadata: call_metadata
- uri, _body, query_string_params = transcode_set_disk_auto_delete request
- response = @client_stub.make_post_request(
- uri: uri,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.set_disk_auto_delete request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -1690,11 +1885,11 @@
# Name or id of the resource for this request.
# @param zone [::String]
# The name of the zone for this request.
# @param zone_set_policy_request_resource [::Google::Cloud::Compute::V1::ZoneSetPolicyRequest, ::Hash]
# The body resource for this request
- # @yield [result, env] Access the result along with the Faraday environment object
+ # @yield [result, response] Access the result along with the Faraday response object
# @yieldparam result [::Google::Cloud::Compute::V1::Policy]
# @yieldparam response [::Faraday::Response]
#
# @return [::Google::Cloud::Compute::V1::Policy]
#
@@ -1706,31 +1901,28 @@
# 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 = {}
+ call_metadata = @config.rpcs.set_iam_policy.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
metadata: call_metadata
- uri, body, _query_string_params = transcode_set_iam_policy request
- response = @client_stub.make_post_request(
- uri: uri,
- body: body,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.set_iam_policy request, options do |result, response|
+ 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
@@ -1766,15 +1958,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @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?
@@ -1782,32 +1974,29 @@
# 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 = {}
+ 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.timeout,
+ options.apply_defaults timeout: @config.rpcs.set_labels.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_set_labels request
- response = @client_stub.make_post_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.set_labels request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -1843,15 +2032,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def set_machine_resources request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -1859,32 +2048,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.set_machine_resources.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.set_machine_resources.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_set_machine_resources request
- response = @client_stub.make_post_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.set_machine_resources request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -1920,15 +2106,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def set_machine_type request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -1936,32 +2122,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.set_machine_type.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.set_machine_type.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_set_machine_type request
- response = @client_stub.make_post_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.set_machine_type request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -1997,15 +2180,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def set_metadata request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -2013,32 +2196,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.set_metadata.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.set_metadata.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_set_metadata request
- response = @client_stub.make_post_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.set_metadata request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -2074,15 +2254,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def set_min_cpu_platform request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -2090,32 +2270,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.set_min_cpu_platform.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.set_min_cpu_platform.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_set_min_cpu_platform request
- response = @client_stub.make_post_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.set_min_cpu_platform request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -2151,15 +2328,15 @@
# The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
# @param scheduling_resource [::Google::Cloud::Compute::V1::Scheduling, ::Hash]
# The body resource for this request
# @param zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def set_scheduling request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -2167,32 +2344,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.set_scheduling.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.set_scheduling.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_set_scheduling request
- response = @client_stub.make_post_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.set_scheduling request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -2228,15 +2402,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def set_service_account request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -2244,32 +2418,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.set_service_account.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.set_service_account.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_set_service_account request
- response = @client_stub.make_post_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.set_service_account request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -2305,15 +2476,15 @@
# The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
# @param shielded_instance_integrity_policy_resource [::Google::Cloud::Compute::V1::ShieldedInstanceIntegrityPolicy, ::Hash]
# The body resource for this request
# @param zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def set_shielded_instance_integrity_policy request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -2321,32 +2492,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.set_shielded_instance_integrity_policy.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.set_shielded_instance_integrity_policy.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_set_shielded_instance_integrity_policy request
- response = @client_stub.make_patch_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.set_shielded_instance_integrity_policy request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -2382,15 +2550,15 @@
# The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
# @param tags_resource [::Google::Cloud::Compute::V1::Tags, ::Hash]
# The body resource for this request
# @param zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def set_tags request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -2398,32 +2566,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.set_tags.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.set_tags.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_set_tags request
- response = @client_stub.make_post_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.set_tags request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -2451,15 +2616,15 @@
# Name of the instance scoping this request.
# @param project [::String]
# Project ID for this request.
# @param zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def simulate_maintenance_event request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -2467,30 +2632,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.simulate_maintenance_event.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.simulate_maintenance_event.timeout,
metadata: call_metadata
- uri, _body, _query_string_params = transcode_simulate_maintenance_event request
- response = @client_stub.make_post_request(
- uri: uri,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.simulate_maintenance_event request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -2524,15 +2688,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def start request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -2540,31 +2704,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.start.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.start.timeout,
metadata: call_metadata
- uri, _body, query_string_params = transcode_start request
- response = @client_stub.make_post_request(
- uri: uri,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.start request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -2600,15 +2762,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def start_with_encryption_key request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -2616,32 +2778,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.start_with_encryption_key.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.start_with_encryption_key.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_start_with_encryption_key request
- response = @client_stub.make_post_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.start_with_encryption_key request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -2675,15 +2834,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def stop request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -2691,31 +2850,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.stop.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.stop.timeout,
metadata: call_metadata
- uri, _body, query_string_params = transcode_stop request
- response = @client_stub.make_post_request(
- uri: uri,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.stop request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -2745,11 +2902,11 @@
# Name or id of the resource for this request.
# @param test_permissions_request_resource [::Google::Cloud::Compute::V1::TestPermissionsRequest, ::Hash]
# The body resource for this request
# @param zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
+ # @yield [result, response] Access the result along with the Faraday response object
# @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
# @yieldparam response [::Faraday::Response]
#
# @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
#
@@ -2761,31 +2918,28 @@
# 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 = {}
+ call_metadata = @config.rpcs.test_iam_permissions.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
metadata: call_metadata
- uri, body, _query_string_params = transcode_test_iam_permissions request
- response = @client_stub.make_post_request(
- uri: uri,
- body: body,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::TestPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.test_iam_permissions request, options do |result, response|
+ 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
@@ -2825,15 +2979,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def update request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -2841,32 +2995,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.update.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.update.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_update request
- response = @client_stub.make_put_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.update request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -2904,15 +3055,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def update_access_config request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -2920,32 +3071,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.update_access_config.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.update_access_config.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_update_access_config request
- response = @client_stub.make_post_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.update_access_config request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -2981,15 +3129,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def update_display_device request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -2997,39 +3145,36 @@
# 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 = {}
+ call_metadata = @config.rpcs.update_display_device.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.update_display_device.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_update_display_device request
- response = @client_stub.make_patch_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.update_display_device request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
##
- # Updates an instance's network interface. This method follows PATCH semantics.
+ # Updates an instance's network interface. This method can only update an interface's alias IP range and attached network. See Modifying alias IP ranges for an existing instance for instructions on changing alias IP ranges. See Migrating a VM between networks for instructions on migrating an interface. This method follows PATCH semantics.
#
# @overload update_network_interface(request, options = nil)
# Pass arguments to `update_network_interface` via a request object, either of type
# {::Google::Cloud::Compute::V1::UpdateNetworkInterfaceInstanceRequest} or an equivalent Hash.
#
@@ -3060,15 +3205,15 @@
# 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 zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def update_network_interface request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -3076,32 +3221,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.update_network_interface.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.update_network_interface.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_update_network_interface request
- response = @client_stub.make_patch_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.update_network_interface request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -3137,15 +3279,15 @@
# The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
# @param shielded_instance_config_resource [::Google::Cloud::Compute::V1::ShieldedInstanceConfig, ::Hash]
# The body resource for this request
# @param zone [::String]
# The name of the zone for this request.
- # @yield [result, env] Access the result along with the Faraday environment object
- # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
+ # @yield [result, response] Access the result along with the Faraday response object
+ # @yieldparam result [::Gapic::Rest::BaseOperation]
# @yieldparam response [::Faraday::Response]
#
- # @return [::Google::Cloud::Compute::V1::Operation]
+ # @return [::Gapic::Rest::BaseOperation]
#
# @raise [::Google::Cloud::Error] if the REST call is aborted.
def update_shielded_instance_config request, options = nil
raise ::ArgumentError, "request must be provided" if request.nil?
@@ -3153,32 +3295,29 @@
# 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 = {}
+ call_metadata = @config.rpcs.update_shielded_instance_config.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.timeout,
+ options.apply_defaults timeout: @config.rpcs.update_shielded_instance_config.timeout,
metadata: call_metadata
- uri, body, query_string_params = transcode_update_shielded_instance_config request
- response = @client_stub.make_patch_request(
- uri: uri,
- body: body,
- params: query_string_params,
- options: options
- )
- result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata
- yield result, response if block_given?
- result
+ @instances_stub.update_shielded_instance_config request, options do |result, response|
+ result = ::Gapic::Rest::BaseOperation.new result
+ 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
@@ -3229,10 +3368,13 @@
# 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 REST headers to be sent with the call.
+ # @return [::Hash{::Symbol=>::String}]
#
class Configuration
extend ::Gapic::Config
config_attr :endpoint, "compute.googleapis.com", ::String
@@ -3242,15 +3384,343 @@
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
# @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 Instances 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
+ #
+ # there is one other field (`retry_policy`) that can be set
+ # but is currently not supported for REST Gapic libraries.
+ #
+ class Rpcs
+ ##
+ # RPC-specific configuration for `add_access_config`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :add_access_config
+ ##
+ # RPC-specific configuration for `add_resource_policies`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :add_resource_policies
+ ##
+ # RPC-specific configuration for `aggregated_list`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :aggregated_list
+ ##
+ # RPC-specific configuration for `attach_disk`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :attach_disk
+ ##
+ # RPC-specific configuration for `bulk_insert`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :bulk_insert
+ ##
+ # RPC-specific configuration for `delete`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :delete
+ ##
+ # RPC-specific configuration for `delete_access_config`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :delete_access_config
+ ##
+ # RPC-specific configuration for `detach_disk`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :detach_disk
+ ##
+ # RPC-specific configuration for `get`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :get
+ ##
+ # RPC-specific configuration for `get_effective_firewalls`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :get_effective_firewalls
+ ##
+ # RPC-specific configuration for `get_guest_attributes`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :get_guest_attributes
+ ##
+ # RPC-specific configuration for `get_iam_policy`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :get_iam_policy
+ ##
+ # RPC-specific configuration for `get_screenshot`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :get_screenshot
+ ##
+ # RPC-specific configuration for `get_serial_port_output`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :get_serial_port_output
+ ##
+ # RPC-specific configuration for `get_shielded_instance_identity`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :get_shielded_instance_identity
+ ##
+ # RPC-specific configuration for `insert`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :insert
+ ##
+ # RPC-specific configuration for `list`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :list
+ ##
+ # RPC-specific configuration for `list_referrers`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :list_referrers
+ ##
+ # RPC-specific configuration for `remove_resource_policies`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :remove_resource_policies
+ ##
+ # RPC-specific configuration for `reset`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :reset
+ ##
+ # RPC-specific configuration for `set_deletion_protection`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :set_deletion_protection
+ ##
+ # RPC-specific configuration for `set_disk_auto_delete`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :set_disk_auto_delete
+ ##
+ # RPC-specific configuration for `set_iam_policy`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :set_iam_policy
+ ##
+ # RPC-specific configuration for `set_labels`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :set_labels
+ ##
+ # RPC-specific configuration for `set_machine_resources`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :set_machine_resources
+ ##
+ # RPC-specific configuration for `set_machine_type`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :set_machine_type
+ ##
+ # RPC-specific configuration for `set_metadata`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :set_metadata
+ ##
+ # RPC-specific configuration for `set_min_cpu_platform`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :set_min_cpu_platform
+ ##
+ # RPC-specific configuration for `set_scheduling`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :set_scheduling
+ ##
+ # RPC-specific configuration for `set_service_account`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :set_service_account
+ ##
+ # RPC-specific configuration for `set_shielded_instance_integrity_policy`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :set_shielded_instance_integrity_policy
+ ##
+ # RPC-specific configuration for `set_tags`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :set_tags
+ ##
+ # RPC-specific configuration for `simulate_maintenance_event`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :simulate_maintenance_event
+ ##
+ # RPC-specific configuration for `start`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :start
+ ##
+ # RPC-specific configuration for `start_with_encryption_key`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :start_with_encryption_key
+ ##
+ # RPC-specific configuration for `stop`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :stop
+ ##
+ # RPC-specific configuration for `test_iam_permissions`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :test_iam_permissions
+ ##
+ # RPC-specific configuration for `update`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :update
+ ##
+ # RPC-specific configuration for `update_access_config`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :update_access_config
+ ##
+ # RPC-specific configuration for `update_display_device`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :update_display_device
+ ##
+ # RPC-specific configuration for `update_network_interface`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :update_network_interface
+ ##
+ # RPC-specific configuration for `update_shielded_instance_config`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :update_shielded_instance_config
+
+ # @private
+ def initialize parent_rpcs = nil
+ add_access_config_config = parent_rpcs.add_access_config if parent_rpcs.respond_to? :add_access_config
+ @add_access_config = ::Gapic::Config::Method.new add_access_config_config
+ add_resource_policies_config = parent_rpcs.add_resource_policies if parent_rpcs.respond_to? :add_resource_policies
+ @add_resource_policies = ::Gapic::Config::Method.new add_resource_policies_config
+ aggregated_list_config = parent_rpcs.aggregated_list if parent_rpcs.respond_to? :aggregated_list
+ @aggregated_list = ::Gapic::Config::Method.new aggregated_list_config
+ attach_disk_config = parent_rpcs.attach_disk if parent_rpcs.respond_to? :attach_disk
+ @attach_disk = ::Gapic::Config::Method.new attach_disk_config
+ bulk_insert_config = parent_rpcs.bulk_insert if parent_rpcs.respond_to? :bulk_insert
+ @bulk_insert = ::Gapic::Config::Method.new bulk_insert_config
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
+ @delete = ::Gapic::Config::Method.new delete_config
+ delete_access_config_config = parent_rpcs.delete_access_config if parent_rpcs.respond_to? :delete_access_config
+ @delete_access_config = ::Gapic::Config::Method.new delete_access_config_config
+ detach_disk_config = parent_rpcs.detach_disk if parent_rpcs.respond_to? :detach_disk
+ @detach_disk = ::Gapic::Config::Method.new detach_disk_config
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
+ @get = ::Gapic::Config::Method.new get_config
+ get_effective_firewalls_config = parent_rpcs.get_effective_firewalls if parent_rpcs.respond_to? :get_effective_firewalls
+ @get_effective_firewalls = ::Gapic::Config::Method.new get_effective_firewalls_config
+ get_guest_attributes_config = parent_rpcs.get_guest_attributes if parent_rpcs.respond_to? :get_guest_attributes
+ @get_guest_attributes = ::Gapic::Config::Method.new get_guest_attributes_config
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
+ get_screenshot_config = parent_rpcs.get_screenshot if parent_rpcs.respond_to? :get_screenshot
+ @get_screenshot = ::Gapic::Config::Method.new get_screenshot_config
+ get_serial_port_output_config = parent_rpcs.get_serial_port_output if parent_rpcs.respond_to? :get_serial_port_output
+ @get_serial_port_output = ::Gapic::Config::Method.new get_serial_port_output_config
+ get_shielded_instance_identity_config = parent_rpcs.get_shielded_instance_identity if parent_rpcs.respond_to? :get_shielded_instance_identity
+ @get_shielded_instance_identity = ::Gapic::Config::Method.new get_shielded_instance_identity_config
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
+ @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
+ list_referrers_config = parent_rpcs.list_referrers if parent_rpcs.respond_to? :list_referrers
+ @list_referrers = ::Gapic::Config::Method.new list_referrers_config
+ remove_resource_policies_config = parent_rpcs.remove_resource_policies if parent_rpcs.respond_to? :remove_resource_policies
+ @remove_resource_policies = ::Gapic::Config::Method.new remove_resource_policies_config
+ reset_config = parent_rpcs.reset if parent_rpcs.respond_to? :reset
+ @reset = ::Gapic::Config::Method.new reset_config
+ set_deletion_protection_config = parent_rpcs.set_deletion_protection if parent_rpcs.respond_to? :set_deletion_protection
+ @set_deletion_protection = ::Gapic::Config::Method.new set_deletion_protection_config
+ set_disk_auto_delete_config = parent_rpcs.set_disk_auto_delete if parent_rpcs.respond_to? :set_disk_auto_delete
+ @set_disk_auto_delete = ::Gapic::Config::Method.new set_disk_auto_delete_config
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
+ set_labels_config = parent_rpcs.set_labels if parent_rpcs.respond_to? :set_labels
+ @set_labels = ::Gapic::Config::Method.new set_labels_config
+ set_machine_resources_config = parent_rpcs.set_machine_resources if parent_rpcs.respond_to? :set_machine_resources
+ @set_machine_resources = ::Gapic::Config::Method.new set_machine_resources_config
+ set_machine_type_config = parent_rpcs.set_machine_type if parent_rpcs.respond_to? :set_machine_type
+ @set_machine_type = ::Gapic::Config::Method.new set_machine_type_config
+ set_metadata_config = parent_rpcs.set_metadata if parent_rpcs.respond_to? :set_metadata
+ @set_metadata = ::Gapic::Config::Method.new set_metadata_config
+ set_min_cpu_platform_config = parent_rpcs.set_min_cpu_platform if parent_rpcs.respond_to? :set_min_cpu_platform
+ @set_min_cpu_platform = ::Gapic::Config::Method.new set_min_cpu_platform_config
+ set_scheduling_config = parent_rpcs.set_scheduling if parent_rpcs.respond_to? :set_scheduling
+ @set_scheduling = ::Gapic::Config::Method.new set_scheduling_config
+ set_service_account_config = parent_rpcs.set_service_account if parent_rpcs.respond_to? :set_service_account
+ @set_service_account = ::Gapic::Config::Method.new set_service_account_config
+ set_shielded_instance_integrity_policy_config = parent_rpcs.set_shielded_instance_integrity_policy if parent_rpcs.respond_to? :set_shielded_instance_integrity_policy
+ @set_shielded_instance_integrity_policy = ::Gapic::Config::Method.new set_shielded_instance_integrity_policy_config
+ set_tags_config = parent_rpcs.set_tags if parent_rpcs.respond_to? :set_tags
+ @set_tags = ::Gapic::Config::Method.new set_tags_config
+ simulate_maintenance_event_config = parent_rpcs.simulate_maintenance_event if parent_rpcs.respond_to? :simulate_maintenance_event
+ @simulate_maintenance_event = ::Gapic::Config::Method.new simulate_maintenance_event_config
+ start_config = parent_rpcs.start if parent_rpcs.respond_to? :start
+ @start = ::Gapic::Config::Method.new start_config
+ start_with_encryption_key_config = parent_rpcs.start_with_encryption_key if parent_rpcs.respond_to? :start_with_encryption_key
+ @start_with_encryption_key = ::Gapic::Config::Method.new start_with_encryption_key_config
+ stop_config = parent_rpcs.stop if parent_rpcs.respond_to? :stop
+ @stop = ::Gapic::Config::Method.new stop_config
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
+ update_config = parent_rpcs.update if parent_rpcs.respond_to? :update
+ @update = ::Gapic::Config::Method.new update_config
+ update_access_config_config = parent_rpcs.update_access_config if parent_rpcs.respond_to? :update_access_config
+ @update_access_config = ::Gapic::Config::Method.new update_access_config_config
+ update_display_device_config = parent_rpcs.update_display_device if parent_rpcs.respond_to? :update_display_device
+ @update_display_device = ::Gapic::Config::Method.new update_display_device_config
+ update_network_interface_config = parent_rpcs.update_network_interface if parent_rpcs.respond_to? :update_network_interface
+ @update_network_interface = ::Gapic::Config::Method.new update_network_interface_config
+ update_shielded_instance_config_config = parent_rpcs.update_shielded_instance_config if parent_rpcs.respond_to? :update_shielded_instance_config
+ @update_shielded_instance_config = ::Gapic::Config::Method.new update_shielded_instance_config_config
+
+ yield self if block_given?
+ end
end
end
end
end
end