google-cloud-compute-v1 1.5.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +8 -8
  4. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +87 -0
  5. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +74 -13
  6. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +17 -17
  7. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +18 -18
  8. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +151 -0
  9. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +142 -23
  10. data/lib/google/cloud/compute/v1/compute_pb.rb +357 -0
  11. data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +8 -8
  12. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +37 -37
  13. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +12 -12
  14. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +17 -17
  15. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +12 -12
  16. data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +22 -22
  17. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +82 -0
  18. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +68 -8
  19. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +14 -14
  20. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +14 -14
  21. data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +10 -10
  22. data/lib/google/cloud/compute/v1/global_operations/rest.rb +1 -0
  23. data/lib/google/cloud/compute/v1/global_operations.rb +0 -1
  24. data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +4 -4
  25. data/lib/google/cloud/compute/v1/global_organization_operations/rest.rb +1 -0
  26. data/lib/google/cloud/compute/v1/global_organization_operations.rb +0 -1
  27. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +10 -10
  28. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +13 -13
  29. data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +5 -5
  30. data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +22 -22
  31. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +1 -1
  32. data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +58 -58
  33. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +25 -25
  34. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +14 -14
  35. data/lib/google/cloud/compute/v1/instances/rest/client.rb +1 -1
  36. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +132 -132
  37. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +87 -0
  38. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +77 -16
  39. data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +5 -5
  40. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +82 -0
  41. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +72 -12
  42. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +6 -6
  43. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +14 -14
  44. data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +14 -14
  45. data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +8 -8
  46. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +14 -14
  47. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +25 -25
  48. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +32 -32
  49. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +22 -22
  50. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +37 -37
  51. data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +22 -22
  52. data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +8 -8
  53. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +19 -19
  54. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +15 -15
  55. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +10 -10
  56. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +16 -16
  57. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +16 -16
  58. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +155 -0
  59. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +142 -21
  60. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +13 -13
  61. data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +7 -7
  62. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +36 -36
  63. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +15 -15
  64. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +18 -18
  65. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +1 -1
  66. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +57 -57
  67. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +13 -13
  68. data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +4 -4
  69. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +12 -12
  70. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +50 -50
  71. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +12 -12
  72. data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +13 -13
  73. data/lib/google/cloud/compute/v1/region_operations/rest.rb +1 -0
  74. data/lib/google/cloud/compute/v1/region_operations.rb +0 -1
  75. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +15 -15
  76. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +12 -12
  77. data/lib/google/cloud/compute/v1/region_ssl_policies/credentials.rb +52 -0
  78. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +759 -0
  79. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +408 -0
  80. data/lib/google/cloud/compute/v1/region_ssl_policies/rest.rb +33 -0
  81. data/lib/google/cloud/compute/v1/region_ssl_policies.rb +47 -0
  82. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +15 -15
  83. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +21 -21
  84. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/credentials.rb +52 -0
  85. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +587 -0
  86. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +288 -0
  87. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest.rb +33 -0
  88. data/lib/google/cloud/compute/v1/region_target_tcp_proxies.rb +47 -0
  89. data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +21 -21
  90. data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +5 -5
  91. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +28 -28
  92. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +22 -22
  93. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +28 -28
  94. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +8 -8
  95. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +82 -0
  96. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +80 -20
  97. data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +25 -25
  98. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +16 -16
  99. data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +9 -9
  100. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +86 -0
  101. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +69 -11
  102. data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +32 -32
  103. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +10 -10
  104. data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +13 -13
  105. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +21 -21
  106. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +13 -13
  107. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +31 -31
  108. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +18 -18
  109. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +12 -12
  110. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +87 -0
  111. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +74 -13
  112. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +17 -17
  113. data/lib/google/cloud/compute/v1/version.rb +1 -1
  114. data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +22 -22
  115. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +87 -0
  116. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +74 -13
  117. data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +13 -13
  118. data/lib/google/cloud/compute/v1/zone_operations/rest.rb +1 -0
  119. data/lib/google/cloud/compute/v1/zone_operations.rb +0 -1
  120. data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +5 -5
  121. data/lib/google/cloud/compute/v1.rb +2 -0
  122. data/proto_docs/google/cloud/compute/v1/compute.rb +968 -39
  123. metadata +12 -2
@@ -83,6 +83,11 @@ module Google
83
83
 
84
84
  default_config.rpcs.get_health.timeout = 600.0
85
85
 
86
+ default_config.rpcs.get_iam_policy.timeout = 600.0
87
+ default_config.rpcs.get_iam_policy.retry_policy = {
88
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
89
+ }
90
+
86
91
  default_config.rpcs.insert.timeout = 600.0
87
92
 
88
93
  default_config.rpcs.list.timeout = 600.0
@@ -94,6 +99,8 @@ module Google
94
99
 
95
100
  default_config.rpcs.set_edge_security_policy.timeout = 600.0
96
101
 
102
+ default_config.rpcs.set_iam_policy.timeout = 600.0
103
+
97
104
  default_config.rpcs.set_security_policy.timeout = 600.0
98
105
 
99
106
  default_config.rpcs.update.timeout = 600.0
@@ -595,6 +602,71 @@ module Google
595
602
  raise ::Google::Cloud::Error.from_error(gapic_error)
596
603
  end
597
604
 
605
+ ##
606
+ # Gets the access control policy for a resource. May be empty if no such policy or resource exists.
607
+ #
608
+ # @overload get_iam_policy(request, options = nil)
609
+ # Pass arguments to `get_iam_policy` via a request object, either of type
610
+ # {::Google::Cloud::Compute::V1::GetIamPolicyBackendServiceRequest} or an equivalent Hash.
611
+ #
612
+ # @param request [::Google::Cloud::Compute::V1::GetIamPolicyBackendServiceRequest, ::Hash]
613
+ # A request object representing the call parameters. Required. To specify no
614
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
615
+ # @param options [::Gapic::CallOptions, ::Hash]
616
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
617
+ # Note: currently retry functionality is not implemented. While it is possible
618
+ # to set it using ::Gapic::CallOptions, it will not be applied
619
+ #
620
+ # @overload get_iam_policy(options_requested_policy_version: nil, project: nil, resource: nil)
621
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
622
+ # least one keyword argument is required. To specify no parameters, or to keep all
623
+ # the default parameter values, pass an empty Hash as a request object (see above).
624
+ #
625
+ # @param options_requested_policy_version [::Integer]
626
+ # Requested IAM Policy version.
627
+ # @param project [::String]
628
+ # Project ID for this request.
629
+ # @param resource [::String]
630
+ # Name or id of the resource for this request.
631
+ # @yield [result, response] Access the result along with the Faraday response object
632
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
633
+ # @yieldparam response [::Faraday::Response]
634
+ #
635
+ # @return [::Google::Cloud::Compute::V1::Policy]
636
+ #
637
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
638
+ def get_iam_policy request, options = nil
639
+ raise ::ArgumentError, "request must be provided" if request.nil?
640
+
641
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetIamPolicyBackendServiceRequest
642
+
643
+ # Converts hash and nil to an options object
644
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
645
+
646
+ # Customize the options with defaults
647
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
648
+
649
+ # Set x-goog-api-client header
650
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
651
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
652
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
653
+ transports_version_send: [:rest]
654
+
655
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
656
+ metadata: call_metadata
657
+
658
+ options.apply_defaults timeout: @config.timeout,
659
+ metadata: @config.metadata
660
+
661
+ @backend_services_stub.get_iam_policy request, options do |result, response|
662
+ yield result, response if block_given?
663
+ return result
664
+ end
665
+ rescue ::Faraday::Error => e
666
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
667
+ raise ::Google::Cloud::Error.from_error(gapic_error)
668
+ end
669
+
598
670
  ##
599
671
  # Creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview .
600
672
  #
@@ -890,6 +962,71 @@ module Google
890
962
  raise ::Google::Cloud::Error.from_error(gapic_error)
891
963
  end
892
964
 
965
+ ##
966
+ # Sets the access control policy on the specified resource. Replaces any existing policy.
967
+ #
968
+ # @overload set_iam_policy(request, options = nil)
969
+ # Pass arguments to `set_iam_policy` via a request object, either of type
970
+ # {::Google::Cloud::Compute::V1::SetIamPolicyBackendServiceRequest} or an equivalent Hash.
971
+ #
972
+ # @param request [::Google::Cloud::Compute::V1::SetIamPolicyBackendServiceRequest, ::Hash]
973
+ # A request object representing the call parameters. Required. To specify no
974
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
975
+ # @param options [::Gapic::CallOptions, ::Hash]
976
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
977
+ # Note: currently retry functionality is not implemented. While it is possible
978
+ # to set it using ::Gapic::CallOptions, it will not be applied
979
+ #
980
+ # @overload set_iam_policy(global_set_policy_request_resource: nil, project: nil, resource: nil)
981
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
982
+ # least one keyword argument is required. To specify no parameters, or to keep all
983
+ # the default parameter values, pass an empty Hash as a request object (see above).
984
+ #
985
+ # @param global_set_policy_request_resource [::Google::Cloud::Compute::V1::GlobalSetPolicyRequest, ::Hash]
986
+ # The body resource for this request
987
+ # @param project [::String]
988
+ # Project ID for this request.
989
+ # @param resource [::String]
990
+ # Name or id of the resource for this request.
991
+ # @yield [result, response] Access the result along with the Faraday response object
992
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
993
+ # @yieldparam response [::Faraday::Response]
994
+ #
995
+ # @return [::Google::Cloud::Compute::V1::Policy]
996
+ #
997
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
998
+ def set_iam_policy request, options = nil
999
+ raise ::ArgumentError, "request must be provided" if request.nil?
1000
+
1001
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::SetIamPolicyBackendServiceRequest
1002
+
1003
+ # Converts hash and nil to an options object
1004
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1005
+
1006
+ # Customize the options with defaults
1007
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
1008
+
1009
+ # Set x-goog-api-client header
1010
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1011
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1012
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1013
+ transports_version_send: [:rest]
1014
+
1015
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
1016
+ metadata: call_metadata
1017
+
1018
+ options.apply_defaults timeout: @config.timeout,
1019
+ metadata: @config.metadata
1020
+
1021
+ @backend_services_stub.set_iam_policy request, options do |result, response|
1022
+ yield result, response if block_given?
1023
+ return result
1024
+ end
1025
+ rescue ::Faraday::Error => e
1026
+ gapic_error = ::Gapic::Rest::Error.wrap_faraday_error e
1027
+ raise ::Google::Cloud::Error.from_error(gapic_error)
1028
+ end
1029
+
893
1030
  ##
894
1031
  # Sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview
895
1032
  #
@@ -1170,6 +1307,11 @@ module Google
1170
1307
  #
1171
1308
  attr_reader :get_health
1172
1309
  ##
1310
+ # RPC-specific configuration for `get_iam_policy`
1311
+ # @return [::Gapic::Config::Method]
1312
+ #
1313
+ attr_reader :get_iam_policy
1314
+ ##
1173
1315
  # RPC-specific configuration for `insert`
1174
1316
  # @return [::Gapic::Config::Method]
1175
1317
  #
@@ -1190,6 +1332,11 @@ module Google
1190
1332
  #
1191
1333
  attr_reader :set_edge_security_policy
1192
1334
  ##
1335
+ # RPC-specific configuration for `set_iam_policy`
1336
+ # @return [::Gapic::Config::Method]
1337
+ #
1338
+ attr_reader :set_iam_policy
1339
+ ##
1193
1340
  # RPC-specific configuration for `set_security_policy`
1194
1341
  # @return [::Gapic::Config::Method]
1195
1342
  #
@@ -1214,6 +1361,8 @@ module Google
1214
1361
  @get = ::Gapic::Config::Method.new get_config
1215
1362
  get_health_config = parent_rpcs.get_health if parent_rpcs.respond_to? :get_health
1216
1363
  @get_health = ::Gapic::Config::Method.new get_health_config
1364
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1365
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1217
1366
  insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
1218
1367
  @insert = ::Gapic::Config::Method.new insert_config
1219
1368
  list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
@@ -1222,6 +1371,8 @@ module Google
1222
1371
  @patch = ::Gapic::Config::Method.new patch_config
1223
1372
  set_edge_security_policy_config = parent_rpcs.set_edge_security_policy if parent_rpcs.respond_to? :set_edge_security_policy
1224
1373
  @set_edge_security_policy = ::Gapic::Config::Method.new set_edge_security_policy_config
1374
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1375
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1225
1376
  set_security_policy_config = parent_rpcs.set_security_policy if parent_rpcs.respond_to? :set_security_policy
1226
1377
  @set_security_policy = ::Gapic::Config::Method.new set_security_policy_config
1227
1378
  update_config = parent_rpcs.update if parent_rpcs.respond_to? :update
@@ -26,8 +26,8 @@ module Google
26
26
  module Rest
27
27
  ##
28
28
  # REST service stub for the BackendServices service.
29
- # service stub contains baseline method implementations
30
- # including transcoding, making the REST call and deserialing the response
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
33
  def initialize endpoint:, credentials:
@@ -260,6 +260,43 @@ module Google
260
260
  result
261
261
  end
262
262
 
263
+ ##
264
+ # Baseline implementation for the get_iam_policy REST call
265
+ #
266
+ # @param request_pb [::Google::Cloud::Compute::V1::GetIamPolicyBackendServiceRequest]
267
+ # A request object representing the call parameters. Required.
268
+ # @param options [::Gapic::CallOptions]
269
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
270
+ #
271
+ # @yield [result, response] Access the result along with the Faraday response object
272
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
273
+ # @yieldparam response [::Faraday::Response]
274
+ #
275
+ # @return [::Google::Cloud::Compute::V1::Policy]
276
+ # A result object deserialized from the server's reply
277
+ def get_iam_policy request_pb, options = nil
278
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
279
+
280
+ verb, uri, query_string_params, body = transcode_get_iam_policy_request request_pb
281
+ query_string_params = if query_string_params.any?
282
+ query_string_params.to_h { |p| p.split("=", 2) }
283
+ else
284
+ {}
285
+ end
286
+
287
+ response = @client_stub.make_http_request(
288
+ verb,
289
+ uri: uri,
290
+ body: body || "",
291
+ params: query_string_params,
292
+ options: options
293
+ )
294
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
295
+
296
+ yield result, response if block_given?
297
+ result
298
+ end
299
+
263
300
  ##
264
301
  # Baseline implementation for the insert REST call
265
302
  #
@@ -408,6 +445,43 @@ module Google
408
445
  result
409
446
  end
410
447
 
448
+ ##
449
+ # Baseline implementation for the set_iam_policy REST call
450
+ #
451
+ # @param request_pb [::Google::Cloud::Compute::V1::SetIamPolicyBackendServiceRequest]
452
+ # A request object representing the call parameters. Required.
453
+ # @param options [::Gapic::CallOptions]
454
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
455
+ #
456
+ # @yield [result, response] Access the result along with the Faraday response object
457
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
458
+ # @yieldparam response [::Faraday::Response]
459
+ #
460
+ # @return [::Google::Cloud::Compute::V1::Policy]
461
+ # A result object deserialized from the server's reply
462
+ def set_iam_policy request_pb, options = nil
463
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
464
+
465
+ verb, uri, query_string_params, body = transcode_set_iam_policy_request request_pb
466
+ query_string_params = if query_string_params.any?
467
+ query_string_params.to_h { |p| p.split("=", 2) }
468
+ else
469
+ {}
470
+ end
471
+
472
+ response = @client_stub.make_http_request(
473
+ verb,
474
+ uri: uri,
475
+ body: body || "",
476
+ params: query_string_params,
477
+ options: options
478
+ )
479
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
480
+
481
+ yield result, response if block_given?
482
+ result
483
+ end
484
+
411
485
  ##
412
486
  # Baseline implementation for the set_security_policy REST call
413
487
  #
@@ -501,8 +575,8 @@ module Google
501
575
  uri_template: "/compute/v1/projects/{project}/global/backendServices/{backend_service}/addSignedUrlKey",
502
576
  body: "signed_url_key_resource",
503
577
  matches: [
504
- ["project", %r{[^/]+}, false],
505
- ["backend_service", %r{[^/]+}, false]
578
+ ["project", %r{^[^/]+/?$}, false],
579
+ ["backend_service", %r{^[^/]+/?$}, false]
506
580
  ]
507
581
  )
508
582
  transcoder.transcode request_pb
@@ -523,7 +597,7 @@ module Google
523
597
  uri_method: :get,
524
598
  uri_template: "/compute/v1/projects/{project}/aggregated/backendServices",
525
599
  matches: [
526
- ["project", %r{[^/]+}, false]
600
+ ["project", %r{^[^/]+/?$}, false]
527
601
  ]
528
602
  )
529
603
  transcoder.transcode request_pb
@@ -544,8 +618,8 @@ module Google
544
618
  uri_method: :delete,
545
619
  uri_template: "/compute/v1/projects/{project}/global/backendServices/{backend_service}",
546
620
  matches: [
547
- ["project", %r{[^/]+}, false],
548
- ["backend_service", %r{[^/]+}, false]
621
+ ["project", %r{^[^/]+/?$}, false],
622
+ ["backend_service", %r{^[^/]+/?$}, false]
549
623
  ]
550
624
  )
551
625
  transcoder.transcode request_pb
@@ -566,8 +640,8 @@ module Google
566
640
  uri_method: :post,
567
641
  uri_template: "/compute/v1/projects/{project}/global/backendServices/{backend_service}/deleteSignedUrlKey",
568
642
  matches: [
569
- ["project", %r{[^/]+}, false],
570
- ["backend_service", %r{[^/]+}, false]
643
+ ["project", %r{^[^/]+/?$}, false],
644
+ ["backend_service", %r{^[^/]+/?$}, false]
571
645
  ]
572
646
  )
573
647
  transcoder.transcode request_pb
@@ -588,8 +662,8 @@ module Google
588
662
  uri_method: :get,
589
663
  uri_template: "/compute/v1/projects/{project}/global/backendServices/{backend_service}",
590
664
  matches: [
591
- ["project", %r{[^/]+}, false],
592
- ["backend_service", %r{[^/]+}, false]
665
+ ["project", %r{^[^/]+/?$}, false],
666
+ ["backend_service", %r{^[^/]+/?$}, false]
593
667
  ]
594
668
  )
595
669
  transcoder.transcode request_pb
@@ -611,8 +685,30 @@ module Google
611
685
  uri_template: "/compute/v1/projects/{project}/global/backendServices/{backend_service}/getHealth",
612
686
  body: "resource_group_reference_resource",
613
687
  matches: [
614
- ["project", %r{[^/]+}, false],
615
- ["backend_service", %r{[^/]+}, false]
688
+ ["project", %r{^[^/]+/?$}, false],
689
+ ["backend_service", %r{^[^/]+/?$}, false]
690
+ ]
691
+ )
692
+ transcoder.transcode request_pb
693
+ end
694
+
695
+ ##
696
+ # @private
697
+ #
698
+ # GRPC transcoding helper method for the get_iam_policy REST call
699
+ #
700
+ # @param request_pb [::Google::Cloud::Compute::V1::GetIamPolicyBackendServiceRequest]
701
+ # A request object representing the call parameters. Required.
702
+ # @return [Array(String, [String, nil], Hash{String => String})]
703
+ # Uri, Body, Query string parameters
704
+ def transcode_get_iam_policy_request request_pb
705
+ transcoder = Gapic::Rest::GrpcTranscoder.new
706
+ .with_bindings(
707
+ uri_method: :get,
708
+ uri_template: "/compute/v1/projects/{project}/global/backendServices/{resource}/getIamPolicy",
709
+ matches: [
710
+ ["project", %r{^[^/]+/?$}, false],
711
+ ["resource", %r{^[^/]+/?$}, false]
616
712
  ]
617
713
  )
618
714
  transcoder.transcode request_pb
@@ -634,7 +730,7 @@ module Google
634
730
  uri_template: "/compute/v1/projects/{project}/global/backendServices",
635
731
  body: "backend_service_resource",
636
732
  matches: [
637
- ["project", %r{[^/]+}, false]
733
+ ["project", %r{^[^/]+/?$}, false]
638
734
  ]
639
735
  )
640
736
  transcoder.transcode request_pb
@@ -655,7 +751,7 @@ module Google
655
751
  uri_method: :get,
656
752
  uri_template: "/compute/v1/projects/{project}/global/backendServices",
657
753
  matches: [
658
- ["project", %r{[^/]+}, false]
754
+ ["project", %r{^[^/]+/?$}, false]
659
755
  ]
660
756
  )
661
757
  transcoder.transcode request_pb
@@ -677,8 +773,8 @@ module Google
677
773
  uri_template: "/compute/v1/projects/{project}/global/backendServices/{backend_service}",
678
774
  body: "backend_service_resource",
679
775
  matches: [
680
- ["project", %r{[^/]+}, false],
681
- ["backend_service", %r{[^/]+}, false]
776
+ ["project", %r{^[^/]+/?$}, false],
777
+ ["backend_service", %r{^[^/]+/?$}, false]
682
778
  ]
683
779
  )
684
780
  transcoder.transcode request_pb
@@ -700,8 +796,31 @@ module Google
700
796
  uri_template: "/compute/v1/projects/{project}/global/backendServices/{backend_service}/setEdgeSecurityPolicy",
701
797
  body: "security_policy_reference_resource",
702
798
  matches: [
703
- ["project", %r{[^/]+}, false],
704
- ["backend_service", %r{[^/]+}, false]
799
+ ["project", %r{^[^/]+/?$}, false],
800
+ ["backend_service", %r{^[^/]+/?$}, false]
801
+ ]
802
+ )
803
+ transcoder.transcode request_pb
804
+ end
805
+
806
+ ##
807
+ # @private
808
+ #
809
+ # GRPC transcoding helper method for the set_iam_policy REST call
810
+ #
811
+ # @param request_pb [::Google::Cloud::Compute::V1::SetIamPolicyBackendServiceRequest]
812
+ # A request object representing the call parameters. Required.
813
+ # @return [Array(String, [String, nil], Hash{String => String})]
814
+ # Uri, Body, Query string parameters
815
+ def transcode_set_iam_policy_request request_pb
816
+ transcoder = Gapic::Rest::GrpcTranscoder.new
817
+ .with_bindings(
818
+ uri_method: :post,
819
+ uri_template: "/compute/v1/projects/{project}/global/backendServices/{resource}/setIamPolicy",
820
+ body: "global_set_policy_request_resource",
821
+ matches: [
822
+ ["project", %r{^[^/]+/?$}, false],
823
+ ["resource", %r{^[^/]+/?$}, false]
705
824
  ]
706
825
  )
707
826
  transcoder.transcode request_pb
@@ -723,8 +842,8 @@ module Google
723
842
  uri_template: "/compute/v1/projects/{project}/global/backendServices/{backend_service}/setSecurityPolicy",
724
843
  body: "security_policy_reference_resource",
725
844
  matches: [
726
- ["project", %r{[^/]+}, false],
727
- ["backend_service", %r{[^/]+}, false]
845
+ ["project", %r{^[^/]+/?$}, false],
846
+ ["backend_service", %r{^[^/]+/?$}, false]
728
847
  ]
729
848
  )
730
849
  transcoder.transcode request_pb
@@ -746,8 +865,8 @@ module Google
746
865
  uri_template: "/compute/v1/projects/{project}/global/backendServices/{backend_service}",
747
866
  body: "backend_service_resource",
748
867
  matches: [
749
- ["project", %r{[^/]+}, false],
750
- ["backend_service", %r{[^/]+}, false]
868
+ ["project", %r{^[^/]+/?$}, false],
869
+ ["backend_service", %r{^[^/]+/?$}, false]
751
870
  ]
752
871
  )
753
872
  transcoder.transcode request_pb