google-cloud-compute-v1 3.4.0 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/compute/v1/accelerator_types/rest/client.rb +181 -14
  3. data/lib/google/cloud/compute/v1/addresses/rest/client.rb +237 -20
  4. data/lib/google/cloud/compute/v1/advice/credentials.rb +52 -0
  5. data/lib/google/cloud/compute/v1/advice/rest/client.rb +431 -0
  6. data/lib/google/cloud/compute/v1/advice/rest/service_stub.rb +144 -0
  7. data/lib/google/cloud/compute/v1/advice/rest.rb +51 -0
  8. data/lib/google/cloud/compute/v1/advice.rb +47 -0
  9. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +334 -21
  10. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +64 -0
  11. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +573 -23
  12. data/lib/google/cloud/compute/v1/backend_buckets/rest/service_stub.rb +122 -0
  13. data/lib/google/cloud/compute/v1/backend_services/rest/client.rb +499 -40
  14. data/lib/google/cloud/compute/v1/backend_services/rest/service_stub.rb +62 -0
  15. data/lib/google/cloud/compute/v1/compute_pb.rb +357 -25
  16. data/lib/google/cloud/compute/v1/cross_site_networks/credentials.rb +52 -0
  17. data/lib/google/cloud/compute/v1/cross_site_networks/rest/client.rb +975 -0
  18. data/lib/google/cloud/compute/v1/cross_site_networks/rest/service_stub.rb +391 -0
  19. data/lib/google/cloud/compute/v1/cross_site_networks/rest.rb +51 -0
  20. data/lib/google/cloud/compute/v1/cross_site_networks.rb +47 -0
  21. data/lib/google/cloud/compute/v1/disk_types/rest/client.rb +181 -14
  22. data/lib/google/cloud/compute/v1/disks/rest/client.rb +508 -42
  23. data/lib/google/cloud/compute/v1/disks/rest/service_stub.rb +64 -0
  24. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +118 -11
  25. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +240 -25
  26. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +238 -13
  27. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +63 -0
  28. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +258 -23
  29. data/lib/google/cloud/compute/v1/future_reservations/credentials.rb +52 -0
  30. data/lib/google/cloud/compute/v1/future_reservations/rest/client.rb +1287 -0
  31. data/lib/google/cloud/compute/v1/future_reservations/rest/service_stub.rb +520 -0
  32. data/lib/google/cloud/compute/v1/future_reservations/rest.rb +51 -0
  33. data/lib/google/cloud/compute/v1/future_reservations.rb +47 -0
  34. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +126 -10
  35. data/lib/google/cloud/compute/v1/global_forwarding_rules/rest/client.rb +151 -15
  36. data/lib/google/cloud/compute/v1/global_network_endpoint_groups/rest/client.rb +246 -21
  37. data/lib/google/cloud/compute/v1/global_operations/rest/client.rb +203 -18
  38. data/lib/google/cloud/compute/v1/global_organization_operations/rest/client.rb +91 -9
  39. data/lib/google/cloud/compute/v1/global_public_delegated_prefixes/rest/client.rb +128 -10
  40. data/lib/google/cloud/compute/v1/health_checks/rest/client.rb +333 -21
  41. data/lib/google/cloud/compute/v1/health_checks/rest/service_stub.rb +63 -0
  42. data/lib/google/cloud/compute/v1/image_family_views/rest/client.rb +2 -1
  43. data/lib/google/cloud/compute/v1/images/rest/client.rb +161 -18
  44. data/lib/google/cloud/compute/v1/instance_group_manager_resize_requests/rest/client.rb +159 -24
  45. data/lib/google/cloud/compute/v1/instance_group_managers/rest/client.rb +920 -95
  46. data/lib/google/cloud/compute/v1/instance_groups/rest/client.rb +380 -40
  47. data/lib/google/cloud/compute/v1/instance_settings_service/rest/client.rb +13 -1
  48. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +220 -20
  49. data/lib/google/cloud/compute/v1/instances/rest/client.rb +939 -104
  50. data/lib/google/cloud/compute/v1/instant_snapshot_groups/credentials.rb +52 -0
  51. data/lib/google/cloud/compute/v1/instant_snapshot_groups/rest/client.rb +1145 -0
  52. data/lib/google/cloud/compute/v1/instant_snapshot_groups/rest/service_stub.rb +523 -0
  53. data/lib/google/cloud/compute/v1/instant_snapshot_groups/rest.rb +51 -0
  54. data/lib/google/cloud/compute/v1/instant_snapshot_groups.rb +47 -0
  55. data/lib/google/cloud/compute/v1/instant_snapshots/rest/client.rb +235 -21
  56. data/lib/google/cloud/compute/v1/interconnect_attachment_groups/rest/client.rb +139 -14
  57. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +242 -21
  58. data/lib/google/cloud/compute/v1/interconnect_groups/rest/client.rb +139 -14
  59. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +87 -7
  60. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +87 -7
  61. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +145 -14
  62. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +9 -2
  63. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +161 -16
  64. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +124 -13
  65. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +181 -14
  66. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +232 -20
  67. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +138 -12
  68. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +361 -37
  69. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +354 -33
  70. data/lib/google/cloud/compute/v1/network_profiles/rest/client.rb +85 -6
  71. data/lib/google/cloud/compute/v1/networks/rest/client.rb +281 -23
  72. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +381 -32
  73. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +213 -19
  74. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +181 -14
  75. data/lib/google/cloud/compute/v1/organization_security_policies/credentials.rb +52 -0
  76. data/lib/google/cloud/compute/v1/organization_security_policies/rest/client.rb +2259 -0
  77. data/lib/google/cloud/compute/v1/organization_security_policies/rest/service_stub.rb +1054 -0
  78. data/lib/google/cloud/compute/v1/organization_security_policies/rest.rb +51 -0
  79. data/lib/google/cloud/compute/v1/organization_security_policies.rb +47 -0
  80. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +226 -19
  81. data/lib/google/cloud/compute/v1/preview_features/credentials.rb +52 -0
  82. data/lib/google/cloud/compute/v1/preview_features/rest/client.rb +739 -0
  83. data/lib/google/cloud/compute/v1/preview_features/rest/service_stub.rb +267 -0
  84. data/lib/google/cloud/compute/v1/preview_features/rest.rb +51 -0
  85. data/lib/google/cloud/compute/v1/preview_features.rb +47 -0
  86. data/lib/google/cloud/compute/v1/projects/rest/client.rb +346 -30
  87. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +154 -12
  88. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +255 -22
  89. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +238 -13
  90. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +64 -0
  91. data/lib/google/cloud/compute/v1/region_backend_buckets/credentials.rb +52 -0
  92. data/lib/google/cloud/compute/v1/region_backend_buckets/rest/client.rb +1450 -0
  93. data/lib/google/cloud/compute/v1/region_backend_buckets/rest/service_stub.rb +649 -0
  94. data/lib/google/cloud/compute/v1/region_backend_buckets/rest.rb +51 -0
  95. data/lib/google/cloud/compute/v1/region_backend_buckets.rb +47 -0
  96. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +260 -26
  97. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +212 -18
  98. data/lib/google/cloud/compute/v1/region_composite_health_checks/credentials.rb +52 -0
  99. data/lib/google/cloud/compute/v1/region_composite_health_checks/rest/client.rb +1363 -0
  100. data/lib/google/cloud/compute/v1/region_composite_health_checks/rest/service_stub.rb +584 -0
  101. data/lib/google/cloud/compute/v1/region_composite_health_checks/rest.rb +51 -0
  102. data/lib/google/cloud/compute/v1/region_composite_health_checks.rb +47 -0
  103. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +83 -5
  104. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +387 -29
  105. data/lib/google/cloud/compute/v1/region_disks/rest/service_stub.rb +64 -0
  106. data/lib/google/cloud/compute/v1/region_health_aggregation_policies/credentials.rb +52 -0
  107. data/lib/google/cloud/compute/v1/region_health_aggregation_policies/rest/client.rb +1268 -0
  108. data/lib/google/cloud/compute/v1/region_health_aggregation_policies/rest/service_stub.rb +521 -0
  109. data/lib/google/cloud/compute/v1/region_health_aggregation_policies/rest.rb +51 -0
  110. data/lib/google/cloud/compute/v1/region_health_aggregation_policies.rb +47 -0
  111. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +427 -17
  112. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +125 -0
  113. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +238 -13
  114. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +64 -0
  115. data/lib/google/cloud/compute/v1/region_health_sources/credentials.rb +52 -0
  116. data/lib/google/cloud/compute/v1/region_health_sources/rest/client.rb +1363 -0
  117. data/lib/google/cloud/compute/v1/region_health_sources/rest/service_stub.rb +584 -0
  118. data/lib/google/cloud/compute/v1/region_health_sources/rest.rb +51 -0
  119. data/lib/google/cloud/compute/v1/region_health_sources.rb +47 -0
  120. data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests/credentials.rb +52 -0
  121. data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests/rest/client.rb +1002 -0
  122. data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests/rest/service_stub.rb +400 -0
  123. data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests/rest.rb +51 -0
  124. data/lib/google/cloud/compute/v1/region_instance_group_manager_resize_requests.rb +47 -0
  125. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +750 -64
  126. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +187 -14
  127. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +115 -10
  128. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +15 -2
  129. data/lib/google/cloud/compute/v1/region_instant_snapshot_groups/credentials.rb +52 -0
  130. data/lib/google/cloud/compute/v1/region_instant_snapshot_groups/rest/client.rb +1146 -0
  131. data/lib/google/cloud/compute/v1/region_instant_snapshot_groups/rest/service_stub.rb +523 -0
  132. data/lib/google/cloud/compute/v1/region_instant_snapshot_groups/rest.rb +51 -0
  133. data/lib/google/cloud/compute/v1/region_instant_snapshot_groups.rb +47 -0
  134. data/lib/google/cloud/compute/v1/region_instant_snapshots/rest/client.rb +139 -13
  135. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +264 -28
  136. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +213 -20
  137. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +399 -11
  138. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +125 -0
  139. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +107 -10
  140. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +149 -14
  141. data/lib/google/cloud/compute/v1/region_snapshot_settings/credentials.rb +52 -0
  142. data/lib/google/cloud/compute/v1/region_snapshot_settings/rest/client.rb +561 -0
  143. data/lib/google/cloud/compute/v1/region_snapshot_settings/rest/service_stub.rb +206 -0
  144. data/lib/google/cloud/compute/v1/region_snapshot_settings/rest.rb +51 -0
  145. data/lib/google/cloud/compute/v1/region_snapshot_settings.rb +47 -0
  146. data/lib/google/cloud/compute/v1/region_snapshots/credentials.rb +52 -0
  147. data/lib/google/cloud/compute/v1/region_snapshots/rest/client.rb +1388 -0
  148. data/lib/google/cloud/compute/v1/region_snapshots/rest/service_stub.rb +651 -0
  149. data/lib/google/cloud/compute/v1/region_snapshots/rest.rb +51 -0
  150. data/lib/google/cloud/compute/v1/region_snapshots.rb +47 -0
  151. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +116 -10
  152. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +220 -20
  153. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +126 -10
  154. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +158 -14
  155. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +113 -9
  156. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +104 -14
  157. data/lib/google/cloud/compute/v1/region_zones/rest/client.rb +85 -6
  158. data/lib/google/cloud/compute/v1/regions/rest/client.rb +120 -7
  159. data/lib/google/cloud/compute/v1/reservation_blocks/rest/client.rb +396 -11
  160. data/lib/google/cloud/compute/v1/reservation_blocks/rest/service_stub.rb +194 -0
  161. data/lib/google/cloud/compute/v1/reservation_slots/credentials.rb +52 -0
  162. data/lib/google/cloud/compute/v1/reservation_slots/rest/client.rb +863 -0
  163. data/lib/google/cloud/compute/v1/reservation_slots/rest/service_stub.rb +338 -0
  164. data/lib/google/cloud/compute/v1/reservation_slots/rest.rb +51 -0
  165. data/lib/google/cloud/compute/v1/reservation_slots.rb +47 -0
  166. data/lib/google/cloud/compute/v1/reservation_sub_blocks/rest/client.rb +642 -12
  167. data/lib/google/cloud/compute/v1/reservation_sub_blocks/rest/service_stub.rb +327 -3
  168. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +257 -24
  169. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +224 -19
  170. data/lib/google/cloud/compute/v1/rest.rb +17 -0
  171. data/lib/google/cloud/compute/v1/routers/rest/client.rb +555 -50
  172. data/lib/google/cloud/compute/v1/routes/rest/client.rb +202 -8
  173. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +63 -0
  174. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +316 -26
  175. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +231 -21
  176. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/client.rb +13 -1
  177. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +245 -13
  178. data/lib/google/cloud/compute/v1/snapshots/rest/service_stub.rb +63 -0
  179. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +210 -17
  180. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +315 -27
  181. data/lib/google/cloud/compute/v1/storage_pool_types/rest/client.rb +181 -14
  182. data/lib/google/cloud/compute/v1/storage_pools/rest/client.rb +321 -28
  183. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +378 -34
  184. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +128 -10
  185. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +240 -20
  186. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +306 -30
  187. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +227 -20
  188. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +294 -26
  189. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +281 -19
  190. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +63 -0
  191. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +329 -20
  192. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +63 -0
  193. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +224 -19
  194. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +354 -24
  195. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +63 -0
  196. data/lib/google/cloud/compute/v1/version.rb +1 -1
  197. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +224 -19
  198. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +224 -19
  199. data/lib/google/cloud/compute/v1/wire_groups/credentials.rb +52 -0
  200. data/lib/google/cloud/compute/v1/wire_groups/rest/client.rb +980 -0
  201. data/lib/google/cloud/compute/v1/wire_groups/rest/service_stub.rb +396 -0
  202. data/lib/google/cloud/compute/v1/wire_groups/rest.rb +51 -0
  203. data/lib/google/cloud/compute/v1/wire_groups.rb +47 -0
  204. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +106 -10
  205. data/lib/google/cloud/compute/v1/zone_vm_extension_policies/credentials.rb +52 -0
  206. data/lib/google/cloud/compute/v1/zone_vm_extension_policies/rest/client.rb +975 -0
  207. data/lib/google/cloud/compute/v1/zone_vm_extension_policies/rest/service_stub.rb +396 -0
  208. data/lib/google/cloud/compute/v1/zone_vm_extension_policies/rest.rb +51 -0
  209. data/lib/google/cloud/compute/v1/zone_vm_extension_policies.rb +47 -0
  210. data/lib/google/cloud/compute/v1/zones/rest/client.rb +83 -5
  211. data/lib/google/cloud/compute/v1.rb +17 -0
  212. data/proto_docs/google/api/client.rb +149 -29
  213. data/proto_docs/google/cloud/compute/v1/compute.rb +47064 -5503
  214. metadata +87 -2
@@ -0,0 +1,1363 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/compute/v1/compute_pb"
21
+ require "google/cloud/compute/v1/region_health_sources/rest/service_stub"
22
+ require "google/cloud/compute/v1/region_operations/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Compute
27
+ module V1
28
+ module RegionHealthSources
29
+ module Rest
30
+ ##
31
+ # REST client for the RegionHealthSources service.
32
+ #
33
+ # The RegionHealthSources API.
34
+ #
35
+ class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
39
+ # @private
40
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
41
+
42
+ # @private
43
+ attr_reader :region_health_sources_stub
44
+
45
+ ##
46
+ # Configure the RegionHealthSources Client class.
47
+ #
48
+ # See {::Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all RegionHealthSources clients
54
+ # ::Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "Compute", "V1"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.rpcs.aggregated_list.timeout = 600.0
75
+ default_config.rpcs.aggregated_list.retry_policy = {
76
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
77
+ }
78
+
79
+ default_config.rpcs.delete.timeout = 600.0
80
+
81
+ default_config.rpcs.get.timeout = 600.0
82
+ default_config.rpcs.get.retry_policy = {
83
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
84
+ }
85
+
86
+ default_config.rpcs.get_health.timeout = 600.0
87
+ default_config.rpcs.get_health.retry_policy = {
88
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
89
+ }
90
+
91
+ default_config.rpcs.insert.timeout = 600.0
92
+
93
+ default_config.rpcs.list.timeout = 600.0
94
+ default_config.rpcs.list.retry_policy = {
95
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
96
+ }
97
+
98
+ default_config.rpcs.patch.timeout = 600.0
99
+
100
+ default_config.rpcs.test_iam_permissions.timeout = 600.0
101
+
102
+ default_config
103
+ end
104
+ yield @configure if block_given?
105
+ @configure
106
+ end
107
+
108
+ ##
109
+ # Configure the RegionHealthSources Client instance.
110
+ #
111
+ # The configuration is set to the derived mode, meaning that values can be changed,
112
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
113
+ # should be made on {Client.configure}.
114
+ #
115
+ # See {::Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client::Configuration}
116
+ # for a description of the configuration fields.
117
+ #
118
+ # @yield [config] Configure the Client client.
119
+ # @yieldparam config [Client::Configuration]
120
+ #
121
+ # @return [Client::Configuration]
122
+ #
123
+ def configure
124
+ yield @config if block_given?
125
+ @config
126
+ end
127
+
128
+ ##
129
+ # The effective universe domain
130
+ #
131
+ # @return [String]
132
+ #
133
+ def universe_domain
134
+ @region_health_sources_stub.universe_domain
135
+ end
136
+
137
+ ##
138
+ # Create a new RegionHealthSources REST client object.
139
+ #
140
+ # @example
141
+ #
142
+ # # Create a client using the default configuration
143
+ # client = ::Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client.new
144
+ #
145
+ # # Create a client using a custom configuration
146
+ # client = ::Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client.new do |config|
147
+ # config.timeout = 10.0
148
+ # end
149
+ #
150
+ # @yield [config] Configure the RegionHealthSources client.
151
+ # @yieldparam config [Client::Configuration]
152
+ #
153
+ def initialize
154
+ # Create the configuration object
155
+ @config = Configuration.new Client.configure
156
+
157
+ # Yield the configuration if needed
158
+ yield @config if block_given?
159
+
160
+ # Create credentials
161
+ credentials = @config.credentials
162
+ # Use self-signed JWT if the endpoint is unchanged from default,
163
+ # but only if the default endpoint does not have a region prefix.
164
+ enable_self_signed_jwt = @config.endpoint.nil? ||
165
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
166
+ !@config.endpoint.split(".").first.include?("-"))
167
+ credentials ||= Credentials.default scope: @config.scope,
168
+ enable_self_signed_jwt: enable_self_signed_jwt
169
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
170
+ credentials = Credentials.new credentials, scope: @config.scope
171
+ end
172
+
173
+ @quota_project_id = @config.quota_project
174
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
175
+
176
+ @region_operations = ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.new do |config|
177
+ config.credentials = credentials
178
+ config.quota_project = @quota_project_id
179
+ config.endpoint = @config.endpoint
180
+ config.universe_domain = @config.universe_domain
181
+ end
182
+
183
+ @region_health_sources_stub = ::Google::Cloud::Compute::V1::RegionHealthSources::Rest::ServiceStub.new(
184
+ endpoint: @config.endpoint,
185
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
186
+ universe_domain: @config.universe_domain,
187
+ credentials: credentials,
188
+ logger: @config.logger
189
+ )
190
+
191
+ @region_health_sources_stub.logger(stub: true)&.info do |entry|
192
+ entry.set_system_name
193
+ entry.set_service
194
+ entry.message = "Created client for #{entry.service}"
195
+ entry.set_credentials_fields credentials
196
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
197
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
198
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
199
+ end
200
+ end
201
+
202
+ ##
203
+ # Get the associated client for long-running operations via RegionOperations.
204
+ #
205
+ # @return [::Google::Cloud::Compute::V1::RegionOperations::Rest::Client]
206
+ #
207
+ attr_reader :region_operations
208
+
209
+ ##
210
+ # The logger used for request/response debug logging.
211
+ #
212
+ # @return [Logger]
213
+ #
214
+ def logger
215
+ @region_health_sources_stub.logger
216
+ end
217
+
218
+ # Service calls
219
+
220
+ ##
221
+ # Retrieves the list of all HealthSource resources (all
222
+ # regional) available to the specified project.
223
+ #
224
+ # To prevent failure, Google recommends that you set the
225
+ # `returnPartialSuccess` parameter to `true`.
226
+ #
227
+ # @overload aggregated_list(request, options = nil)
228
+ # Pass arguments to `aggregated_list` via a request object, either of type
229
+ # {::Google::Cloud::Compute::V1::AggregatedListRegionHealthSourcesRequest} or an equivalent Hash.
230
+ #
231
+ # @param request [::Google::Cloud::Compute::V1::AggregatedListRegionHealthSourcesRequest, ::Hash]
232
+ # A request object representing the call parameters. Required. To specify no
233
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
234
+ # @param options [::Gapic::CallOptions, ::Hash]
235
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
236
+ #
237
+ # @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)
238
+ # Pass arguments to `aggregated_list` via keyword arguments. Note that at
239
+ # least one keyword argument is required. To specify no parameters, or to keep all
240
+ # the default parameter values, pass an empty Hash as a request object (see above).
241
+ #
242
+ # @param filter [::String]
243
+ # A filter expression that filters resources listed in the response. Most
244
+ # Compute resources support two types of filter expressions:
245
+ # expressions that support regular expressions and expressions that follow
246
+ # API improvement proposal AIP-160.
247
+ # These two types of filter expressions cannot be mixed in one request.
248
+ #
249
+ # If you want to use AIP-160, your expression must specify the field name, an
250
+ # operator, and the value that you want to use for filtering. The value
251
+ # must be a string, a number, or a boolean. The operator
252
+ # must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`.
253
+ #
254
+ # For example, if you are filtering Compute Engine instances, you can
255
+ # exclude instances named `example-instance` by specifying
256
+ # `name != example-instance`.
257
+ #
258
+ # The `:*` comparison can be used to test whether a key has been defined.
259
+ # For example, to find all objects with `owner` label use:
260
+ # ```
261
+ # labels.owner:*
262
+ # ```
263
+ #
264
+ # You can also filter nested fields. For example, you could specify
265
+ # `scheduling.automaticRestart = false` to include instances only
266
+ # if they are not scheduled for automatic restarts. You can use filtering
267
+ # on nested fields to filter based onresource labels.
268
+ #
269
+ # To filter on multiple expressions, provide each separate expression within
270
+ # parentheses. For example:
271
+ # ```
272
+ # (scheduling.automaticRestart = true)
273
+ # (cpuPlatform = "Intel Skylake")
274
+ # ```
275
+ # By default, each expression is an `AND` expression. However, you
276
+ # can include `AND` and `OR` expressions explicitly.
277
+ # For example:
278
+ # ```
279
+ # (cpuPlatform = "Intel Skylake") OR
280
+ # (cpuPlatform = "Intel Broadwell") AND
281
+ # (scheduling.automaticRestart = true)
282
+ # ```
283
+ #
284
+ # If you want to use a regular expression, use the `eq` (equal) or `ne`
285
+ # (not equal) operator against a single un-parenthesized expression with or
286
+ # without quotes or against multiple parenthesized expressions. Examples:
287
+ #
288
+ # `fieldname eq unquoted literal`
289
+ # `fieldname eq 'single quoted literal'`
290
+ # `fieldname eq "double quoted literal"`
291
+ # `(fieldname1 eq literal) (fieldname2 ne "literal")`
292
+ #
293
+ # The literal value is interpreted as a regular expression using GoogleRE2 library syntax.
294
+ # The literal value must match the entire field.
295
+ #
296
+ # For example, to filter for instances that do not end with name "instance",
297
+ # you would use `name ne .*instance`.
298
+ #
299
+ # You cannot combine constraints on multiple fields using regular
300
+ # expressions.
301
+ # @param include_all_scopes [::Boolean]
302
+ # Indicates whether every visible scope for each scope type (zone, region,
303
+ # global) should be included in the response. For new resource types added
304
+ # after this field, the flag has no effect as new resource types will always
305
+ # include every visible scope for each scope type in response. For resource
306
+ # types which predate this field, if this flag is omitted or false, only
307
+ # scopes of the scope types where the resource type is expected to be found
308
+ # will be included.
309
+ # @param max_results [::Integer]
310
+ # The maximum number of results per page that should be returned.
311
+ # If the number of available results is larger than `maxResults`,
312
+ # Compute Engine returns a `nextPageToken` that can be used to get
313
+ # the next page of results in subsequent list requests. Acceptable values are
314
+ # `0` to `500`, inclusive. (Default: `500`)
315
+ # @param order_by [::String]
316
+ # Sorts list results by a certain order. By default, results
317
+ # are returned in alphanumerical order based on the resource name.
318
+ #
319
+ # You can also sort results in descending order based on the creation
320
+ # timestamp using `orderBy="creationTimestamp desc"`. This sorts
321
+ # results based on the `creationTimestamp` field in
322
+ # reverse chronological order (newest result first). Use this to sort
323
+ # resources like operations so that the newest operation is returned first.
324
+ #
325
+ # Currently, only sorting by `name` or
326
+ # `creationTimestamp desc` is supported.
327
+ # @param page_token [::String]
328
+ # Specifies a page token to use. Set `pageToken` to the
329
+ # `nextPageToken` returned by a previous list request to get
330
+ # the next page of results.
331
+ # @param project [::String]
332
+ # Name of the project scoping this request.
333
+ # @param return_partial_success [::Boolean]
334
+ # Opt-in for partial success behavior which provides partial results in case
335
+ # of failure. The default value is false.
336
+ #
337
+ # For example, when partial success behavior is enabled, aggregatedList for a
338
+ # single zone scope either returns all resources in the zone or no resources,
339
+ # with an error code.
340
+ # @param service_project_number [::Integer]
341
+ # The Shared VPC service project id or service project number for which
342
+ # aggregated list request is invoked for subnetworks list-usable api.
343
+ # @yield [result, operation] Access the result along with the TransportOperation object
344
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::HealthSourcesScopedList>]
345
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
346
+ #
347
+ # @return [::Gapic::Rest::PagedEnumerable<::String, ::Google::Cloud::Compute::V1::HealthSourcesScopedList>]
348
+ #
349
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
350
+ #
351
+ # @example Basic example
352
+ # require "google/cloud/compute/v1"
353
+ #
354
+ # # Create a client object. The client can be reused for multiple calls.
355
+ # client = Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client.new
356
+ #
357
+ # # Create a request. To set request fields, pass in keyword arguments.
358
+ # request = Google::Cloud::Compute::V1::AggregatedListRegionHealthSourcesRequest.new
359
+ #
360
+ # # Call the aggregated_list method.
361
+ # result = client.aggregated_list request
362
+ #
363
+ # # The returned object is of type Google::Cloud::Compute::V1::HealthSourceAggregatedList.
364
+ # p result
365
+ #
366
+ def aggregated_list request, options = nil
367
+ raise ::ArgumentError, "request must be provided" if request.nil?
368
+
369
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::AggregatedListRegionHealthSourcesRequest
370
+
371
+ # Converts hash and nil to an options object
372
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
373
+
374
+ # Customize the options with defaults
375
+ call_metadata = @config.rpcs.aggregated_list.metadata.to_h
376
+
377
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
378
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
379
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
380
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
381
+ transports_version_send: [:rest]
382
+
383
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
384
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
385
+
386
+ options.apply_defaults timeout: @config.rpcs.aggregated_list.timeout,
387
+ metadata: call_metadata,
388
+ retry_policy: @config.rpcs.aggregated_list.retry_policy
389
+
390
+ options.apply_defaults timeout: @config.timeout,
391
+ metadata: @config.metadata,
392
+ retry_policy: @config.retry_policy
393
+
394
+ @region_health_sources_stub.aggregated_list request, options do |result, operation|
395
+ result = ::Gapic::Rest::PagedEnumerable.new @region_health_sources_stub, :aggregated_list, "items", request, result, options
396
+ yield result, operation if block_given?
397
+ throw :response, result
398
+ end
399
+ rescue ::Gapic::Rest::Error => e
400
+ raise ::Google::Cloud::Error.from_error(e)
401
+ end
402
+
403
+ ##
404
+ # Deletes the specified HealthSource in the given region
405
+ #
406
+ # @overload delete(request, options = nil)
407
+ # Pass arguments to `delete` via a request object, either of type
408
+ # {::Google::Cloud::Compute::V1::DeleteRegionHealthSourceRequest} or an equivalent Hash.
409
+ #
410
+ # @param request [::Google::Cloud::Compute::V1::DeleteRegionHealthSourceRequest, ::Hash]
411
+ # A request object representing the call parameters. Required. To specify no
412
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
413
+ # @param options [::Gapic::CallOptions, ::Hash]
414
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
415
+ #
416
+ # @overload delete(health_source: nil, project: nil, region: nil, request_id: nil)
417
+ # Pass arguments to `delete` via keyword arguments. Note that at
418
+ # least one keyword argument is required. To specify no parameters, or to keep all
419
+ # the default parameter values, pass an empty Hash as a request object (see above).
420
+ #
421
+ # @param health_source [::String]
422
+ # Name of the HealthSource resource to delete.
423
+ # @param project [::String]
424
+ # Project ID for this request.
425
+ # @param region [::String]
426
+ # Name of the region scoping this request.
427
+ # @param request_id [::String]
428
+ # An optional request ID to identify requests. Specify a unique request ID so
429
+ # that if you must retry your request, the server will know to ignore the
430
+ # request if it has already been completed.
431
+ #
432
+ # For example, consider a situation where you make an initial request and
433
+ # the request times out. If you make the request again with the same
434
+ # request ID, the server can check if original operation with the same
435
+ # request ID was received, and if so, will ignore the second request. This
436
+ # prevents clients from accidentally creating duplicate commitments.
437
+ #
438
+ # The request ID must be
439
+ # a valid UUID with the exception that zero UUID is not supported
440
+ # (00000000-0000-0000-0000-000000000000).
441
+ # @yield [result, operation] Access the result along with the TransportOperation object
442
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
443
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
444
+ #
445
+ # @return [::Gapic::GenericLRO::Operation]
446
+ #
447
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
448
+ #
449
+ # @example Basic example
450
+ # require "google/cloud/compute/v1"
451
+ #
452
+ # # Create a client object. The client can be reused for multiple calls.
453
+ # client = Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client.new
454
+ #
455
+ # # Create a request. To set request fields, pass in keyword arguments.
456
+ # request = Google::Cloud::Compute::V1::DeleteRegionHealthSourceRequest.new
457
+ #
458
+ # # Call the delete method.
459
+ # result = client.delete request
460
+ #
461
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
462
+ # p result
463
+ #
464
+ def delete request, options = nil
465
+ raise ::ArgumentError, "request must be provided" if request.nil?
466
+
467
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::DeleteRegionHealthSourceRequest
468
+
469
+ # Converts hash and nil to an options object
470
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
471
+
472
+ # Customize the options with defaults
473
+ call_metadata = @config.rpcs.delete.metadata.to_h
474
+
475
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
476
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
477
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
478
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
479
+ transports_version_send: [:rest]
480
+
481
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
482
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
483
+
484
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
485
+ metadata: call_metadata,
486
+ retry_policy: @config.rpcs.delete.retry_policy
487
+
488
+ options.apply_defaults timeout: @config.timeout,
489
+ metadata: @config.metadata,
490
+ retry_policy: @config.retry_policy
491
+
492
+ @region_health_sources_stub.delete request, options do |result, response|
493
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
494
+ operation: result,
495
+ client: region_operations,
496
+ request_values: {
497
+ "project" => request.project,
498
+ "region" => request.region
499
+ },
500
+ options: options
501
+ )
502
+ yield result, response if block_given?
503
+ throw :response, result
504
+ end
505
+ rescue ::Gapic::Rest::Error => e
506
+ raise ::Google::Cloud::Error.from_error(e)
507
+ end
508
+
509
+ ##
510
+ # Returns the specified HealthSource resource in the given region.
511
+ #
512
+ # @overload get(request, options = nil)
513
+ # Pass arguments to `get` via a request object, either of type
514
+ # {::Google::Cloud::Compute::V1::GetRegionHealthSourceRequest} or an equivalent Hash.
515
+ #
516
+ # @param request [::Google::Cloud::Compute::V1::GetRegionHealthSourceRequest, ::Hash]
517
+ # A request object representing the call parameters. Required. To specify no
518
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
519
+ # @param options [::Gapic::CallOptions, ::Hash]
520
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
521
+ #
522
+ # @overload get(health_source: nil, project: nil, region: nil)
523
+ # Pass arguments to `get` via keyword arguments. Note that at
524
+ # least one keyword argument is required. To specify no parameters, or to keep all
525
+ # the default parameter values, pass an empty Hash as a request object (see above).
526
+ #
527
+ # @param health_source [::String]
528
+ # Name of the HealthSource resource to return.
529
+ # @param project [::String]
530
+ # Project ID for this request.
531
+ # @param region [::String]
532
+ # Name of the region scoping this request.
533
+ # @yield [result, operation] Access the result along with the TransportOperation object
534
+ # @yieldparam result [::Google::Cloud::Compute::V1::HealthSource]
535
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
536
+ #
537
+ # @return [::Google::Cloud::Compute::V1::HealthSource]
538
+ #
539
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
540
+ #
541
+ # @example Basic example
542
+ # require "google/cloud/compute/v1"
543
+ #
544
+ # # Create a client object. The client can be reused for multiple calls.
545
+ # client = Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client.new
546
+ #
547
+ # # Create a request. To set request fields, pass in keyword arguments.
548
+ # request = Google::Cloud::Compute::V1::GetRegionHealthSourceRequest.new
549
+ #
550
+ # # Call the get method.
551
+ # result = client.get request
552
+ #
553
+ # # The returned object is of type Google::Cloud::Compute::V1::HealthSource.
554
+ # p result
555
+ #
556
+ def get request, options = nil
557
+ raise ::ArgumentError, "request must be provided" if request.nil?
558
+
559
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetRegionHealthSourceRequest
560
+
561
+ # Converts hash and nil to an options object
562
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
563
+
564
+ # Customize the options with defaults
565
+ call_metadata = @config.rpcs.get.metadata.to_h
566
+
567
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
568
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
569
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
570
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
571
+ transports_version_send: [:rest]
572
+
573
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
574
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
575
+
576
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
577
+ metadata: call_metadata,
578
+ retry_policy: @config.rpcs.get.retry_policy
579
+
580
+ options.apply_defaults timeout: @config.timeout,
581
+ metadata: @config.metadata,
582
+ retry_policy: @config.retry_policy
583
+
584
+ @region_health_sources_stub.get request, options do |result, operation|
585
+ yield result, operation if block_given?
586
+ end
587
+ rescue ::Gapic::Rest::Error => e
588
+ raise ::Google::Cloud::Error.from_error(e)
589
+ end
590
+
591
+ ##
592
+ # Gets the most recent health check results for this
593
+ # regional HealthSource.
594
+ #
595
+ # @overload get_health(request, options = nil)
596
+ # Pass arguments to `get_health` via a request object, either of type
597
+ # {::Google::Cloud::Compute::V1::GetHealthRegionHealthSourceRequest} or an equivalent Hash.
598
+ #
599
+ # @param request [::Google::Cloud::Compute::V1::GetHealthRegionHealthSourceRequest, ::Hash]
600
+ # A request object representing the call parameters. Required. To specify no
601
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
602
+ # @param options [::Gapic::CallOptions, ::Hash]
603
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
604
+ #
605
+ # @overload get_health(health_source: nil, project: nil, region: nil)
606
+ # Pass arguments to `get_health` via keyword arguments. Note that at
607
+ # least one keyword argument is required. To specify no parameters, or to keep all
608
+ # the default parameter values, pass an empty Hash as a request object (see above).
609
+ #
610
+ # @param health_source [::String]
611
+ # Name of the HealthSource resource to get health for.
612
+ # @param project [::String]
613
+ # Name of the project scoping this request.
614
+ # @param region [::String]
615
+ # Name of the region scoping this request.
616
+ # @yield [result, operation] Access the result along with the TransportOperation object
617
+ # @yieldparam result [::Google::Cloud::Compute::V1::HealthSourceHealth]
618
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
619
+ #
620
+ # @return [::Google::Cloud::Compute::V1::HealthSourceHealth]
621
+ #
622
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
623
+ #
624
+ # @example Basic example
625
+ # require "google/cloud/compute/v1"
626
+ #
627
+ # # Create a client object. The client can be reused for multiple calls.
628
+ # client = Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client.new
629
+ #
630
+ # # Create a request. To set request fields, pass in keyword arguments.
631
+ # request = Google::Cloud::Compute::V1::GetHealthRegionHealthSourceRequest.new
632
+ #
633
+ # # Call the get_health method.
634
+ # result = client.get_health request
635
+ #
636
+ # # The returned object is of type Google::Cloud::Compute::V1::HealthSourceHealth.
637
+ # p result
638
+ #
639
+ def get_health request, options = nil
640
+ raise ::ArgumentError, "request must be provided" if request.nil?
641
+
642
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetHealthRegionHealthSourceRequest
643
+
644
+ # Converts hash and nil to an options object
645
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
646
+
647
+ # Customize the options with defaults
648
+ call_metadata = @config.rpcs.get_health.metadata.to_h
649
+
650
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
651
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
652
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
653
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
654
+ transports_version_send: [:rest]
655
+
656
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
657
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
658
+
659
+ options.apply_defaults timeout: @config.rpcs.get_health.timeout,
660
+ metadata: call_metadata,
661
+ retry_policy: @config.rpcs.get_health.retry_policy
662
+
663
+ options.apply_defaults timeout: @config.timeout,
664
+ metadata: @config.metadata,
665
+ retry_policy: @config.retry_policy
666
+
667
+ @region_health_sources_stub.get_health request, options do |result, operation|
668
+ yield result, operation if block_given?
669
+ end
670
+ rescue ::Gapic::Rest::Error => e
671
+ raise ::Google::Cloud::Error.from_error(e)
672
+ end
673
+
674
+ ##
675
+ # Create a HealthSource in the specified project in the given region
676
+ # using the parameters that are included in the request.
677
+ #
678
+ # @overload insert(request, options = nil)
679
+ # Pass arguments to `insert` via a request object, either of type
680
+ # {::Google::Cloud::Compute::V1::InsertRegionHealthSourceRequest} or an equivalent Hash.
681
+ #
682
+ # @param request [::Google::Cloud::Compute::V1::InsertRegionHealthSourceRequest, ::Hash]
683
+ # A request object representing the call parameters. Required. To specify no
684
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
685
+ # @param options [::Gapic::CallOptions, ::Hash]
686
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
687
+ #
688
+ # @overload insert(health_source_resource: nil, project: nil, region: nil, request_id: nil)
689
+ # Pass arguments to `insert` via keyword arguments. Note that at
690
+ # least one keyword argument is required. To specify no parameters, or to keep all
691
+ # the default parameter values, pass an empty Hash as a request object (see above).
692
+ #
693
+ # @param health_source_resource [::Google::Cloud::Compute::V1::HealthSource, ::Hash]
694
+ # The body resource for this request
695
+ # @param project [::String]
696
+ # Project ID for this request.
697
+ # @param region [::String]
698
+ # Name of the region scoping this request.
699
+ # @param request_id [::String]
700
+ # An optional request ID to identify requests. Specify a unique request ID so
701
+ # that if you must retry your request, the server will know to ignore the
702
+ # request if it has already been completed.
703
+ #
704
+ # For example, consider a situation where you make an initial request and
705
+ # the request times out. If you make the request again with the same
706
+ # request ID, the server can check if original operation with the same
707
+ # request ID was received, and if so, will ignore the second request. This
708
+ # prevents clients from accidentally creating duplicate commitments.
709
+ #
710
+ # The request ID must be
711
+ # a valid UUID with the exception that zero UUID is not supported
712
+ # (00000000-0000-0000-0000-000000000000).
713
+ # @yield [result, operation] Access the result along with the TransportOperation object
714
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
715
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
716
+ #
717
+ # @return [::Gapic::GenericLRO::Operation]
718
+ #
719
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
720
+ #
721
+ # @example Basic example
722
+ # require "google/cloud/compute/v1"
723
+ #
724
+ # # Create a client object. The client can be reused for multiple calls.
725
+ # client = Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client.new
726
+ #
727
+ # # Create a request. To set request fields, pass in keyword arguments.
728
+ # request = Google::Cloud::Compute::V1::InsertRegionHealthSourceRequest.new
729
+ #
730
+ # # Call the insert method.
731
+ # result = client.insert request
732
+ #
733
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
734
+ # p result
735
+ #
736
+ def insert request, options = nil
737
+ raise ::ArgumentError, "request must be provided" if request.nil?
738
+
739
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::InsertRegionHealthSourceRequest
740
+
741
+ # Converts hash and nil to an options object
742
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
743
+
744
+ # Customize the options with defaults
745
+ call_metadata = @config.rpcs.insert.metadata.to_h
746
+
747
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
748
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
749
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
750
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
751
+ transports_version_send: [:rest]
752
+
753
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
754
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
755
+
756
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
757
+ metadata: call_metadata,
758
+ retry_policy: @config.rpcs.insert.retry_policy
759
+
760
+ options.apply_defaults timeout: @config.timeout,
761
+ metadata: @config.metadata,
762
+ retry_policy: @config.retry_policy
763
+
764
+ @region_health_sources_stub.insert request, options do |result, response|
765
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
766
+ operation: result,
767
+ client: region_operations,
768
+ request_values: {
769
+ "project" => request.project,
770
+ "region" => request.region
771
+ },
772
+ options: options
773
+ )
774
+ yield result, response if block_given?
775
+ throw :response, result
776
+ end
777
+ rescue ::Gapic::Rest::Error => e
778
+ raise ::Google::Cloud::Error.from_error(e)
779
+ end
780
+
781
+ ##
782
+ # Lists the HealthSources for a project in the given region.
783
+ #
784
+ # @overload list(request, options = nil)
785
+ # Pass arguments to `list` via a request object, either of type
786
+ # {::Google::Cloud::Compute::V1::ListRegionHealthSourcesRequest} or an equivalent Hash.
787
+ #
788
+ # @param request [::Google::Cloud::Compute::V1::ListRegionHealthSourcesRequest, ::Hash]
789
+ # A request object representing the call parameters. Required. To specify no
790
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
791
+ # @param options [::Gapic::CallOptions, ::Hash]
792
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
793
+ #
794
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, project: nil, region: nil, return_partial_success: nil)
795
+ # Pass arguments to `list` via keyword arguments. Note that at
796
+ # least one keyword argument is required. To specify no parameters, or to keep all
797
+ # the default parameter values, pass an empty Hash as a request object (see above).
798
+ #
799
+ # @param filter [::String]
800
+ # A filter expression that filters resources listed in the response. Most
801
+ # Compute resources support two types of filter expressions:
802
+ # expressions that support regular expressions and expressions that follow
803
+ # API improvement proposal AIP-160.
804
+ # These two types of filter expressions cannot be mixed in one request.
805
+ #
806
+ # If you want to use AIP-160, your expression must specify the field name, an
807
+ # operator, and the value that you want to use for filtering. The value
808
+ # must be a string, a number, or a boolean. The operator
809
+ # must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`.
810
+ #
811
+ # For example, if you are filtering Compute Engine instances, you can
812
+ # exclude instances named `example-instance` by specifying
813
+ # `name != example-instance`.
814
+ #
815
+ # The `:*` comparison can be used to test whether a key has been defined.
816
+ # For example, to find all objects with `owner` label use:
817
+ # ```
818
+ # labels.owner:*
819
+ # ```
820
+ #
821
+ # You can also filter nested fields. For example, you could specify
822
+ # `scheduling.automaticRestart = false` to include instances only
823
+ # if they are not scheduled for automatic restarts. You can use filtering
824
+ # on nested fields to filter based onresource labels.
825
+ #
826
+ # To filter on multiple expressions, provide each separate expression within
827
+ # parentheses. For example:
828
+ # ```
829
+ # (scheduling.automaticRestart = true)
830
+ # (cpuPlatform = "Intel Skylake")
831
+ # ```
832
+ # By default, each expression is an `AND` expression. However, you
833
+ # can include `AND` and `OR` expressions explicitly.
834
+ # For example:
835
+ # ```
836
+ # (cpuPlatform = "Intel Skylake") OR
837
+ # (cpuPlatform = "Intel Broadwell") AND
838
+ # (scheduling.automaticRestart = true)
839
+ # ```
840
+ #
841
+ # If you want to use a regular expression, use the `eq` (equal) or `ne`
842
+ # (not equal) operator against a single un-parenthesized expression with or
843
+ # without quotes or against multiple parenthesized expressions. Examples:
844
+ #
845
+ # `fieldname eq unquoted literal`
846
+ # `fieldname eq 'single quoted literal'`
847
+ # `fieldname eq "double quoted literal"`
848
+ # `(fieldname1 eq literal) (fieldname2 ne "literal")`
849
+ #
850
+ # The literal value is interpreted as a regular expression using GoogleRE2 library syntax.
851
+ # The literal value must match the entire field.
852
+ #
853
+ # For example, to filter for instances that do not end with name "instance",
854
+ # you would use `name ne .*instance`.
855
+ #
856
+ # You cannot combine constraints on multiple fields using regular
857
+ # expressions.
858
+ # @param max_results [::Integer]
859
+ # The maximum number of results per page that should be returned.
860
+ # If the number of available results is larger than `maxResults`,
861
+ # Compute Engine returns a `nextPageToken` that can be used to get
862
+ # the next page of results in subsequent list requests. Acceptable values are
863
+ # `0` to `500`, inclusive. (Default: `500`)
864
+ # @param order_by [::String]
865
+ # Sorts list results by a certain order. By default, results
866
+ # are returned in alphanumerical order based on the resource name.
867
+ #
868
+ # You can also sort results in descending order based on the creation
869
+ # timestamp using `orderBy="creationTimestamp desc"`. This sorts
870
+ # results based on the `creationTimestamp` field in
871
+ # reverse chronological order (newest result first). Use this to sort
872
+ # resources like operations so that the newest operation is returned first.
873
+ #
874
+ # Currently, only sorting by `name` or
875
+ # `creationTimestamp desc` is supported.
876
+ # @param page_token [::String]
877
+ # Specifies a page token to use. Set `pageToken` to the
878
+ # `nextPageToken` returned by a previous list request to get
879
+ # the next page of results.
880
+ # @param project [::String]
881
+ # Project ID for this request.
882
+ # @param region [::String]
883
+ # Name of the region scoping this request.
884
+ # @param return_partial_success [::Boolean]
885
+ # Opt-in for partial success behavior which provides partial results in case
886
+ # of failure. The default value is false.
887
+ #
888
+ # For example, when partial success behavior is enabled, aggregatedList for a
889
+ # single zone scope either returns all resources in the zone or no resources,
890
+ # with an error code.
891
+ # @yield [result, operation] Access the result along with the TransportOperation object
892
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::HealthSource>]
893
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
894
+ #
895
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::HealthSource>]
896
+ #
897
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
898
+ #
899
+ # @example Basic example
900
+ # require "google/cloud/compute/v1"
901
+ #
902
+ # # Create a client object. The client can be reused for multiple calls.
903
+ # client = Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client.new
904
+ #
905
+ # # Create a request. To set request fields, pass in keyword arguments.
906
+ # request = Google::Cloud::Compute::V1::ListRegionHealthSourcesRequest.new
907
+ #
908
+ # # Call the list method.
909
+ # result = client.list request
910
+ #
911
+ # # The returned object is of type Google::Cloud::Compute::V1::HealthSourceList.
912
+ # p result
913
+ #
914
+ def list request, options = nil
915
+ raise ::ArgumentError, "request must be provided" if request.nil?
916
+
917
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListRegionHealthSourcesRequest
918
+
919
+ # Converts hash and nil to an options object
920
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
921
+
922
+ # Customize the options with defaults
923
+ call_metadata = @config.rpcs.list.metadata.to_h
924
+
925
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
926
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
927
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
928
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
929
+ transports_version_send: [:rest]
930
+
931
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
932
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
933
+
934
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
935
+ metadata: call_metadata,
936
+ retry_policy: @config.rpcs.list.retry_policy
937
+
938
+ options.apply_defaults timeout: @config.timeout,
939
+ metadata: @config.metadata,
940
+ retry_policy: @config.retry_policy
941
+
942
+ @region_health_sources_stub.list request, options do |result, operation|
943
+ result = ::Gapic::Rest::PagedEnumerable.new @region_health_sources_stub, :list, "items", request, result, options
944
+ yield result, operation if block_given?
945
+ throw :response, result
946
+ end
947
+ rescue ::Gapic::Rest::Error => e
948
+ raise ::Google::Cloud::Error.from_error(e)
949
+ end
950
+
951
+ ##
952
+ # Updates the specified regional HealthSource resource
953
+ # with the data included in the request. This method supportsPATCH
954
+ # semantics and uses theJSON merge
955
+ # patch format and processing rules.
956
+ #
957
+ # @overload patch(request, options = nil)
958
+ # Pass arguments to `patch` via a request object, either of type
959
+ # {::Google::Cloud::Compute::V1::PatchRegionHealthSourceRequest} or an equivalent Hash.
960
+ #
961
+ # @param request [::Google::Cloud::Compute::V1::PatchRegionHealthSourceRequest, ::Hash]
962
+ # A request object representing the call parameters. Required. To specify no
963
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
964
+ # @param options [::Gapic::CallOptions, ::Hash]
965
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
966
+ #
967
+ # @overload patch(health_source: nil, health_source_resource: nil, project: nil, region: nil, request_id: nil)
968
+ # Pass arguments to `patch` via keyword arguments. Note that at
969
+ # least one keyword argument is required. To specify no parameters, or to keep all
970
+ # the default parameter values, pass an empty Hash as a request object (see above).
971
+ #
972
+ # @param health_source [::String]
973
+ # Name of the HealthSource to update. The name
974
+ # must be 1-63 characters long, and comply with RFC1035.
975
+ # @param health_source_resource [::Google::Cloud::Compute::V1::HealthSource, ::Hash]
976
+ # The body resource for this request
977
+ # @param project [::String]
978
+ # Project ID for this request.
979
+ # @param region [::String]
980
+ # Name of the region scoping this request.
981
+ # @param request_id [::String]
982
+ # An optional request ID to identify requests. Specify a unique request ID so
983
+ # that if you must retry your request, the server will know to ignore the
984
+ # request if it has already been completed.
985
+ #
986
+ # For example, consider a situation where you make an initial request and
987
+ # the request times out. If you make the request again with the same
988
+ # request ID, the server can check if original operation with the same
989
+ # request ID was received, and if so, will ignore the second request. This
990
+ # prevents clients from accidentally creating duplicate commitments.
991
+ #
992
+ # The request ID must be
993
+ # a valid UUID with the exception that zero UUID is not supported
994
+ # (00000000-0000-0000-0000-000000000000).
995
+ # @yield [result, operation] Access the result along with the TransportOperation object
996
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
997
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
998
+ #
999
+ # @return [::Gapic::GenericLRO::Operation]
1000
+ #
1001
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1002
+ #
1003
+ # @example Basic example
1004
+ # require "google/cloud/compute/v1"
1005
+ #
1006
+ # # Create a client object. The client can be reused for multiple calls.
1007
+ # client = Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client.new
1008
+ #
1009
+ # # Create a request. To set request fields, pass in keyword arguments.
1010
+ # request = Google::Cloud::Compute::V1::PatchRegionHealthSourceRequest.new
1011
+ #
1012
+ # # Call the patch method.
1013
+ # result = client.patch request
1014
+ #
1015
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
1016
+ # p result
1017
+ #
1018
+ def patch request, options = nil
1019
+ raise ::ArgumentError, "request must be provided" if request.nil?
1020
+
1021
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchRegionHealthSourceRequest
1022
+
1023
+ # Converts hash and nil to an options object
1024
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1025
+
1026
+ # Customize the options with defaults
1027
+ call_metadata = @config.rpcs.patch.metadata.to_h
1028
+
1029
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1030
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1031
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1032
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1033
+ transports_version_send: [:rest]
1034
+
1035
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1036
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1037
+
1038
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
1039
+ metadata: call_metadata,
1040
+ retry_policy: @config.rpcs.patch.retry_policy
1041
+
1042
+ options.apply_defaults timeout: @config.timeout,
1043
+ metadata: @config.metadata,
1044
+ retry_policy: @config.retry_policy
1045
+
1046
+ @region_health_sources_stub.patch request, options do |result, response|
1047
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
1048
+ operation: result,
1049
+ client: region_operations,
1050
+ request_values: {
1051
+ "project" => request.project,
1052
+ "region" => request.region
1053
+ },
1054
+ options: options
1055
+ )
1056
+ yield result, response if block_given?
1057
+ throw :response, result
1058
+ end
1059
+ rescue ::Gapic::Rest::Error => e
1060
+ raise ::Google::Cloud::Error.from_error(e)
1061
+ end
1062
+
1063
+ ##
1064
+ # Returns permissions that a caller has on the specified resource.
1065
+ #
1066
+ # @overload test_iam_permissions(request, options = nil)
1067
+ # Pass arguments to `test_iam_permissions` via a request object, either of type
1068
+ # {::Google::Cloud::Compute::V1::TestIamPermissionsRegionHealthSourceRequest} or an equivalent Hash.
1069
+ #
1070
+ # @param request [::Google::Cloud::Compute::V1::TestIamPermissionsRegionHealthSourceRequest, ::Hash]
1071
+ # A request object representing the call parameters. Required. To specify no
1072
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1073
+ # @param options [::Gapic::CallOptions, ::Hash]
1074
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1075
+ #
1076
+ # @overload test_iam_permissions(project: nil, region: nil, resource: nil, test_permissions_request_resource: nil)
1077
+ # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at
1078
+ # least one keyword argument is required. To specify no parameters, or to keep all
1079
+ # the default parameter values, pass an empty Hash as a request object (see above).
1080
+ #
1081
+ # @param project [::String]
1082
+ # Project ID for this request.
1083
+ # @param region [::String]
1084
+ # The name of the region for this request.
1085
+ # @param resource [::String]
1086
+ # Name or id of the resource for this request.
1087
+ # @param test_permissions_request_resource [::Google::Cloud::Compute::V1::TestPermissionsRequest, ::Hash]
1088
+ # The body resource for this request
1089
+ # @yield [result, operation] Access the result along with the TransportOperation object
1090
+ # @yieldparam result [::Google::Cloud::Compute::V1::TestPermissionsResponse]
1091
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1092
+ #
1093
+ # @return [::Google::Cloud::Compute::V1::TestPermissionsResponse]
1094
+ #
1095
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1096
+ #
1097
+ # @example Basic example
1098
+ # require "google/cloud/compute/v1"
1099
+ #
1100
+ # # Create a client object. The client can be reused for multiple calls.
1101
+ # client = Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client.new
1102
+ #
1103
+ # # Create a request. To set request fields, pass in keyword arguments.
1104
+ # request = Google::Cloud::Compute::V1::TestIamPermissionsRegionHealthSourceRequest.new
1105
+ #
1106
+ # # Call the test_iam_permissions method.
1107
+ # result = client.test_iam_permissions request
1108
+ #
1109
+ # # The returned object is of type Google::Cloud::Compute::V1::TestPermissionsResponse.
1110
+ # p result
1111
+ #
1112
+ def test_iam_permissions request, options = nil
1113
+ raise ::ArgumentError, "request must be provided" if request.nil?
1114
+
1115
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::TestIamPermissionsRegionHealthSourceRequest
1116
+
1117
+ # Converts hash and nil to an options object
1118
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1119
+
1120
+ # Customize the options with defaults
1121
+ call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h
1122
+
1123
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1124
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1125
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1126
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
1127
+ transports_version_send: [:rest]
1128
+
1129
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1130
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1131
+
1132
+ options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
1133
+ metadata: call_metadata,
1134
+ retry_policy: @config.rpcs.test_iam_permissions.retry_policy
1135
+
1136
+ options.apply_defaults timeout: @config.timeout,
1137
+ metadata: @config.metadata,
1138
+ retry_policy: @config.retry_policy
1139
+
1140
+ @region_health_sources_stub.test_iam_permissions request, options do |result, operation|
1141
+ yield result, operation if block_given?
1142
+ end
1143
+ rescue ::Gapic::Rest::Error => e
1144
+ raise ::Google::Cloud::Error.from_error(e)
1145
+ end
1146
+
1147
+ ##
1148
+ # Configuration class for the RegionHealthSources REST API.
1149
+ #
1150
+ # This class represents the configuration for RegionHealthSources REST,
1151
+ # providing control over timeouts, retry behavior, logging, transport
1152
+ # parameters, and other low-level controls. Certain parameters can also be
1153
+ # applied individually to specific RPCs. See
1154
+ # {::Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client::Configuration::Rpcs}
1155
+ # for a list of RPCs that can be configured independently.
1156
+ #
1157
+ # Configuration can be applied globally to all clients, or to a single client
1158
+ # on construction.
1159
+ #
1160
+ # @example
1161
+ #
1162
+ # # Modify the global config, setting the timeout for
1163
+ # # aggregated_list to 20 seconds,
1164
+ # # and all remaining timeouts to 10 seconds.
1165
+ # ::Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client.configure do |config|
1166
+ # config.timeout = 10.0
1167
+ # config.rpcs.aggregated_list.timeout = 20.0
1168
+ # end
1169
+ #
1170
+ # # Apply the above configuration only to a new client.
1171
+ # client = ::Google::Cloud::Compute::V1::RegionHealthSources::Rest::Client.new do |config|
1172
+ # config.timeout = 10.0
1173
+ # config.rpcs.aggregated_list.timeout = 20.0
1174
+ # end
1175
+ #
1176
+ # @!attribute [rw] endpoint
1177
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1178
+ # nil, indicating to use the default endpoint in the current universe domain.
1179
+ # @return [::String,nil]
1180
+ # @!attribute [rw] credentials
1181
+ # Credentials to send with calls. You may provide any of the following types:
1182
+ # * (`String`) The path to a service account key file in JSON format
1183
+ # * (`Hash`) A service account key as a Hash
1184
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1185
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1186
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1187
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1188
+ # * (`nil`) indicating no credentials
1189
+ #
1190
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1191
+ # external source for authentication to Google Cloud, you must validate it before
1192
+ # providing it to a Google API client library. Providing an unvalidated credential
1193
+ # configuration to Google APIs can compromise the security of your systems and data.
1194
+ # For more information, refer to [Validate credential configurations from external
1195
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1196
+ # @return [::Object]
1197
+ # @!attribute [rw] scope
1198
+ # The OAuth scopes
1199
+ # @return [::Array<::String>]
1200
+ # @!attribute [rw] lib_name
1201
+ # The library name as recorded in instrumentation and logging
1202
+ # @return [::String]
1203
+ # @!attribute [rw] lib_version
1204
+ # The library version as recorded in instrumentation and logging
1205
+ # @return [::String]
1206
+ # @!attribute [rw] timeout
1207
+ # The call timeout in seconds.
1208
+ # @return [::Numeric]
1209
+ # @!attribute [rw] metadata
1210
+ # Additional headers to be sent with the call.
1211
+ # @return [::Hash{::Symbol=>::String}]
1212
+ # @!attribute [rw] retry_policy
1213
+ # The retry policy. The value is a hash with the following keys:
1214
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1215
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1216
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1217
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1218
+ # trigger a retry.
1219
+ # @return [::Hash]
1220
+ # @!attribute [rw] quota_project
1221
+ # A separate project against which to charge quota.
1222
+ # @return [::String]
1223
+ # @!attribute [rw] universe_domain
1224
+ # The universe domain within which to make requests. This determines the
1225
+ # default endpoint URL. The default value of nil uses the environment
1226
+ # universe (usually the default "googleapis.com" universe).
1227
+ # @return [::String,nil]
1228
+ # @!attribute [rw] logger
1229
+ # A custom logger to use for request/response debug logging, or the value
1230
+ # `:default` (the default) to construct a default logger, or `nil` to
1231
+ # explicitly disable logging.
1232
+ # @return [::Logger,:default,nil]
1233
+ #
1234
+ class Configuration
1235
+ extend ::Gapic::Config
1236
+
1237
+ # @private
1238
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1239
+ DEFAULT_ENDPOINT = "compute.googleapis.com"
1240
+
1241
+ config_attr :endpoint, nil, ::String, nil
1242
+ config_attr :credentials, nil do |value|
1243
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1244
+ allowed.any? { |klass| klass === value }
1245
+ end
1246
+ config_attr :scope, nil, ::String, ::Array, nil
1247
+ config_attr :lib_name, nil, ::String, nil
1248
+ config_attr :lib_version, nil, ::String, nil
1249
+ config_attr :timeout, nil, ::Numeric, nil
1250
+ config_attr :metadata, nil, ::Hash, nil
1251
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1252
+ config_attr :quota_project, nil, ::String, nil
1253
+ config_attr :universe_domain, nil, ::String, nil
1254
+ config_attr :logger, :default, ::Logger, nil, :default
1255
+
1256
+ # @private
1257
+ def initialize parent_config = nil
1258
+ @parent_config = parent_config unless parent_config.nil?
1259
+
1260
+ yield self if block_given?
1261
+ end
1262
+
1263
+ ##
1264
+ # Configurations for individual RPCs
1265
+ # @return [Rpcs]
1266
+ #
1267
+ def rpcs
1268
+ @rpcs ||= begin
1269
+ parent_rpcs = nil
1270
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1271
+ Rpcs.new parent_rpcs
1272
+ end
1273
+ end
1274
+
1275
+ ##
1276
+ # Configuration RPC class for the RegionHealthSources API.
1277
+ #
1278
+ # Includes fields providing the configuration for each RPC in this service.
1279
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1280
+ # the following configuration fields:
1281
+ #
1282
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1283
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1284
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1285
+ # include the following keys:
1286
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1287
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1288
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1289
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1290
+ # trigger a retry.
1291
+ #
1292
+ class Rpcs
1293
+ ##
1294
+ # RPC-specific configuration for `aggregated_list`
1295
+ # @return [::Gapic::Config::Method]
1296
+ #
1297
+ attr_reader :aggregated_list
1298
+ ##
1299
+ # RPC-specific configuration for `delete`
1300
+ # @return [::Gapic::Config::Method]
1301
+ #
1302
+ attr_reader :delete
1303
+ ##
1304
+ # RPC-specific configuration for `get`
1305
+ # @return [::Gapic::Config::Method]
1306
+ #
1307
+ attr_reader :get
1308
+ ##
1309
+ # RPC-specific configuration for `get_health`
1310
+ # @return [::Gapic::Config::Method]
1311
+ #
1312
+ attr_reader :get_health
1313
+ ##
1314
+ # RPC-specific configuration for `insert`
1315
+ # @return [::Gapic::Config::Method]
1316
+ #
1317
+ attr_reader :insert
1318
+ ##
1319
+ # RPC-specific configuration for `list`
1320
+ # @return [::Gapic::Config::Method]
1321
+ #
1322
+ attr_reader :list
1323
+ ##
1324
+ # RPC-specific configuration for `patch`
1325
+ # @return [::Gapic::Config::Method]
1326
+ #
1327
+ attr_reader :patch
1328
+ ##
1329
+ # RPC-specific configuration for `test_iam_permissions`
1330
+ # @return [::Gapic::Config::Method]
1331
+ #
1332
+ attr_reader :test_iam_permissions
1333
+
1334
+ # @private
1335
+ def initialize parent_rpcs = nil
1336
+ aggregated_list_config = parent_rpcs.aggregated_list if parent_rpcs.respond_to? :aggregated_list
1337
+ @aggregated_list = ::Gapic::Config::Method.new aggregated_list_config
1338
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
1339
+ @delete = ::Gapic::Config::Method.new delete_config
1340
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
1341
+ @get = ::Gapic::Config::Method.new get_config
1342
+ get_health_config = parent_rpcs.get_health if parent_rpcs.respond_to? :get_health
1343
+ @get_health = ::Gapic::Config::Method.new get_health_config
1344
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
1345
+ @insert = ::Gapic::Config::Method.new insert_config
1346
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
1347
+ @list = ::Gapic::Config::Method.new list_config
1348
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
1349
+ @patch = ::Gapic::Config::Method.new patch_config
1350
+ test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
1351
+ @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
1352
+
1353
+ yield self if block_given?
1354
+ end
1355
+ end
1356
+ end
1357
+ end
1358
+ end
1359
+ end
1360
+ end
1361
+ end
1362
+ end
1363
+ end