google-cloud-compute-v1 3.3.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -113,6 +113,46 @@ module Google
113
113
  end
114
114
  end
115
115
 
116
+ ##
117
+ # Baseline implementation for the add_network_interface REST call
118
+ #
119
+ # @param request_pb [::Google::Cloud::Compute::V1::AddNetworkInterfaceInstanceRequest]
120
+ # A request object representing the call parameters. Required.
121
+ # @param options [::Gapic::CallOptions]
122
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
123
+ #
124
+ # @yield [result, operation] Access the result along with the TransportOperation object
125
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
126
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
127
+ #
128
+ # @return [::Google::Cloud::Compute::V1::Operation]
129
+ # A result object deserialized from the server's reply
130
+ def add_network_interface request_pb, options = nil
131
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
132
+
133
+ verb, uri, query_string_params, body = ServiceStub.transcode_add_network_interface_request request_pb
134
+ query_string_params = if query_string_params.any?
135
+ query_string_params.to_h { |p| p.split "=", 2 }
136
+ else
137
+ {}
138
+ end
139
+
140
+ response = @client_stub.make_http_request(
141
+ verb,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "add_network_interface",
146
+ options: options
147
+ )
148
+ operation = ::Gapic::Rest::TransportOperation.new response
149
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
154
+ end
155
+
116
156
  ##
117
157
  # Baseline implementation for the add_resource_policies REST call
118
158
  #
@@ -353,6 +393,46 @@ module Google
353
393
  end
354
394
  end
355
395
 
396
+ ##
397
+ # Baseline implementation for the delete_network_interface REST call
398
+ #
399
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteNetworkInterfaceInstanceRequest]
400
+ # A request object representing the call parameters. Required.
401
+ # @param options [::Gapic::CallOptions]
402
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
403
+ #
404
+ # @yield [result, operation] Access the result along with the TransportOperation object
405
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
406
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
407
+ #
408
+ # @return [::Google::Cloud::Compute::V1::Operation]
409
+ # A result object deserialized from the server's reply
410
+ def delete_network_interface request_pb, options = nil
411
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
412
+
413
+ verb, uri, query_string_params, body = ServiceStub.transcode_delete_network_interface_request request_pb
414
+ query_string_params = if query_string_params.any?
415
+ query_string_params.to_h { |p| p.split "=", 2 }
416
+ else
417
+ {}
418
+ end
419
+
420
+ response = @client_stub.make_http_request(
421
+ verb,
422
+ uri: uri,
423
+ body: body || "",
424
+ params: query_string_params,
425
+ method_name: "delete_network_interface",
426
+ options: options
427
+ )
428
+ operation = ::Gapic::Rest::TransportOperation.new response
429
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
430
+ catch :response do
431
+ yield result, operation if block_given?
432
+ result
433
+ end
434
+ end
435
+
356
436
  ##
357
437
  # Baseline implementation for the detach_disk REST call
358
438
  #
@@ -2057,6 +2137,30 @@ module Google
2057
2137
  transcoder.transcode request_pb
2058
2138
  end
2059
2139
 
2140
+ ##
2141
+ # @private
2142
+ #
2143
+ # GRPC transcoding helper method for the add_network_interface REST call
2144
+ #
2145
+ # @param request_pb [::Google::Cloud::Compute::V1::AddNetworkInterfaceInstanceRequest]
2146
+ # A request object representing the call parameters. Required.
2147
+ # @return [Array(String, [String, nil], Hash{String => String})]
2148
+ # Uri, Body, Query string parameters
2149
+ def self.transcode_add_network_interface_request request_pb
2150
+ transcoder = Gapic::Rest::GrpcTranscoder.new
2151
+ .with_bindings(
2152
+ uri_method: :post,
2153
+ uri_template: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/addNetworkInterface",
2154
+ body: "network_interface_resource",
2155
+ matches: [
2156
+ ["project", %r{^[^/]+/?$}, false],
2157
+ ["zone", %r{^[^/]+/?$}, false],
2158
+ ["instance", %r{^[^/]+/?$}, false]
2159
+ ]
2160
+ )
2161
+ transcoder.transcode request_pb
2162
+ end
2163
+
2060
2164
  ##
2061
2165
  # @private
2062
2166
  #
@@ -2195,6 +2299,29 @@ module Google
2195
2299
  transcoder.transcode request_pb
2196
2300
  end
2197
2301
 
2302
+ ##
2303
+ # @private
2304
+ #
2305
+ # GRPC transcoding helper method for the delete_network_interface REST call
2306
+ #
2307
+ # @param request_pb [::Google::Cloud::Compute::V1::DeleteNetworkInterfaceInstanceRequest]
2308
+ # A request object representing the call parameters. Required.
2309
+ # @return [Array(String, [String, nil], Hash{String => String})]
2310
+ # Uri, Body, Query string parameters
2311
+ def self.transcode_delete_network_interface_request request_pb
2312
+ transcoder = Gapic::Rest::GrpcTranscoder.new
2313
+ .with_bindings(
2314
+ uri_method: :post,
2315
+ uri_template: "/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/deleteNetworkInterface",
2316
+ matches: [
2317
+ ["project", %r{^[^/]+/?$}, false],
2318
+ ["zone", %r{^[^/]+/?$}, false],
2319
+ ["instance", %r{^[^/]+/?$}, false]
2320
+ ]
2321
+ )
2322
+ transcoder.transcode request_pb
2323
+ end
2324
+
2198
2325
  ##
2199
2326
  # @private
2200
2327
  #
@@ -85,6 +85,8 @@ module Google
85
85
 
86
86
  default_config.rpcs.set_named_ports.timeout = 600.0
87
87
 
88
+ default_config.rpcs.test_iam_permissions.timeout = 600.0
89
+
88
90
  default_config
89
91
  end
90
92
  yield @configure if block_given?
@@ -569,6 +571,90 @@ module Google
569
571
  raise ::Google::Cloud::Error.from_error(e)
570
572
  end
571
573
 
574
+ ##
575
+ # Returns permissions that a caller has on the specified resource.
576
+ #
577
+ # @overload test_iam_permissions(request, options = nil)
578
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
579
+ # {::Google::Cloud::Compute::V1::TestIamPermissionsRegionInstanceGroupRequest} or an equivalent Hash.
580
+ #
581
+ # @param request [::Google::Cloud::Compute::V1::TestIamPermissionsRegionInstanceGroupRequest, ::Hash]
582
+ # A request object representing the call parameters. Required. To specify no
583
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
584
+ # @param options [::Gapic::CallOptions, ::Hash]
585
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
586
+ #
587
+ # @overload test_iam_permissions(project: nil, region: nil, resource: nil, test_permissions_request_resource: nil)
588
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
589
+ # least one keyword argument is required. To specify no parameters, or to keep all
590
+ # the default parameter values, pass an empty Hash as a request object (see above).
591
+ #
592
+ # @param project [::String]
593
+ # Project ID for this request.
594
+ # @param region [::String]
595
+ # The name of the region for this request.
596
+ # @param resource [::String]
597
+ # Name or id of the resource for this request.
598
+ # @param test_permissions_request_resource [::Google::Cloud::Compute::V1::TestPermissionsRequest, ::Hash]
599
+ # The body resource for this request
600
+ # @yield [result, operation] Access the result along with the TransportOperation object
601
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
602
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
603
+ #
604
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
605
+ #
606
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
607
+ #
608
+ # @example Basic example
609
+ # require "google/cloud/compute/v1"
610
+ #
611
+ # # Create a client object. The client can be reused for multiple calls.
612
+ # client = Google::Cloud::Compute::V1::RegionInstanceGroups::Rest::Client.new
613
+ #
614
+ # # Create a request. To set request fields, pass in keyword arguments.
615
+ # request = Google::Cloud::Compute::V1::TestIamPermissionsRegionInstanceGroupRequest.new
616
+ #
617
+ # # Call the test_iam_permissions method.
618
+ # result = client.test_iam_permissions request
619
+ #
620
+ # # The returned object is of type Google::Cloud::Compute::V1::TestPermissionsResponse.
621
+ # p result
622
+ #
623
+ def test_iam_permissions request, options = nil
624
+ raise ::ArgumentError, "request must be provided" if request.nil?
625
+
626
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::TestIamPermissionsRegionInstanceGroupRequest
627
+
628
+ # Converts hash and nil to an options object
629
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
630
+
631
+ # Customize the options with defaults
632
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
633
+
634
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
635
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
636
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
637
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
638
+ transports_version_send: [:rest]
639
+
640
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
641
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
642
+
643
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
644
+ metadata: call_metadata,
645
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
646
+
647
+ options.apply_defaults timeout: @config.timeout,
648
+ metadata: @config.metadata,
649
+ retry_policy: @config.retry_policy
650
+
651
+ @region_instance_groups_stub.test_iam_permissions request, options do |result, operation|
652
+ yield result, operation if block_given?
653
+ end
654
+ rescue ::Gapic::Rest::Error => e
655
+ raise ::Google::Cloud::Error.from_error(e)
656
+ end
657
+
572
658
  ##
573
659
  # Configuration class for the RegionInstanceGroups REST API.
574
660
  #
@@ -735,6 +821,11 @@ module Google
735
821
  # @return [::Gapic::Config::Method]
736
822
  #
737
823
  attr_reader :set_named_ports
824
+ ##
825
+ # RPC-specific configuration for `test_iam_permissions`
826
+ # @return [::Gapic::Config::Method]
827
+ #
828
+ attr_reader :test_iam_permissions
738
829
 
739
830
  # @private
740
831
  def initialize parent_rpcs = nil
@@ -746,6 +837,8 @@ module Google
746
837
  @list_instances = ::Gapic::Config::Method.new list_instances_config
747
838
  set_named_ports_config = parent_rpcs.set_named_ports if parent_rpcs.respond_to? :set_named_ports
748
839
  @set_named_ports = ::Gapic::Config::Method.new set_named_ports_config
840
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
841
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
749
842
 
750
843
  yield self if block_given?
751
844
  end
@@ -233,6 +233,46 @@ module Google
233
233
  end
234
234
  end
235
235
 
236
+ ##
237
+ # Baseline implementation for the test_iam_permissions REST call
238
+ #
239
+ # @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsRegionInstanceGroupRequest]
240
+ # A request object representing the call parameters. Required.
241
+ # @param options [::Gapic::CallOptions]
242
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
243
+ #
244
+ # @yield [result, operation] Access the result along with the TransportOperation object
245
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
246
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
247
+ #
248
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
249
+ # A result object deserialized from the server's reply
250
+ def test_iam_permissions request_pb, options = nil
251
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
252
+
253
+ verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb
254
+ query_string_params = if query_string_params.any?
255
+ query_string_params.to_h { |p| p.split "=", 2 }
256
+ else
257
+ {}
258
+ end
259
+
260
+ response = @client_stub.make_http_request(
261
+ verb,
262
+ uri: uri,
263
+ body: body || "",
264
+ params: query_string_params,
265
+ method_name: "test_iam_permissions",
266
+ options: options
267
+ )
268
+ operation = ::Gapic::Rest::TransportOperation.new response
269
+ result = ::Google::Cloud::Compute::V1::TestPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
270
+ catch :response do
271
+ yield result, operation if block_given?
272
+ result
273
+ end
274
+ end
275
+
236
276
  ##
237
277
  # @private
238
278
  #
@@ -325,6 +365,30 @@ module Google
325
365
  )
326
366
  transcoder.transcode request_pb
327
367
  end
368
+
369
+ ##
370
+ # @private
371
+ #
372
+ # GRPC transcoding helper method for the test_iam_permissions REST call
373
+ #
374
+ # @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsRegionInstanceGroupRequest]
375
+ # A request object representing the call parameters. Required.
376
+ # @return [Array(String, [String, nil], Hash{String => String})]
377
+ # Uri, Body, Query string parameters
378
+ def self.transcode_test_iam_permissions_request request_pb
379
+ transcoder = Gapic::Rest::GrpcTranscoder.new
380
+ .with_bindings(
381
+ uri_method: :post,
382
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions",
383
+ body: "test_permissions_request_resource",
384
+ matches: [
385
+ ["project", %r{^[^/]+/?$}, false],
386
+ ["region", %r{^[^/]+/?$}, false],
387
+ ["resource", %r{^[^/]+/?$}, false]
388
+ ]
389
+ )
390
+ transcoder.transcode request_pb
391
+ end
328
392
  end
329
393
  end
330
394
  end
@@ -420,7 +420,7 @@ module Google
420
420
  # @param options [::Gapic::CallOptions, ::Hash]
421
421
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
422
422
  #
423
- # @overload get(project: nil, region: nil, service_attachment: nil)
423
+ # @overload get(project: nil, region: nil, service_attachment: nil, show_nat_ips: nil)
424
424
  # Pass arguments to `get` via keyword arguments. Note that at
425
425
  # least one keyword argument is required. To specify no parameters, or to keep all
426
426
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -431,6 +431,8 @@ module Google
431
431
  # Name of the region of this request.
432
432
  # @param service_attachment [::String]
433
433
  # Name of the ServiceAttachment resource to return.
434
+ # @param show_nat_ips [::Boolean]
435
+ # Indicates whether NAT IPs should be included in the response.
434
436
  # @yield [result, operation] Access the result along with the TransportOperation object
435
437
  # @yieldparam result [::Google::Cloud::Compute::V1::ServiceAttachment]
436
438
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -92,6 +92,8 @@ module Google
92
92
 
93
93
  default_config.rpcs.set_security_policy.timeout = 600.0
94
94
 
95
+ default_config.rpcs.test_iam_permissions.timeout = 600.0
96
+
95
97
  default_config
96
98
  end
97
99
  yield @configure if block_given?
@@ -762,6 +764,90 @@ module Google
762
764
  raise ::Google::Cloud::Error.from_error(e)
763
765
  end
764
766
 
767
+ ##
768
+ # Returns permissions that a caller has on the specified resource.
769
+ #
770
+ # @overload test_iam_permissions(request, options = nil)
771
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
772
+ # {::Google::Cloud::Compute::V1::TestIamPermissionsTargetInstanceRequest} or an equivalent Hash.
773
+ #
774
+ # @param request [::Google::Cloud::Compute::V1::TestIamPermissionsTargetInstanceRequest, ::Hash]
775
+ # A request object representing the call parameters. Required. To specify no
776
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
777
+ # @param options [::Gapic::CallOptions, ::Hash]
778
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
779
+ #
780
+ # @overload test_iam_permissions(project: nil, resource: nil, test_permissions_request_resource: nil, zone: nil)
781
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
782
+ # least one keyword argument is required. To specify no parameters, or to keep all
783
+ # the default parameter values, pass an empty Hash as a request object (see above).
784
+ #
785
+ # @param project [::String]
786
+ # Project ID for this request.
787
+ # @param resource [::String]
788
+ # Name or id of the resource for this request.
789
+ # @param test_permissions_request_resource [::Google::Cloud::Compute::V1::TestPermissionsRequest, ::Hash]
790
+ # The body resource for this request
791
+ # @param zone [::String]
792
+ # The name of the zone for this request.
793
+ # @yield [result, operation] Access the result along with the TransportOperation object
794
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
795
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
796
+ #
797
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
798
+ #
799
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
800
+ #
801
+ # @example Basic example
802
+ # require "google/cloud/compute/v1"
803
+ #
804
+ # # Create a client object. The client can be reused for multiple calls.
805
+ # client = Google::Cloud::Compute::V1::TargetInstances::Rest::Client.new
806
+ #
807
+ # # Create a request. To set request fields, pass in keyword arguments.
808
+ # request = Google::Cloud::Compute::V1::TestIamPermissionsTargetInstanceRequest.new
809
+ #
810
+ # # Call the test_iam_permissions method.
811
+ # result = client.test_iam_permissions request
812
+ #
813
+ # # The returned object is of type Google::Cloud::Compute::V1::TestPermissionsResponse.
814
+ # p result
815
+ #
816
+ def test_iam_permissions request, options = nil
817
+ raise ::ArgumentError, "request must be provided" if request.nil?
818
+
819
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::TestIamPermissionsTargetInstanceRequest
820
+
821
+ # Converts hash and nil to an options object
822
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
823
+
824
+ # Customize the options with defaults
825
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
826
+
827
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
828
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
829
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
830
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
831
+ transports_version_send: [:rest]
832
+
833
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
834
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
835
+
836
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
837
+ metadata: call_metadata,
838
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
839
+
840
+ options.apply_defaults timeout: @config.timeout,
841
+ metadata: @config.metadata,
842
+ retry_policy: @config.retry_policy
843
+
844
+ @target_instances_stub.test_iam_permissions request, options do |result, operation|
845
+ yield result, operation if block_given?
846
+ end
847
+ rescue ::Gapic::Rest::Error => e
848
+ raise ::Google::Cloud::Error.from_error(e)
849
+ end
850
+
765
851
  ##
766
852
  # Configuration class for the TargetInstances REST API.
767
853
  #
@@ -938,6 +1024,11 @@ module Google
938
1024
  # @return [::Gapic::Config::Method]
939
1025
  #
940
1026
  attr_reader :set_security_policy
1027
+ ##
1028
+ # RPC-specific configuration for `test_iam_permissions`
1029
+ # @return [::Gapic::Config::Method]
1030
+ #
1031
+ attr_reader :test_iam_permissions
941
1032
 
942
1033
  # @private
943
1034
  def initialize parent_rpcs = nil
@@ -953,6 +1044,8 @@ module Google
953
1044
  @list = ::Gapic::Config::Method.new list_config
954
1045
  set_security_policy_config = parent_rpcs.set_security_policy if parent_rpcs.respond_to? :set_security_policy
955
1046
  @set_security_policy = ::Gapic::Config::Method.new set_security_policy_config
1047
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1048
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
956
1049
 
957
1050
  yield self if block_given?
958
1051
  end
@@ -313,6 +313,46 @@ module Google
313
313
  end
314
314
  end
315
315
 
316
+ ##
317
+ # Baseline implementation for the test_iam_permissions REST call
318
+ #
319
+ # @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsTargetInstanceRequest]
320
+ # A request object representing the call parameters. Required.
321
+ # @param options [::Gapic::CallOptions]
322
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
323
+ #
324
+ # @yield [result, operation] Access the result along with the TransportOperation object
325
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
326
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
327
+ #
328
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
329
+ # A result object deserialized from the server's reply
330
+ def test_iam_permissions request_pb, options = nil
331
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
332
+
333
+ verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb
334
+ query_string_params = if query_string_params.any?
335
+ query_string_params.to_h { |p| p.split "=", 2 }
336
+ else
337
+ {}
338
+ end
339
+
340
+ response = @client_stub.make_http_request(
341
+ verb,
342
+ uri: uri,
343
+ body: body || "",
344
+ params: query_string_params,
345
+ method_name: "test_iam_permissions",
346
+ options: options
347
+ )
348
+ operation = ::Gapic::Rest::TransportOperation.new response
349
+ result = ::Google::Cloud::Compute::V1::TestPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
350
+ catch :response do
351
+ yield result, operation if block_given?
352
+ result
353
+ end
354
+ end
355
+
316
356
  ##
317
357
  # @private
318
358
  #
@@ -448,6 +488,30 @@ module Google
448
488
  )
449
489
  transcoder.transcode request_pb
450
490
  end
491
+
492
+ ##
493
+ # @private
494
+ #
495
+ # GRPC transcoding helper method for the test_iam_permissions REST call
496
+ #
497
+ # @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsTargetInstanceRequest]
498
+ # A request object representing the call parameters. Required.
499
+ # @return [Array(String, [String, nil], Hash{String => String})]
500
+ # Uri, Body, Query string parameters
501
+ def self.transcode_test_iam_permissions_request request_pb
502
+ transcoder = Gapic::Rest::GrpcTranscoder.new
503
+ .with_bindings(
504
+ uri_method: :post,
505
+ uri_template: "/compute/v1/projects/{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions",
506
+ body: "test_permissions_request_resource",
507
+ matches: [
508
+ ["project", %r{^[^/]+/?$}, false],
509
+ ["zone", %r{^[^/]+/?$}, false],
510
+ ["resource", %r{^[^/]+/?$}, false]
511
+ ]
512
+ )
513
+ transcoder.transcode request_pb
514
+ end
451
515
  end
452
516
  end
453
517
  end