google-cloud-compute-v1 2.3.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +48 -0
  3. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +112 -0
  4. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +112 -0
  5. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +144 -0
  6. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +224 -0
  7. data/lib/google/cloud/compute/v1/compute_pb.rb +3 -1
  8. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +48 -0
  9. data/lib/google/cloud/compute/v1/disks/rest/client.rb +288 -0
  10. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +96 -0
  11. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +288 -0
  12. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +96 -0
  13. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +128 -0
  14. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +96 -0
  15. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +112 -0
  16. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +112 -0
  17. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +80 -0
  18. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +48 -0
  19. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +80 -0
  20. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +112 -0
  21. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +16 -0
  22. data/lib/google/cloud/compute/v1/images/rest/client.rb +176 -0
  23. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +320 -0
  24. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +144 -0
  25. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +128 -0
  26. data/lib/google/cloud/compute/v1/instances/rest/client.rb +736 -0
  27. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +112 -0
  28. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +32 -0
  29. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +32 -0
  30. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +112 -0
  31. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +32 -0
  32. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +112 -0
  33. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +112 -0
  34. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +48 -0
  35. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +128 -0
  36. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +80 -0
  37. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +144 -0
  38. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +256 -0
  39. data/lib/google/cloud/compute/v1/networks/rest/client.rb +176 -0
  40. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +224 -0
  41. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +128 -0
  42. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +48 -0
  43. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +112 -0
  44. data/lib/google/cloud/compute/v1/projects/rest/client.rb +208 -0
  45. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +80 -0
  46. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +96 -0
  47. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +96 -0
  48. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +144 -0
  49. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +80 -0
  50. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +32 -0
  51. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +272 -0
  52. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +80 -0
  53. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +96 -0
  54. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +304 -0
  55. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +64 -0
  56. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +64 -0
  57. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +16 -0
  58. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +64 -0
  59. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +272 -0
  60. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +64 -0
  61. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +64 -0
  62. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +81 -1
  63. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +64 -0
  64. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +96 -0
  65. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +80 -0
  66. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +112 -0
  67. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +64 -0
  68. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +112 -0
  69. data/lib/google/cloud/compute/v1/regions/rest/client.rb +32 -0
  70. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +160 -0
  71. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +234 -0
  72. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +62 -0
  73. data/lib/google/cloud/compute/v1/routers/rest/client.rb +160 -0
  74. data/lib/google/cloud/compute/v1/routes/rest/client.rb +64 -0
  75. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +194 -2
  76. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +144 -0
  77. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +128 -0
  78. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +80 -0
  79. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +112 -0
  80. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +192 -0
  81. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +80 -0
  82. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +112 -0
  83. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +176 -0
  84. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +80 -0
  85. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +176 -0
  86. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +144 -0
  87. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +112 -0
  88. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +96 -0
  89. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +144 -0
  90. data/lib/google/cloud/compute/v1/version.rb +1 -1
  91. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +128 -0
  92. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +96 -0
  93. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +64 -0
  94. data/lib/google/cloud/compute/v1/zones/rest/client.rb +32 -0
  95. data/proto_docs/google/api/field_behavior.rb +14 -0
  96. data/proto_docs/google/cloud/compute/v1/compute.rb +56 -4
  97. metadata +5 -5
@@ -89,6 +89,8 @@ module Google
89
89
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
90
90
  }
91
91
 
92
+ default_config.rpcs.patch.timeout = 600.0
93
+
92
94
  default_config.rpcs.set_iam_policy.timeout = 600.0
93
95
 
94
96
  default_config.rpcs.test_iam_permissions.timeout = 600.0
@@ -214,6 +216,22 @@ module Google
214
216
  # @return [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::ResourcePoliciesScopedList>]
215
217
  #
216
218
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
219
+ #
220
+ # @example Basic example
221
+ # require "google/cloud/compute/v1"
222
+ #
223
+ # # Create a client object. The client can be reused for multiple calls.
224
+ # client = Google::Cloud::Compute::V1::ResourcePolicies::Rest::Client.new
225
+ #
226
+ # # Create a request. To set request fields, pass in keyword arguments.
227
+ # request = Google::Cloud::Compute::V1::AggregatedListResourcePoliciesRequest.new
228
+ #
229
+ # # Call the aggregated_list method.
230
+ # result = client.aggregated_list request
231
+ #
232
+ # # The returned object is of type Google::Cloud::Compute::V1::ResourcePolicyAggregatedList.
233
+ # p result
234
+ #
217
235
  def aggregated_list request, options = nil
218
236
  raise ::ArgumentError, "request must be provided" if request.nil?
219
237
 
@@ -283,6 +301,22 @@ module Google
283
301
  # @return [::Gapic::GenericLRO::Operation]
284
302
  #
285
303
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
304
+ #
305
+ # @example Basic example
306
+ # require "google/cloud/compute/v1"
307
+ #
308
+ # # Create a client object. The client can be reused for multiple calls.
309
+ # client = Google::Cloud::Compute::V1::ResourcePolicies::Rest::Client.new
310
+ #
311
+ # # Create a request. To set request fields, pass in keyword arguments.
312
+ # request = Google::Cloud::Compute::V1::DeleteResourcePolicyRequest.new
313
+ #
314
+ # # Call the delete method.
315
+ # result = client.delete request
316
+ #
317
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
318
+ # p result
319
+ #
286
320
  def delete request, options = nil
287
321
  raise ::ArgumentError, "request must be provided" if request.nil?
288
322
 
@@ -358,6 +392,22 @@ module Google
358
392
  # @return [::Google::Cloud::Compute::V1::ResourcePolicy]
359
393
  #
360
394
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
395
+ #
396
+ # @example Basic example
397
+ # require "google/cloud/compute/v1"
398
+ #
399
+ # # Create a client object. The client can be reused for multiple calls.
400
+ # client = Google::Cloud::Compute::V1::ResourcePolicies::Rest::Client.new
401
+ #
402
+ # # Create a request. To set request fields, pass in keyword arguments.
403
+ # request = Google::Cloud::Compute::V1::GetResourcePolicyRequest.new
404
+ #
405
+ # # Call the get method.
406
+ # result = client.get request
407
+ #
408
+ # # The returned object is of type Google::Cloud::Compute::V1::ResourcePolicy.
409
+ # p result
410
+ #
361
411
  def get request, options = nil
362
412
  raise ::ArgumentError, "request must be provided" if request.nil?
363
413
 
@@ -426,6 +476,22 @@ module Google
426
476
  # @return [::Google::Cloud::Compute::V1::Policy]
427
477
  #
428
478
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
479
+ #
480
+ # @example Basic example
481
+ # require "google/cloud/compute/v1"
482
+ #
483
+ # # Create a client object. The client can be reused for multiple calls.
484
+ # client = Google::Cloud::Compute::V1::ResourcePolicies::Rest::Client.new
485
+ #
486
+ # # Create a request. To set request fields, pass in keyword arguments.
487
+ # request = Google::Cloud::Compute::V1::GetIamPolicyResourcePolicyRequest.new
488
+ #
489
+ # # Call the get_iam_policy method.
490
+ # result = client.get_iam_policy request
491
+ #
492
+ # # The returned object is of type Google::Cloud::Compute::V1::Policy.
493
+ # p result
494
+ #
429
495
  def get_iam_policy request, options = nil
430
496
  raise ::ArgumentError, "request must be provided" if request.nil?
431
497
 
@@ -494,6 +560,22 @@ module Google
494
560
  # @return [::Gapic::GenericLRO::Operation]
495
561
  #
496
562
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
563
+ #
564
+ # @example Basic example
565
+ # require "google/cloud/compute/v1"
566
+ #
567
+ # # Create a client object. The client can be reused for multiple calls.
568
+ # client = Google::Cloud::Compute::V1::ResourcePolicies::Rest::Client.new
569
+ #
570
+ # # Create a request. To set request fields, pass in keyword arguments.
571
+ # request = Google::Cloud::Compute::V1::InsertResourcePolicyRequest.new
572
+ #
573
+ # # Call the insert method.
574
+ # result = client.insert request
575
+ #
576
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
577
+ # p result
578
+ #
497
579
  def insert request, options = nil
498
580
  raise ::ArgumentError, "request must be provided" if request.nil?
499
581
 
@@ -577,6 +659,22 @@ module Google
577
659
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ResourcePolicy>]
578
660
  #
579
661
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
662
+ #
663
+ # @example Basic example
664
+ # require "google/cloud/compute/v1"
665
+ #
666
+ # # Create a client object. The client can be reused for multiple calls.
667
+ # client = Google::Cloud::Compute::V1::ResourcePolicies::Rest::Client.new
668
+ #
669
+ # # Create a request. To set request fields, pass in keyword arguments.
670
+ # request = Google::Cloud::Compute::V1::ListResourcePoliciesRequest.new
671
+ #
672
+ # # Call the list method.
673
+ # result = client.list request
674
+ #
675
+ # # The returned object is of type Google::Cloud::Compute::V1::ResourcePolicyList.
676
+ # p result
677
+ #
580
678
  def list request, options = nil
581
679
  raise ::ArgumentError, "request must be provided" if request.nil?
582
680
 
@@ -613,6 +711,103 @@ module Google
613
711
  raise ::Google::Cloud::Error.from_error(e)
614
712
  end
615
713
 
714
+ ##
715
+ # Modify the specified resource policy.
716
+ #
717
+ # @overload patch(request, options = nil)
718
+ # Pass arguments to `patch` via a request object, either of type
719
+ # {::Google::Cloud::Compute::V1::PatchResourcePolicyRequest} or an equivalent Hash.
720
+ #
721
+ # @param request [::Google::Cloud::Compute::V1::PatchResourcePolicyRequest, ::Hash]
722
+ # A request object representing the call parameters. Required. To specify no
723
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
724
+ # @param options [::Gapic::CallOptions, ::Hash]
725
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
726
+ #
727
+ # @overload patch(project: nil, region: nil, request_id: nil, resource_policy: nil, resource_policy_resource: nil, update_mask: nil)
728
+ # Pass arguments to `patch` via keyword arguments. Note that at
729
+ # least one keyword argument is required. To specify no parameters, or to keep all
730
+ # the default parameter values, pass an empty Hash as a request object (see above).
731
+ #
732
+ # @param project [::String]
733
+ # Project ID for this request.
734
+ # @param region [::String]
735
+ # Name of the region for this request.
736
+ # @param request_id [::String]
737
+ # 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).
738
+ # @param resource_policy [::String]
739
+ # Id of the resource policy to patch.
740
+ # @param resource_policy_resource [::Google::Cloud::Compute::V1::ResourcePolicy, ::Hash]
741
+ # The body resource for this request
742
+ # @param update_mask [::String]
743
+ # update_mask indicates fields to be updated as part of this request.
744
+ # @yield [result, operation] Access the result along with the TransportOperation object
745
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
746
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
747
+ #
748
+ # @return [::Gapic::GenericLRO::Operation]
749
+ #
750
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
751
+ #
752
+ # @example Basic example
753
+ # require "google/cloud/compute/v1"
754
+ #
755
+ # # Create a client object. The client can be reused for multiple calls.
756
+ # client = Google::Cloud::Compute::V1::ResourcePolicies::Rest::Client.new
757
+ #
758
+ # # Create a request. To set request fields, pass in keyword arguments.
759
+ # request = Google::Cloud::Compute::V1::PatchResourcePolicyRequest.new
760
+ #
761
+ # # Call the patch method.
762
+ # result = client.patch request
763
+ #
764
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
765
+ # p result
766
+ #
767
+ def patch request, options = nil
768
+ raise ::ArgumentError, "request must be provided" if request.nil?
769
+
770
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchResourcePolicyRequest
771
+
772
+ # Converts hash and nil to an options object
773
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
774
+
775
+ # Customize the options with defaults
776
+ call_metadata = @config.rpcs.patch.metadata.to_h
777
+
778
+ # Set x-goog-api-client and x-goog-user-project headers
779
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
780
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
781
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
782
+ transports_version_send: [:rest]
783
+
784
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
785
+
786
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
787
+ metadata: call_metadata,
788
+ retry_policy: @config.rpcs.patch.retry_policy
789
+
790
+ options.apply_defaults timeout: @config.timeout,
791
+ metadata: @config.metadata,
792
+ retry_policy: @config.retry_policy
793
+
794
+ @resource_policies_stub.patch request, options do |result, response|
795
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
796
+ operation: result,
797
+ client: region_operations,
798
+ request_values: {
799
+ "project" => request.project,
800
+ "region" => request.region
801
+ },
802
+ options: options
803
+ )
804
+ yield result, response if block_given?
805
+ return result
806
+ end
807
+ rescue ::Gapic::Rest::Error => e
808
+ raise ::Google::Cloud::Error.from_error(e)
809
+ end
810
+
616
811
  ##
617
812
  # Sets the access control policy on the specified resource. Replaces any existing policy.
618
813
  #
@@ -646,6 +841,22 @@ module Google
646
841
  # @return [::Google::Cloud::Compute::V1::Policy]
647
842
  #
648
843
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
844
+ #
845
+ # @example Basic example
846
+ # require "google/cloud/compute/v1"
847
+ #
848
+ # # Create a client object. The client can be reused for multiple calls.
849
+ # client = Google::Cloud::Compute::V1::ResourcePolicies::Rest::Client.new
850
+ #
851
+ # # Create a request. To set request fields, pass in keyword arguments.
852
+ # request = Google::Cloud::Compute::V1::SetIamPolicyResourcePolicyRequest.new
853
+ #
854
+ # # Call the set_iam_policy method.
855
+ # result = client.set_iam_policy request
856
+ #
857
+ # # The returned object is of type Google::Cloud::Compute::V1::Policy.
858
+ # p result
859
+ #
649
860
  def set_iam_policy request, options = nil
650
861
  raise ::ArgumentError, "request must be provided" if request.nil?
651
862
 
@@ -714,6 +925,22 @@ module Google
714
925
  # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
715
926
  #
716
927
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
928
+ #
929
+ # @example Basic example
930
+ # require "google/cloud/compute/v1"
931
+ #
932
+ # # Create a client object. The client can be reused for multiple calls.
933
+ # client = Google::Cloud::Compute::V1::ResourcePolicies::Rest::Client.new
934
+ #
935
+ # # Create a request. To set request fields, pass in keyword arguments.
936
+ # request = Google::Cloud::Compute::V1::TestIamPermissionsResourcePolicyRequest.new
937
+ #
938
+ # # Call the test_iam_permissions method.
939
+ # result = client.test_iam_permissions request
940
+ #
941
+ # # The returned object is of type Google::Cloud::Compute::V1::TestPermissionsResponse.
942
+ # p result
943
+ #
717
944
  def test_iam_permissions request, options = nil
718
945
  raise ::ArgumentError, "request must be provided" if request.nil?
719
946
 
@@ -905,6 +1132,11 @@ module Google
905
1132
  #
906
1133
  attr_reader :list
907
1134
  ##
1135
+ # RPC-specific configuration for `patch`
1136
+ # @return [::Gapic::Config::Method]
1137
+ #
1138
+ attr_reader :patch
1139
+ ##
908
1140
  # RPC-specific configuration for `set_iam_policy`
909
1141
  # @return [::Gapic::Config::Method]
910
1142
  #
@@ -929,6 +1161,8 @@ module Google
929
1161
  @insert = ::Gapic::Config::Method.new insert_config
930
1162
  list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
931
1163
  @list = ::Gapic::Config::Method.new list_config
1164
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
1165
+ @patch = ::Gapic::Config::Method.new patch_config
932
1166
  set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
933
1167
  @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
934
1168
  test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
@@ -268,6 +268,44 @@ module Google
268
268
  result
269
269
  end
270
270
 
271
+ ##
272
+ # Baseline implementation for the patch REST call
273
+ #
274
+ # @param request_pb [::Google::Cloud::Compute::V1::PatchResourcePolicyRequest]
275
+ # A request object representing the call parameters. Required.
276
+ # @param options [::Gapic::CallOptions]
277
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
278
+ #
279
+ # @yield [result, operation] Access the result along with the TransportOperation object
280
+ # @yieldparam result [::Google::Cloud::Compute::V1::Operation]
281
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
282
+ #
283
+ # @return [::Google::Cloud::Compute::V1::Operation]
284
+ # A result object deserialized from the server's reply
285
+ def patch request_pb, options = nil
286
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
287
+
288
+ verb, uri, query_string_params, body = ServiceStub.transcode_patch_request request_pb
289
+ query_string_params = if query_string_params.any?
290
+ query_string_params.to_h { |p| p.split "=", 2 }
291
+ else
292
+ {}
293
+ end
294
+
295
+ response = @client_stub.make_http_request(
296
+ verb,
297
+ uri: uri,
298
+ body: body || "",
299
+ params: query_string_params,
300
+ options: options
301
+ )
302
+ operation = ::Gapic::Rest::TransportOperation.new response
303
+ result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true
304
+
305
+ yield result, operation if block_given?
306
+ result
307
+ end
308
+
271
309
  ##
272
310
  # Baseline implementation for the set_iam_policy REST call
273
311
  #
@@ -479,6 +517,30 @@ module Google
479
517
  transcoder.transcode request_pb
480
518
  end
481
519
 
520
+ ##
521
+ # @private
522
+ #
523
+ # GRPC transcoding helper method for the patch REST call
524
+ #
525
+ # @param request_pb [::Google::Cloud::Compute::V1::PatchResourcePolicyRequest]
526
+ # A request object representing the call parameters. Required.
527
+ # @return [Array(String, [String, nil], Hash{String => String})]
528
+ # Uri, Body, Query string parameters
529
+ def self.transcode_patch_request request_pb
530
+ transcoder = Gapic::Rest::GrpcTranscoder.new
531
+ .with_bindings(
532
+ uri_method: :patch,
533
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/resourcePolicies/{resource_policy}",
534
+ body: "resource_policy_resource",
535
+ matches: [
536
+ ["project", %r{^[^/]+/?$}, false],
537
+ ["region", %r{^[^/]+/?$}, false],
538
+ ["resource_policy", %r{^[^/]+/?$}, false]
539
+ ]
540
+ )
541
+ transcoder.transcode request_pb
542
+ end
543
+
482
544
  ##
483
545
  # @private
484
546
  #
@@ -221,6 +221,22 @@ module Google
221
221
  # @return [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::RoutersScopedList>]
222
222
  #
223
223
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
224
+ #
225
+ # @example Basic example
226
+ # require "google/cloud/compute/v1"
227
+ #
228
+ # # Create a client object. The client can be reused for multiple calls.
229
+ # client = Google::Cloud::Compute::V1::Routers::Rest::Client.new
230
+ #
231
+ # # Create a request. To set request fields, pass in keyword arguments.
232
+ # request = Google::Cloud::Compute::V1::AggregatedListRoutersRequest.new
233
+ #
234
+ # # Call the aggregated_list method.
235
+ # result = client.aggregated_list request
236
+ #
237
+ # # The returned object is of type Google::Cloud::Compute::V1::RouterAggregatedList.
238
+ # p result
239
+ #
224
240
  def aggregated_list request, options = nil
225
241
  raise ::ArgumentError, "request must be provided" if request.nil?
226
242
 
@@ -290,6 +306,22 @@ module Google
290
306
  # @return [::Gapic::GenericLRO::Operation]
291
307
  #
292
308
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
309
+ #
310
+ # @example Basic example
311
+ # require "google/cloud/compute/v1"
312
+ #
313
+ # # Create a client object. The client can be reused for multiple calls.
314
+ # client = Google::Cloud::Compute::V1::Routers::Rest::Client.new
315
+ #
316
+ # # Create a request. To set request fields, pass in keyword arguments.
317
+ # request = Google::Cloud::Compute::V1::DeleteRouterRequest.new
318
+ #
319
+ # # Call the delete method.
320
+ # result = client.delete request
321
+ #
322
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
323
+ # p result
324
+ #
293
325
  def delete request, options = nil
294
326
  raise ::ArgumentError, "request must be provided" if request.nil?
295
327
 
@@ -365,6 +397,22 @@ module Google
365
397
  # @return [::Google::Cloud::Compute::V1::Router]
366
398
  #
367
399
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
400
+ #
401
+ # @example Basic example
402
+ # require "google/cloud/compute/v1"
403
+ #
404
+ # # Create a client object. The client can be reused for multiple calls.
405
+ # client = Google::Cloud::Compute::V1::Routers::Rest::Client.new
406
+ #
407
+ # # Create a request. To set request fields, pass in keyword arguments.
408
+ # request = Google::Cloud::Compute::V1::GetRouterRequest.new
409
+ #
410
+ # # Call the get method.
411
+ # result = client.get request
412
+ #
413
+ # # The returned object is of type Google::Cloud::Compute::V1::Router.
414
+ # p result
415
+ #
368
416
  def get request, options = nil
369
417
  raise ::ArgumentError, "request must be provided" if request.nil?
370
418
 
@@ -443,6 +491,22 @@ module Google
443
491
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::VmEndpointNatMappings>]
444
492
  #
445
493
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
494
+ #
495
+ # @example Basic example
496
+ # require "google/cloud/compute/v1"
497
+ #
498
+ # # Create a client object. The client can be reused for multiple calls.
499
+ # client = Google::Cloud::Compute::V1::Routers::Rest::Client.new
500
+ #
501
+ # # Create a request. To set request fields, pass in keyword arguments.
502
+ # request = Google::Cloud::Compute::V1::GetNatMappingInfoRoutersRequest.new
503
+ #
504
+ # # Call the get_nat_mapping_info method.
505
+ # result = client.get_nat_mapping_info request
506
+ #
507
+ # # The returned object is of type Google::Cloud::Compute::V1::VmEndpointNatMappingsList.
508
+ # p result
509
+ #
446
510
  def get_nat_mapping_info request, options = nil
447
511
  raise ::ArgumentError, "request must be provided" if request.nil?
448
512
 
@@ -510,6 +574,22 @@ module Google
510
574
  # @return [::Google::Cloud::Compute::V1::RouterStatusResponse]
511
575
  #
512
576
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
577
+ #
578
+ # @example Basic example
579
+ # require "google/cloud/compute/v1"
580
+ #
581
+ # # Create a client object. The client can be reused for multiple calls.
582
+ # client = Google::Cloud::Compute::V1::Routers::Rest::Client.new
583
+ #
584
+ # # Create a request. To set request fields, pass in keyword arguments.
585
+ # request = Google::Cloud::Compute::V1::GetRouterStatusRouterRequest.new
586
+ #
587
+ # # Call the get_router_status method.
588
+ # result = client.get_router_status request
589
+ #
590
+ # # The returned object is of type Google::Cloud::Compute::V1::RouterStatusResponse.
591
+ # p result
592
+ #
513
593
  def get_router_status request, options = nil
514
594
  raise ::ArgumentError, "request must be provided" if request.nil?
515
595
 
@@ -578,6 +658,22 @@ module Google
578
658
  # @return [::Gapic::GenericLRO::Operation]
579
659
  #
580
660
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
661
+ #
662
+ # @example Basic example
663
+ # require "google/cloud/compute/v1"
664
+ #
665
+ # # Create a client object. The client can be reused for multiple calls.
666
+ # client = Google::Cloud::Compute::V1::Routers::Rest::Client.new
667
+ #
668
+ # # Create a request. To set request fields, pass in keyword arguments.
669
+ # request = Google::Cloud::Compute::V1::InsertRouterRequest.new
670
+ #
671
+ # # Call the insert method.
672
+ # result = client.insert request
673
+ #
674
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
675
+ # p result
676
+ #
581
677
  def insert request, options = nil
582
678
  raise ::ArgumentError, "request must be provided" if request.nil?
583
679
 
@@ -661,6 +757,22 @@ module Google
661
757
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::Router>]
662
758
  #
663
759
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
760
+ #
761
+ # @example Basic example
762
+ # require "google/cloud/compute/v1"
763
+ #
764
+ # # Create a client object. The client can be reused for multiple calls.
765
+ # client = Google::Cloud::Compute::V1::Routers::Rest::Client.new
766
+ #
767
+ # # Create a request. To set request fields, pass in keyword arguments.
768
+ # request = Google::Cloud::Compute::V1::ListRoutersRequest.new
769
+ #
770
+ # # Call the list method.
771
+ # result = client.list request
772
+ #
773
+ # # The returned object is of type Google::Cloud::Compute::V1::RouterList.
774
+ # p result
775
+ #
664
776
  def list request, options = nil
665
777
  raise ::ArgumentError, "request must be provided" if request.nil?
666
778
 
@@ -732,6 +844,22 @@ module Google
732
844
  # @return [::Gapic::GenericLRO::Operation]
733
845
  #
734
846
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
847
+ #
848
+ # @example Basic example
849
+ # require "google/cloud/compute/v1"
850
+ #
851
+ # # Create a client object. The client can be reused for multiple calls.
852
+ # client = Google::Cloud::Compute::V1::Routers::Rest::Client.new
853
+ #
854
+ # # Create a request. To set request fields, pass in keyword arguments.
855
+ # request = Google::Cloud::Compute::V1::PatchRouterRequest.new
856
+ #
857
+ # # Call the patch method.
858
+ # result = client.patch request
859
+ #
860
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
861
+ # p result
862
+ #
735
863
  def patch request, options = nil
736
864
  raise ::ArgumentError, "request must be provided" if request.nil?
737
865
 
@@ -809,6 +937,22 @@ module Google
809
937
  # @return [::Google::Cloud::Compute::V1::RoutersPreviewResponse]
810
938
  #
811
939
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
940
+ #
941
+ # @example Basic example
942
+ # require "google/cloud/compute/v1"
943
+ #
944
+ # # Create a client object. The client can be reused for multiple calls.
945
+ # client = Google::Cloud::Compute::V1::Routers::Rest::Client.new
946
+ #
947
+ # # Create a request. To set request fields, pass in keyword arguments.
948
+ # request = Google::Cloud::Compute::V1::PreviewRouterRequest.new
949
+ #
950
+ # # Call the preview method.
951
+ # result = client.preview request
952
+ #
953
+ # # The returned object is of type Google::Cloud::Compute::V1::RoutersPreviewResponse.
954
+ # p result
955
+ #
812
956
  def preview request, options = nil
813
957
  raise ::ArgumentError, "request must be provided" if request.nil?
814
958
 
@@ -879,6 +1023,22 @@ module Google
879
1023
  # @return [::Gapic::GenericLRO::Operation]
880
1024
  #
881
1025
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1026
+ #
1027
+ # @example Basic example
1028
+ # require "google/cloud/compute/v1"
1029
+ #
1030
+ # # Create a client object. The client can be reused for multiple calls.
1031
+ # client = Google::Cloud::Compute::V1::Routers::Rest::Client.new
1032
+ #
1033
+ # # Create a request. To set request fields, pass in keyword arguments.
1034
+ # request = Google::Cloud::Compute::V1::UpdateRouterRequest.new
1035
+ #
1036
+ # # Call the update method.
1037
+ # result = client.update request
1038
+ #
1039
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
1040
+ # p result
1041
+ #
882
1042
  def update request, options = nil
883
1043
  raise ::ArgumentError, "request must be provided" if request.nil?
884
1044