google-cloud-compute-v1 2.5.0 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (195) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +72 -101
  3. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +37 -10
  4. data/lib/google/cloud/compute/v1/accelerator_types/rest/service_stub.rb +14 -2
  5. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +38 -10
  6. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +14 -2
  7. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +38 -10
  8. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +14 -2
  9. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +311 -8
  10. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +196 -2
  11. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +230 -10
  12. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +134 -2
  13. data/lib/google/cloud/compute/v1/compute_pb.rb +79 -1
  14. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +37 -10
  15. data/lib/google/cloud/compute/v1/disk_types/rest/service_stub.rb +14 -2
  16. data/lib/google/cloud/compute/v1/disks/rest/client.rb +38 -10
  17. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +14 -2
  18. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +35 -8
  19. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/service_stub.rb +14 -2
  20. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +35 -8
  21. data/lib/google/cloud/compute/v1/firewall_policies/rest/service_stub.rb +14 -2
  22. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +35 -8
  23. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +14 -2
  24. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +38 -10
  25. data/lib/google/cloud/compute/v1/forwarding_rules/rest/service_stub.rb +14 -2
  26. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +35 -8
  27. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +14 -2
  28. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +35 -8
  29. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/service_stub.rb +14 -2
  30. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +36 -9
  31. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/service_stub.rb +14 -2
  32. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +37 -10
  33. data/lib/google/cloud/compute/v1/global_operations/rest/service_stub.rb +14 -2
  34. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +34 -8
  35. data/lib/google/cloud/compute/v1/global_organization_operations/rest/service_stub.rb +14 -2
  36. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +35 -8
  37. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/service_stub.rb +14 -2
  38. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +38 -10
  39. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +14 -2
  40. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +33 -7
  41. data/lib/google/cloud/compute/v1/image_family_views/rest/service_stub.rb +14 -2
  42. data/lib/google/cloud/compute/v1/images/rest/client.rb +35 -8
  43. data/lib/google/cloud/compute/v1/images/rest/service_stub.rb +14 -2
  44. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +41 -13
  45. data/lib/google/cloud/compute/v1/instance_group_managers/rest/service_stub.rb +14 -2
  46. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +39 -11
  47. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +14 -2
  48. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +38 -10
  49. data/lib/google/cloud/compute/v1/instance_templates/rest/service_stub.rb +14 -2
  50. data/lib/google/cloud/compute/v1/instances/rest/client.rb +143 -11
  51. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +76 -2
  52. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +38 -10
  53. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/service_stub.rb +14 -2
  54. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +34 -8
  55. data/lib/google/cloud/compute/v1/interconnect_locations/rest/service_stub.rb +14 -2
  56. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +34 -8
  57. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/service_stub.rb +14 -2
  58. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +128 -9
  59. data/lib/google/cloud/compute/v1/interconnects/rest/service_stub.rb +74 -2
  60. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +33 -7
  61. data/lib/google/cloud/compute/v1/license_codes/rest/service_stub.rb +14 -2
  62. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +35 -8
  63. data/lib/google/cloud/compute/v1/licenses/rest/service_stub.rb +14 -2
  64. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +35 -8
  65. data/lib/google/cloud/compute/v1/machine_images/rest/service_stub.rb +14 -2
  66. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +37 -10
  67. data/lib/google/cloud/compute/v1/machine_types/rest/service_stub.rb +14 -2
  68. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +142 -10
  69. data/lib/google/cloud/compute/v1/network_attachments/rest/service_stub.rb +76 -2
  70. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +37 -9
  71. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/service_stub.rb +14 -2
  72. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +39 -11
  73. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/service_stub.rb +14 -2
  74. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +35 -8
  75. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/service_stub.rb +14 -2
  76. data/lib/google/cloud/compute/v1/networks/rest/client.rb +36 -9
  77. data/lib/google/cloud/compute/v1/networks/rest/service_stub.rb +14 -2
  78. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +39 -11
  79. data/lib/google/cloud/compute/v1/node_groups/rest/service_stub.rb +14 -2
  80. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +38 -10
  81. data/lib/google/cloud/compute/v1/node_templates/rest/service_stub.rb +14 -2
  82. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +37 -10
  83. data/lib/google/cloud/compute/v1/node_types/rest/service_stub.rb +14 -2
  84. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +38 -10
  85. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/service_stub.rb +14 -2
  86. data/lib/google/cloud/compute/v1/projects/rest/client.rb +36 -9
  87. data/lib/google/cloud/compute/v1/projects/rest/service_stub.rb +14 -2
  88. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +236 -11
  89. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/service_stub.rb +134 -2
  90. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +242 -10
  91. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/service_stub.rb +136 -2
  92. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +35 -8
  93. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +14 -2
  94. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +335 -8
  95. data/lib/google/cloud/compute/v1/region_backend_services/rest/service_stub.rb +198 -2
  96. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +38 -10
  97. data/lib/google/cloud/compute/v1/region_commitments/rest/service_stub.rb +14 -2
  98. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +34 -8
  99. data/lib/google/cloud/compute/v1/region_disk_types/rest/service_stub.rb +14 -2
  100. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +35 -8
  101. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +14 -2
  102. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +35 -8
  103. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +14 -2
  104. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +35 -8
  105. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +14 -2
  106. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +38 -11
  107. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/service_stub.rb +14 -2
  108. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +36 -9
  109. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +14 -2
  110. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +35 -8
  111. data/lib/google/cloud/compute/v1/region_instance_templates/rest/service_stub.rb +14 -2
  112. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +34 -7
  113. data/lib/google/cloud/compute/v1/region_instances/rest/service_stub.rb +14 -2
  114. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +348 -11
  115. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/service_stub.rb +199 -2
  116. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +35 -8
  117. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/service_stub.rb +14 -2
  118. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +35 -8
  119. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +14 -2
  120. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +34 -8
  121. data/lib/google/cloud/compute/v1/region_operations/rest/service_stub.rb +14 -2
  122. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +451 -12
  123. data/lib/google/cloud/compute/v1/region_security_policies/rest/service_stub.rb +260 -2
  124. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +35 -8
  125. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/service_stub.rb +14 -2
  126. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +36 -9
  127. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/service_stub.rb +14 -2
  128. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +35 -8
  129. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/service_stub.rb +14 -2
  130. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +35 -8
  131. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/service_stub.rb +14 -2
  132. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +35 -8
  133. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/service_stub.rb +14 -2
  134. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +35 -8
  135. data/lib/google/cloud/compute/v1/region_url_maps/rest/service_stub.rb +14 -2
  136. data/lib/google/cloud/compute/v1/regions/rest/client.rb +34 -8
  137. data/lib/google/cloud/compute/v1/regions/rest/service_stub.rb +14 -2
  138. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +38 -10
  139. data/lib/google/cloud/compute/v1/reservations/rest/service_stub.rb +14 -2
  140. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +38 -10
  141. data/lib/google/cloud/compute/v1/resource_policies/rest/service_stub.rb +14 -2
  142. data/lib/google/cloud/compute/v1/rest.rb +1 -0
  143. data/lib/google/cloud/compute/v1/routers/rest/client.rb +135 -11
  144. data/lib/google/cloud/compute/v1/routers/rest/service_stub.rb +75 -2
  145. data/lib/google/cloud/compute/v1/routes/rest/client.rb +35 -8
  146. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +14 -2
  147. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +45 -13
  148. data/lib/google/cloud/compute/v1/security_policies/rest/service_stub.rb +14 -2
  149. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +38 -10
  150. data/lib/google/cloud/compute/v1/service_attachments/rest/service_stub.rb +14 -2
  151. data/lib/google/cloud/compute/v1/snapshot_settings_service/credentials.rb +52 -0
  152. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/client.rb +507 -0
  153. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/service_stub.rb +179 -0
  154. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest.rb +51 -0
  155. data/lib/google/cloud/compute/v1/snapshot_settings_service.rb +47 -0
  156. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +35 -8
  157. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +14 -2
  158. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +38 -10
  159. data/lib/google/cloud/compute/v1/ssl_certificates/rest/service_stub.rb +14 -2
  160. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +39 -11
  161. data/lib/google/cloud/compute/v1/ssl_policies/rest/service_stub.rb +14 -2
  162. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +39 -11
  163. data/lib/google/cloud/compute/v1/subnetworks/rest/service_stub.rb +14 -2
  164. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +35 -8
  165. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/service_stub.rb +14 -2
  166. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +38 -10
  167. data/lib/google/cloud/compute/v1/target_http_proxies/rest/service_stub.rb +14 -2
  168. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +38 -10
  169. data/lib/google/cloud/compute/v1/target_https_proxies/rest/service_stub.rb +14 -2
  170. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +142 -10
  171. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +76 -2
  172. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +142 -10
  173. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +76 -2
  174. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +35 -8
  175. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +14 -2
  176. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +38 -10
  177. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +14 -2
  178. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +38 -10
  179. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/service_stub.rb +14 -2
  180. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +38 -10
  181. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +14 -2
  182. data/lib/google/cloud/compute/v1/version.rb +1 -1
  183. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +38 -10
  184. data/lib/google/cloud/compute/v1/vpn_gateways/rest/service_stub.rb +14 -2
  185. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +38 -10
  186. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/service_stub.rb +14 -2
  187. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +34 -8
  188. data/lib/google/cloud/compute/v1/zone_operations/rest/service_stub.rb +14 -2
  189. data/lib/google/cloud/compute/v1/zones/rest/client.rb +34 -8
  190. data/lib/google/cloud/compute/v1/zones/rest/service_stub.rb +14 -2
  191. data/lib/google/cloud/compute/v1.rb +1 -0
  192. data/proto_docs/google/api/client.rb +14 -0
  193. data/proto_docs/google/cloud/compute/v1/compute.rb +1654 -196
  194. data/proto_docs/google/protobuf/any.rb +144 -0
  195. metadata +11 -5
@@ -30,16 +30,28 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, credentials:
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
34
  # These require statements are intentionally placed here to initialize
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
39
42
  numeric_enums: false,
40
43
  raise_faraday_errors: false
41
44
  end
42
45
 
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
43
55
  ##
44
56
  # Baseline implementation for the add_signed_url_key REST call
45
57
  #
@@ -192,6 +204,44 @@ module Google
192
204
  result
193
205
  end
194
206
 
207
+ ##
208
+ # Baseline implementation for the get_iam_policy REST call
209
+ #
210
+ # @param request_pb [::Google::Cloud::Compute::V1::GetIamPolicyBackendBucketRequest]
211
+ # A request object representing the call parameters. Required.
212
+ # @param options [::Gapic::CallOptions]
213
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
214
+ #
215
+ # @yield [result, operation] Access the result along with the TransportOperation object
216
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
217
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
218
+ #
219
+ # @return [::Google::Cloud::Compute::V1::Policy]
220
+ # A result object deserialized from the server's reply
221
+ def get_iam_policy request_pb, options = nil
222
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
223
+
224
+ verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb
225
+ query_string_params = if query_string_params.any?
226
+ query_string_params.to_h { |p| p.split "=", 2 }
227
+ else
228
+ {}
229
+ end
230
+
231
+ response = @client_stub.make_http_request(
232
+ verb,
233
+ uri: uri,
234
+ body: body || "",
235
+ params: query_string_params,
236
+ options: options
237
+ )
238
+ operation = ::Gapic::Rest::TransportOperation.new response
239
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
240
+
241
+ yield result, operation if block_given?
242
+ result
243
+ end
244
+
195
245
  ##
196
246
  # Baseline implementation for the insert REST call
197
247
  #
@@ -344,6 +394,82 @@ module Google
344
394
  result
345
395
  end
346
396
 
397
+ ##
398
+ # Baseline implementation for the set_iam_policy REST call
399
+ #
400
+ # @param request_pb [::Google::Cloud::Compute::V1::SetIamPolicyBackendBucketRequest]
401
+ # A request object representing the call parameters. Required.
402
+ # @param options [::Gapic::CallOptions]
403
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
404
+ #
405
+ # @yield [result, operation] Access the result along with the TransportOperation object
406
+ # @yieldparam result [::Google::Cloud::Compute::V1::Policy]
407
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
408
+ #
409
+ # @return [::Google::Cloud::Compute::V1::Policy]
410
+ # A result object deserialized from the server's reply
411
+ def set_iam_policy request_pb, options = nil
412
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
413
+
414
+ verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb
415
+ query_string_params = if query_string_params.any?
416
+ query_string_params.to_h { |p| p.split "=", 2 }
417
+ else
418
+ {}
419
+ end
420
+
421
+ response = @client_stub.make_http_request(
422
+ verb,
423
+ uri: uri,
424
+ body: body || "",
425
+ params: query_string_params,
426
+ options: options
427
+ )
428
+ operation = ::Gapic::Rest::TransportOperation.new response
429
+ result = ::Google::Cloud::Compute::V1::Policy.decode_json response.body, ignore_unknown_fields: true
430
+
431
+ yield result, operation if block_given?
432
+ result
433
+ end
434
+
435
+ ##
436
+ # Baseline implementation for the test_iam_permissions REST call
437
+ #
438
+ # @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsBackendBucketRequest]
439
+ # A request object representing the call parameters. Required.
440
+ # @param options [::Gapic::CallOptions]
441
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
442
+ #
443
+ # @yield [result, operation] Access the result along with the TransportOperation object
444
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
445
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
446
+ #
447
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
448
+ # A result object deserialized from the server's reply
449
+ def test_iam_permissions request_pb, options = nil
450
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
451
+
452
+ verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb
453
+ query_string_params = if query_string_params.any?
454
+ query_string_params.to_h { |p| p.split "=", 2 }
455
+ else
456
+ {}
457
+ end
458
+
459
+ response = @client_stub.make_http_request(
460
+ verb,
461
+ uri: uri,
462
+ body: body || "",
463
+ params: query_string_params,
464
+ options: options
465
+ )
466
+ operation = ::Gapic::Rest::TransportOperation.new response
467
+ result = ::Google::Cloud::Compute::V1::TestPermissionsResponse.decode_json response.body, ignore_unknown_fields: true
468
+
469
+ yield result, operation if block_given?
470
+ result
471
+ end
472
+
347
473
  ##
348
474
  # Baseline implementation for the update REST call
349
475
  #
@@ -471,6 +597,28 @@ module Google
471
597
  transcoder.transcode request_pb
472
598
  end
473
599
 
600
+ ##
601
+ # @private
602
+ #
603
+ # GRPC transcoding helper method for the get_iam_policy REST call
604
+ #
605
+ # @param request_pb [::Google::Cloud::Compute::V1::GetIamPolicyBackendBucketRequest]
606
+ # A request object representing the call parameters. Required.
607
+ # @return [Array(String, [String, nil], Hash{String => String})]
608
+ # Uri, Body, Query string parameters
609
+ def self.transcode_get_iam_policy_request request_pb
610
+ transcoder = Gapic::Rest::GrpcTranscoder.new
611
+ .with_bindings(
612
+ uri_method: :get,
613
+ uri_template: "/compute/v1/projects/{project}/global/backendBuckets/{resource}/getIamPolicy",
614
+ matches: [
615
+ ["project", %r{^[^/]+/?$}, false],
616
+ ["resource", %r{^[^/]+/?$}, false]
617
+ ]
618
+ )
619
+ transcoder.transcode request_pb
620
+ end
621
+
474
622
  ##
475
623
  # @private
476
624
  #
@@ -560,6 +708,52 @@ module Google
560
708
  transcoder.transcode request_pb
561
709
  end
562
710
 
711
+ ##
712
+ # @private
713
+ #
714
+ # GRPC transcoding helper method for the set_iam_policy REST call
715
+ #
716
+ # @param request_pb [::Google::Cloud::Compute::V1::SetIamPolicyBackendBucketRequest]
717
+ # A request object representing the call parameters. Required.
718
+ # @return [Array(String, [String, nil], Hash{String => String})]
719
+ # Uri, Body, Query string parameters
720
+ def self.transcode_set_iam_policy_request request_pb
721
+ transcoder = Gapic::Rest::GrpcTranscoder.new
722
+ .with_bindings(
723
+ uri_method: :post,
724
+ uri_template: "/compute/v1/projects/{project}/global/backendBuckets/{resource}/setIamPolicy",
725
+ body: "global_set_policy_request_resource",
726
+ matches: [
727
+ ["project", %r{^[^/]+/?$}, false],
728
+ ["resource", %r{^[^/]+/?$}, false]
729
+ ]
730
+ )
731
+ transcoder.transcode request_pb
732
+ end
733
+
734
+ ##
735
+ # @private
736
+ #
737
+ # GRPC transcoding helper method for the test_iam_permissions REST call
738
+ #
739
+ # @param request_pb [::Google::Cloud::Compute::V1::TestIamPermissionsBackendBucketRequest]
740
+ # A request object representing the call parameters. Required.
741
+ # @return [Array(String, [String, nil], Hash{String => String})]
742
+ # Uri, Body, Query string parameters
743
+ def self.transcode_test_iam_permissions_request request_pb
744
+ transcoder = Gapic::Rest::GrpcTranscoder.new
745
+ .with_bindings(
746
+ uri_method: :post,
747
+ uri_template: "/compute/v1/projects/{project}/global/backendBuckets/{resource}/testIamPermissions",
748
+ body: "test_permissions_request_resource",
749
+ matches: [
750
+ ["project", %r{^[^/]+/?$}, false],
751
+ ["resource", %r{^[^/]+/?$}, false]
752
+ ]
753
+ )
754
+ transcoder.transcode request_pb
755
+ end
756
+
563
757
  ##
564
758
  # @private
565
759
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # The BackendServices API.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
38
+
36
39
  # @private
37
40
  attr_reader :backend_services_stub
38
41
 
@@ -95,6 +98,11 @@ module Google
95
98
  initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
96
99
  }
97
100
 
101
+ default_config.rpcs.list_usable.timeout = 600.0
102
+ default_config.rpcs.list_usable.retry_policy = {
103
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
104
+ }
105
+
98
106
  default_config.rpcs.patch.timeout = 600.0
99
107
 
100
108
  default_config.rpcs.set_edge_security_policy.timeout = 600.0
@@ -103,6 +111,8 @@ module Google
103
111
 
104
112
  default_config.rpcs.set_security_policy.timeout = 600.0
105
113
 
114
+ default_config.rpcs.test_iam_permissions.timeout = 600.0
115
+
106
116
  default_config.rpcs.update.timeout = 600.0
107
117
 
108
118
  default_config
@@ -131,6 +141,15 @@ module Google
131
141
  @config
132
142
  end
133
143
 
144
+ ##
145
+ # The effective universe domain
146
+ #
147
+ # @return [String]
148
+ #
149
+ def universe_domain
150
+ @backend_services_stub.universe_domain
151
+ end
152
+
134
153
  ##
135
154
  # Create a new BackendServices REST client object.
136
155
  #
@@ -158,8 +177,9 @@ module Google
158
177
  credentials = @config.credentials
159
178
  # Use self-signed JWT if the endpoint is unchanged from default,
160
179
  # but only if the default endpoint does not have a region prefix.
161
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
162
- !@config.endpoint.split(".").first.include?("-")
180
+ enable_self_signed_jwt = @config.endpoint.nil? ||
181
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
182
+ !@config.endpoint.split(".").first.include?("-"))
163
183
  credentials ||= Credentials.default scope: @config.scope,
164
184
  enable_self_signed_jwt: enable_self_signed_jwt
165
185
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -173,9 +193,15 @@ module Google
173
193
  config.credentials = credentials
174
194
  config.quota_project = @quota_project_id
175
195
  config.endpoint = @config.endpoint
196
+ config.universe_domain = @config.universe_domain
176
197
  end
177
198
 
178
- @backend_services_stub = ::Google::Cloud::Compute::V1::BackendServices::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
199
+ @backend_services_stub = ::Google::Cloud::Compute::V1::BackendServices::Rest::ServiceStub.new(
200
+ endpoint: @config.endpoint,
201
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
202
+ universe_domain: @config.universe_domain,
203
+ credentials: credentials
204
+ )
179
205
  end
180
206
 
181
207
  ##
@@ -292,13 +318,13 @@ module Google
292
318
  # @param options [::Gapic::CallOptions, ::Hash]
293
319
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
294
320
  #
295
- # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
321
+ # @overload aggregated_list(filter: nil, include_all_scopes: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil, service_project_number: nil)
296
322
  # Pass arguments to `aggregated_list` via keyword arguments. Note that at
297
323
  # least one keyword argument is required. To specify no parameters, or to keep all
298
324
  # the default parameter values, pass an empty Hash as a request object (see above).
299
325
  #
300
326
  # @param filter [::String]
301
- # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`.
327
+ # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.
302
328
  # @param include_all_scopes [::Boolean]
303
329
  # Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
304
330
  # @param max_results [::Integer]
@@ -311,6 +337,7 @@ module Google
311
337
  # Name of the project scoping this request.
312
338
  # @param return_partial_success [::Boolean]
313
339
  # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
340
+ # @param service_project_number [::Integer]
314
341
  # @yield [result, operation] Access the result along with the TransportOperation object
315
342
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::BackendServicesScopedList>]
316
343
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -904,7 +931,7 @@ module Google
904
931
  # the default parameter values, pass an empty Hash as a request object (see above).
905
932
  #
906
933
  # @param filter [::String]
907
- # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:` operator can be used with string fields to match substrings. For non-string fields it is equivalent to the `=` operator. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`.
934
+ # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.
908
935
  # @param max_results [::Integer]
909
936
  # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
910
937
  # @param order_by [::String]
@@ -974,6 +1001,95 @@ module Google
974
1001
  raise ::Google::Cloud::Error.from_error(e)
975
1002
  end
976
1003
 
1004
+ ##
1005
+ # Retrieves an aggregated list of all usable backend services in the specified project.
1006
+ #
1007
+ # @overload list_usable(request, options = nil)
1008
+ # Pass arguments to `list_usable` via a request object, either of type
1009
+ # {::Google::Cloud::Compute::V1::ListUsableBackendServicesRequest} or an equivalent Hash.
1010
+ #
1011
+ # @param request [::Google::Cloud::Compute::V1::ListUsableBackendServicesRequest, ::Hash]
1012
+ # A request object representing the call parameters. Required. To specify no
1013
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1014
+ # @param options [::Gapic::CallOptions, ::Hash]
1015
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1016
+ #
1017
+ # @overload list_usable(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, return_partial_success: nil)
1018
+ # Pass arguments to `list_usable` via keyword arguments. Note that at
1019
+ # least one keyword argument is required. To specify no parameters, or to keep all
1020
+ # the default parameter values, pass an empty Hash as a request object (see above).
1021
+ #
1022
+ # @param filter [::String]
1023
+ # A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions.
1024
+ # @param max_results [::Integer]
1025
+ # The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
1026
+ # @param order_by [::String]
1027
+ # Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported.
1028
+ # @param page_token [::String]
1029
+ # Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
1030
+ # @param project [::String]
1031
+ # Project ID for this request.
1032
+ # @param return_partial_success [::Boolean]
1033
+ # Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.
1034
+ # @yield [result, operation] Access the result along with the TransportOperation object
1035
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::BackendService>]
1036
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1037
+ #
1038
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::BackendService>]
1039
+ #
1040
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1041
+ #
1042
+ # @example Basic example
1043
+ # require "google/cloud/compute/v1"
1044
+ #
1045
+ # # Create a client object. The client can be reused for multiple calls.
1046
+ # client = Google::Cloud::Compute::V1::BackendServices::Rest::Client.new
1047
+ #
1048
+ # # Create a request. To set request fields, pass in keyword arguments.
1049
+ # request = Google::Cloud::Compute::V1::ListUsableBackendServicesRequest.new
1050
+ #
1051
+ # # Call the list_usable method.
1052
+ # result = client.list_usable request
1053
+ #
1054
+ # # The returned object is of type Google::Cloud::Compute::V1::BackendServiceListUsable.
1055
+ # p result
1056
+ #
1057
+ def list_usable request, options = nil
1058
+ raise ::ArgumentError, "request must be provided" if request.nil?
1059
+
1060
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListUsableBackendServicesRequest
1061
+
1062
+ # Converts hash and nil to an options object
1063
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1064
+
1065
+ # Customize the options with defaults
1066
+ call_metadata = @config.rpcs.list_usable.metadata.to_h
1067
+
1068
+ # Set x-goog-api-client and x-goog-user-project headers
1069
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1070
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1071
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1072
+ transports_version_send: [:rest]
1073
+
1074
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1075
+
1076
+ options.apply_defaults timeout: @config.rpcs.list_usable.timeout,
1077
+ metadata: call_metadata,
1078
+ retry_policy: @config.rpcs.list_usable.retry_policy
1079
+
1080
+ options.apply_defaults timeout: @config.timeout,
1081
+ metadata: @config.metadata,
1082
+ retry_policy: @config.retry_policy
1083
+
1084
+ @backend_services_stub.list_usable request, options do |result, operation|
1085
+ result = ::Gapic::Rest::PagedEnumerable.new @backend_services_stub, :list_usable, "items", request, result, options
1086
+ yield result, operation if block_given?
1087
+ return result
1088
+ end
1089
+ rescue ::Gapic::Rest::Error => e
1090
+ raise ::Google::Cloud::Error.from_error(e)
1091
+ end
1092
+
977
1093
  ##
978
1094
  # Patches the specified BackendService resource with the data included in the request. For more information, see Backend services overview. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
979
1095
  #
@@ -1332,6 +1448,88 @@ module Google
1332
1448
  raise ::Google::Cloud::Error.from_error(e)
1333
1449
  end
1334
1450
 
1451
+ ##
1452
+ # Returns permissions that a caller has on the specified resource.
1453
+ #
1454
+ # @overload test_iam_permissions(request, options = nil)
1455
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
1456
+ # {::Google::Cloud::Compute::V1::TestIamPermissionsBackendServiceRequest} or an equivalent Hash.
1457
+ #
1458
+ # @param request [::Google::Cloud::Compute::V1::TestIamPermissionsBackendServiceRequest, ::Hash]
1459
+ # A request object representing the call parameters. Required. To specify no
1460
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1461
+ # @param options [::Gapic::CallOptions, ::Hash]
1462
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1463
+ #
1464
+ # @overload test_iam_permissions(project: nil, resource: nil, test_permissions_request_resource: nil)
1465
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
1466
+ # least one keyword argument is required. To specify no parameters, or to keep all
1467
+ # the default parameter values, pass an empty Hash as a request object (see above).
1468
+ #
1469
+ # @param project [::String]
1470
+ # Project ID for this request.
1471
+ # @param resource [::String]
1472
+ # Name or id of the resource for this request.
1473
+ # @param test_permissions_request_resource [::Google::Cloud::Compute::V1::TestPermissionsRequest, ::Hash]
1474
+ # The body resource for this request
1475
+ # @yield [result, operation] Access the result along with the TransportOperation object
1476
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
1477
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1478
+ #
1479
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
1480
+ #
1481
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1482
+ #
1483
+ # @example Basic example
1484
+ # require "google/cloud/compute/v1"
1485
+ #
1486
+ # # Create a client object. The client can be reused for multiple calls.
1487
+ # client = Google::Cloud::Compute::V1::BackendServices::Rest::Client.new
1488
+ #
1489
+ # # Create a request. To set request fields, pass in keyword arguments.
1490
+ # request = Google::Cloud::Compute::V1::TestIamPermissionsBackendServiceRequest.new
1491
+ #
1492
+ # # Call the test_iam_permissions method.
1493
+ # result = client.test_iam_permissions request
1494
+ #
1495
+ # # The returned object is of type Google::Cloud::Compute::V1::TestPermissionsResponse.
1496
+ # p result
1497
+ #
1498
+ def test_iam_permissions request, options = nil
1499
+ raise ::ArgumentError, "request must be provided" if request.nil?
1500
+
1501
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::TestIamPermissionsBackendServiceRequest
1502
+
1503
+ # Converts hash and nil to an options object
1504
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1505
+
1506
+ # Customize the options with defaults
1507
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
1508
+
1509
+ # Set x-goog-api-client and x-goog-user-project headers
1510
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1511
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1512
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1513
+ transports_version_send: [:rest]
1514
+
1515
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1516
+
1517
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1518
+ metadata: call_metadata,
1519
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
1520
+
1521
+ options.apply_defaults timeout: @config.timeout,
1522
+ metadata: @config.metadata,
1523
+ retry_policy: @config.retry_policy
1524
+
1525
+ @backend_services_stub.test_iam_permissions request, options do |result, operation|
1526
+ yield result, operation if block_given?
1527
+ return result
1528
+ end
1529
+ rescue ::Gapic::Rest::Error => e
1530
+ raise ::Google::Cloud::Error.from_error(e)
1531
+ end
1532
+
1335
1533
  ##
1336
1534
  # Updates the specified BackendService resource with the data included in the request. For more information, see Backend services overview.
1337
1535
  #
@@ -1454,9 +1652,9 @@ module Google
1454
1652
  # end
1455
1653
  #
1456
1654
  # @!attribute [rw] endpoint
1457
- # The hostname or hostname:port of the service endpoint.
1458
- # Defaults to `"compute.googleapis.com"`.
1459
- # @return [::String]
1655
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1656
+ # nil, indicating to use the default endpoint in the current universe domain.
1657
+ # @return [::String,nil]
1460
1658
  # @!attribute [rw] credentials
1461
1659
  # Credentials to send with calls. You may provide any of the following types:
1462
1660
  # * (`String`) The path to a service account key file in JSON format
@@ -1493,13 +1691,20 @@ module Google
1493
1691
  # @!attribute [rw] quota_project
1494
1692
  # A separate project against which to charge quota.
1495
1693
  # @return [::String]
1694
+ # @!attribute [rw] universe_domain
1695
+ # The universe domain within which to make requests. This determines the
1696
+ # default endpoint URL. The default value of nil uses the environment
1697
+ # universe (usually the default "googleapis.com" universe).
1698
+ # @return [::String,nil]
1496
1699
  #
1497
1700
  class Configuration
1498
1701
  extend ::Gapic::Config
1499
1702
 
1703
+ # @private
1704
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1500
1705
  DEFAULT_ENDPOINT = "compute.googleapis.com"
1501
1706
 
1502
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1707
+ config_attr :endpoint, nil, ::String, nil
1503
1708
  config_attr :credentials, nil do |value|
1504
1709
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1505
1710
  allowed.any? { |klass| klass === value }
@@ -1511,6 +1716,7 @@ module Google
1511
1716
  config_attr :metadata, nil, ::Hash, nil
1512
1717
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1513
1718
  config_attr :quota_project, nil, ::String, nil
1719
+ config_attr :universe_domain, nil, ::String, nil
1514
1720
 
1515
1721
  # @private
1516
1722
  def initialize parent_config = nil
@@ -1595,6 +1801,11 @@ module Google
1595
1801
  #
1596
1802
  attr_reader :list
1597
1803
  ##
1804
+ # RPC-specific configuration for `list_usable`
1805
+ # @return [::Gapic::Config::Method]
1806
+ #
1807
+ attr_reader :list_usable
1808
+ ##
1598
1809
  # RPC-specific configuration for `patch`
1599
1810
  # @return [::Gapic::Config::Method]
1600
1811
  #
@@ -1615,6 +1826,11 @@ module Google
1615
1826
  #
1616
1827
  attr_reader :set_security_policy
1617
1828
  ##
1829
+ # RPC-specific configuration for `test_iam_permissions`
1830
+ # @return [::Gapic::Config::Method]
1831
+ #
1832
+ attr_reader :test_iam_permissions
1833
+ ##
1618
1834
  # RPC-specific configuration for `update`
1619
1835
  # @return [::Gapic::Config::Method]
1620
1836
  #
@@ -1640,6 +1856,8 @@ module Google
1640
1856
  @insert = ::Gapic::Config::Method.new insert_config
1641
1857
  list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
1642
1858
  @list = ::Gapic::Config::Method.new list_config
1859
+ list_usable_config = parent_rpcs.list_usable if parent_rpcs.respond_to? :list_usable
1860
+ @list_usable = ::Gapic::Config::Method.new list_usable_config
1643
1861
  patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
1644
1862
  @patch = ::Gapic::Config::Method.new patch_config
1645
1863
  set_edge_security_policy_config = parent_rpcs.set_edge_security_policy if parent_rpcs.respond_to? :set_edge_security_policy
@@ -1648,6 +1866,8 @@ module Google
1648
1866
  @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1649
1867
  set_security_policy_config = parent_rpcs.set_security_policy if parent_rpcs.respond_to? :set_security_policy
1650
1868
  @set_security_policy = ::Gapic::Config::Method.new set_security_policy_config
1869
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1870
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1651
1871
  update_config = parent_rpcs.update if parent_rpcs.respond_to? :update
1652
1872
  @update = ::Gapic::Config::Method.new update_config
1653
1873