Skip to content

Commit d1f9c19

Browse files
feat: Update Compute Engine v1 API to revision 20250902 (googleapis#31517)
* feat: Update Compute Engine v1 API to revision 20250902 Source-Link: googleapis/googleapis@57ddfb3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/1b8795252fb62b45eb8e946cd617d2340033a52a Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWNvbXB1dGUtdjEvLk93bEJvdC55YW1sIiwiaCI6IjFiODc5NTI1MmZiNjJiNDVlYjhlOTQ2Y2Q2MTdkMjM0MDAzM2E1MmEifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 5999b61 commit d1f9c19

25 files changed

Lines changed: 2070 additions & 12 deletions

File tree

google-cloud-compute-v1/lib/google/cloud/compute/v1/addresses/rest/client.rb

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ def self.configure
9494

9595
default_config.rpcs.set_labels.timeout = 600.0
9696

97+
default_config.rpcs.test_iam_permissions.timeout = 600.0
98+
9799
default_config
98100
end
99101
yield @configure if block_given?
@@ -860,6 +862,90 @@ def set_labels request, options = nil
860862
raise ::Google::Cloud::Error.from_error(e)
861863
end
862864

865+
##
866+
# Returns permissions that a caller has on the specified resource.
867+
#
868+
# @overload test_iam_permissions(request, options = nil)
869+
# Pass arguments to `test_iam_permissions` via a request object, either of type
870+
# {::Google::Cloud::Compute::V1::TestIamPermissionsAddressRequest} or an equivalent Hash.
871+
#
872+
# @param request [::Google::Cloud::Compute::V1::TestIamPermissionsAddressRequest, ::Hash]
873+
# A request object representing the call parameters. Required. To specify no
874+
# parameters, or to keep all the default parameter values, pass an empty Hash.
875+
# @param options [::Gapic::CallOptions, ::Hash]
876+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
877+
#
878+
# @overload test_iam_permissions(project: nil, region: nil, resource: nil, test_permissions_request_resource: nil)
879+
# Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
880+
# least one keyword argument is required. To specify no parameters, or to keep all
881+
# the default parameter values, pass an empty Hash as a request object (see above).
882+
#
883+
# @param project [::String]
884+
# Project ID for this request.
885+
# @param region [::String]
886+
# The name of the region for this request.
887+
# @param resource [::String]
888+
# Name or id of the resource for this request.
889+
# @param test_permissions_request_resource [::Google::Cloud::Compute::V1::TestPermissionsRequest, ::Hash]
890+
# The body resource for this request
891+
# @yield [result, operation] Access the result along with the TransportOperation object
892+
# @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
893+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
894+
#
895+
# @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
896+
#
897+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
898+
#
899+
# @example Basic example
900+
# require "google/cloud/compute/v1"
901+
#
902+
# # Create a client object. The client can be reused for multiple calls.
903+
# client = Google::Cloud::Compute::V1::Addresses::Rest::Client.new
904+
#
905+
# # Create a request. To set request fields, pass in keyword arguments.
906+
# request = Google::Cloud::Compute::V1::TestIamPermissionsAddressRequest.new
907+
#
908+
# # Call the test_iam_permissions method.
909+
# result = client.test_iam_permissions request
910+
#
911+
# # The returned object is of type Google::Cloud::Compute::V1::TestPermissionsResponse.
912+
# p result
913+
#
914+
def test_iam_permissions request, options = nil
915+
raise ::ArgumentError, "request must be provided" if request.nil?
916+
917+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::TestIamPermissionsAddressRequest
918+
919+
# Converts hash and nil to an options object
920+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
921+
922+
# Customize the options with defaults
923+
call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
924+
925+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
926+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
927+
lib_name: @config.lib_name, lib_version: @config.lib_version,
928+
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
929+
transports_version_send: [:rest]
930+
931+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
932+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
933+
934+
options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
935+
metadata: call_metadata,
936+
retry_policy: @config.rpcs.test_iam_permissions.retry_policy
937+
938+
options.apply_defaults timeout: @config.timeout,
939+
metadata: @config.metadata,
940+
retry_policy: @config.retry_policy
941+
942+
@addresses_stub.test_iam_permissions request, options do |result, operation|
943+
yield result, operation if block_given?
944+
end
945+
rescue ::Gapic::Rest::Error => e
946+
raise ::Google::Cloud::Error.from_error(e)
947+
end
948+
863949
##
864950
# Configuration class for the Addresses REST API.
865951
#
@@ -1041,6 +1127,11 @@ class Rpcs
10411127
# @return [::Gapic::Config::Method]
10421128
#
10431129
attr_reader :set_labels
1130+
##
1131+
# RPC-specific configuration for `test_iam_permissions`
1132+
# @return [::Gapic::Config::Method]
1133+
#
1134+
attr_reader :test_iam_permissions
10441135

10451136
# @private
10461137
def initialize parent_rpcs = nil
@@ -1058,6 +1149,8 @@ def initialize parent_rpcs = nil
10581149
@move = ::Gapic::Config::Method.new move_config
10591150
set_labels_config = parent_rpcs.set_labels if parent_rpcs.respond_to? :set_labels
10601151
@set_labels = ::Gapic::Config::Method.new set_labels_config
1152+
test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1153+
@test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
10611154

10621155
yield self if block_given?
10631156
end

google-cloud-compute-v1/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,46 @@ def set_labels request_pb, options = nil
353353
end
354354
end
355355

356+
##
357+
# Baseline implementation for the test_iam_permissions REST call
358+
#
359+
# @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsAddressRequest]
360+
# A request object representing the call parameters. Required.
361+
# @param options [::Gapic::CallOptions]
362+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
363+
#
364+
# @yield [result, operation] Access the result along with the TransportOperation object
365+
# @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
366+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
367+
#
368+
# @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
369+
# A result object deserialized from the server's reply
370+
def test_iam_permissions request_pb, options = nil
371+
raise ::ArgumentError, "request must be provided" if request_pb.nil?
372+
373+
verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb
374+
query_string_params = if query_string_params.any?
375+
query_string_params.to_h { |p| p.split "=", 2 }
376+
else
377+
{}
378+
end
379+
380+
response = @client_stub.make_http_request(
381+
verb,
382+
uri: uri,
383+
body: body || "",
384+
params: query_string_params,
385+
method_name: "test_iam_permissions",
386+
options: options
387+
)
388+
operation = ::Gapic::Rest::TransportOperation.new response
389+
result = ::Google::Cloud::Compute::V1::TestPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
390+
catch :response do
391+
yield result, operation if block_given?
392+
result
393+
end
394+
end
395+
356396
##
357397
# @private
358398
#
@@ -512,6 +552,30 @@ def self.transcode_set_labels_request request_pb
512552
)
513553
transcoder.transcode request_pb
514554
end
555+
556+
##
557+
# @private
558+
#
559+
# GRPC transcoding helper method for the test_iam_permissions REST call
560+
#
561+
# @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsAddressRequest]
562+
# A request object representing the call parameters. Required.
563+
# @return [Array(String, [String, nil], Hash{String => String})]
564+
# Uri, Body, Query string parameters
565+
def self.transcode_test_iam_permissions_request request_pb
566+
transcoder = Gapic::Rest::GrpcTranscoder.new
567+
.with_bindings(
568+
uri_method: :post,
569+
uri_template: "/compute/v1/projects/{project}/regions/{region}/addresses/{resource}/testIamPermissions",
570+
body: "test_permissions_request_resource",
571+
matches: [
572+
["project", %r{^[^/]+/?$}, false],
573+
["region", %r{^[^/]+/?$}, false],
574+
["resource", %r{^[^/]+/?$}, false]
575+
]
576+
)
577+
transcoder.transcode request_pb
578+
end
515579
end
516580
end
517581
end

google-cloud-compute-v1/lib/google/cloud/compute/v1/compute_pb.rb

Lines changed: 18 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

google-cloud-compute-v1/lib/google/cloud/compute/v1/global_addresses/rest/client.rb

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ def self.configure
8989

9090
default_config.rpcs.set_labels.timeout = 600.0
9191

92+
default_config.rpcs.test_iam_permissions.timeout = 600.0
93+
9294
default_config
9395
end
9496
yield @configure if block_given?
@@ -743,6 +745,88 @@ def set_labels request, options = nil
743745
raise ::Google::Cloud::Error.from_error(e)
744746
end
745747

748+
##
749+
# Returns permissions that a caller has on the specified resource.
750+
#
751+
# @overload test_iam_permissions(request, options = nil)
752+
# Pass arguments to `test_iam_permissions` via a request object, either of type
753+
# {::Google::Cloud::Compute::V1::TestIamPermissionsGlobalAddressRequest} or an equivalent Hash.
754+
#
755+
# @param request [::Google::Cloud::Compute::V1::TestIamPermissionsGlobalAddressRequest, ::Hash]
756+
# A request object representing the call parameters. Required. To specify no
757+
# parameters, or to keep all the default parameter values, pass an empty Hash.
758+
# @param options [::Gapic::CallOptions, ::Hash]
759+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
760+
#
761+
# @overload test_iam_permissions(project: nil, resource: nil, test_permissions_request_resource: nil)
762+
# Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
763+
# least one keyword argument is required. To specify no parameters, or to keep all
764+
# the default parameter values, pass an empty Hash as a request object (see above).
765+
#
766+
# @param project [::String]
767+
# Project ID for this request.
768+
# @param resource [::String]
769+
# Name or id of the resource for this request.
770+
# @param test_permissions_request_resource [::Google::Cloud::Compute::V1::TestPermissionsRequest, ::Hash]
771+
# The body resource for this request
772+
# @yield [result, operation] Access the result along with the TransportOperation object
773+
# @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
774+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
775+
#
776+
# @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
777+
#
778+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
779+
#
780+
# @example Basic example
781+
# require "google/cloud/compute/v1"
782+
#
783+
# # Create a client object. The client can be reused for multiple calls.
784+
# client = Google::Cloud::Compute::V1::GlobalAddresses::Rest::Client.new
785+
#
786+
# # Create a request. To set request fields, pass in keyword arguments.
787+
# request = Google::Cloud::Compute::V1::TestIamPermissionsGlobalAddressRequest.new
788+
#
789+
# # Call the test_iam_permissions method.
790+
# result = client.test_iam_permissions request
791+
#
792+
# # The returned object is of type Google::Cloud::Compute::V1::TestPermissionsResponse.
793+
# p result
794+
#
795+
def test_iam_permissions request, options = nil
796+
raise ::ArgumentError, "request must be provided" if request.nil?
797+
798+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::TestIamPermissionsGlobalAddressRequest
799+
800+
# Converts hash and nil to an options object
801+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
802+
803+
# Customize the options with defaults
804+
call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
805+
806+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
807+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
808+
lib_name: @config.lib_name, lib_version: @config.lib_version,
809+
gapic_version: ::Google::Cloud::Compute::V1::VERSION,
810+
transports_version_send: [:rest]
811+
812+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
813+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
814+
815+
options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
816+
metadata: call_metadata,
817+
retry_policy: @config.rpcs.test_iam_permissions.retry_policy
818+
819+
options.apply_defaults timeout: @config.timeout,
820+
metadata: @config.metadata,
821+
retry_policy: @config.retry_policy
822+
823+
@global_addresses_stub.test_iam_permissions request, options do |result, operation|
824+
yield result, operation if block_given?
825+
end
826+
rescue ::Gapic::Rest::Error => e
827+
raise ::Google::Cloud::Error.from_error(e)
828+
end
829+
746830
##
747831
# Configuration class for the GlobalAddresses REST API.
748832
#
@@ -919,6 +1003,11 @@ class Rpcs
9191003
# @return [::Gapic::Config::Method]
9201004
#
9211005
attr_reader :set_labels
1006+
##
1007+
# RPC-specific configuration for `test_iam_permissions`
1008+
# @return [::Gapic::Config::Method]
1009+
#
1010+
attr_reader :test_iam_permissions
9221011

9231012
# @private
9241013
def initialize parent_rpcs = nil
@@ -934,6 +1023,8 @@ def initialize parent_rpcs = nil
9341023
@move = ::Gapic::Config::Method.new move_config
9351024
set_labels_config = parent_rpcs.set_labels if parent_rpcs.respond_to? :set_labels
9361025
@set_labels = ::Gapic::Config::Method.new set_labels_config
1026+
test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1027+
@test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
9371028

9381029
yield self if block_given?
9391030
end

0 commit comments

Comments
 (0)