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,561 @@
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_snapshot_settings/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 RegionSnapshotSettings
29
+ module Rest
30
+ ##
31
+ # REST client for the RegionSnapshotSettings service.
32
+ #
33
+ # The RegionSnapshotSettings 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_snapshot_settings_stub
44
+
45
+ ##
46
+ # Configure the RegionSnapshotSettings Client class.
47
+ #
48
+ # See {::Google::Cloud::Compute::V1::RegionSnapshotSettings::Rest::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all RegionSnapshotSettings clients
54
+ # ::Google::Cloud::Compute::V1::RegionSnapshotSettings::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.get.timeout = 600.0
75
+ default_config.rpcs.get.retry_policy = {
76
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
77
+ }
78
+
79
+ default_config.rpcs.patch.timeout = 600.0
80
+
81
+ default_config
82
+ end
83
+ yield @configure if block_given?
84
+ @configure
85
+ end
86
+
87
+ ##
88
+ # Configure the RegionSnapshotSettings Client instance.
89
+ #
90
+ # The configuration is set to the derived mode, meaning that values can be changed,
91
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
92
+ # should be made on {Client.configure}.
93
+ #
94
+ # See {::Google::Cloud::Compute::V1::RegionSnapshotSettings::Rest::Client::Configuration}
95
+ # for a description of the configuration fields.
96
+ #
97
+ # @yield [config] Configure the Client client.
98
+ # @yieldparam config [Client::Configuration]
99
+ #
100
+ # @return [Client::Configuration]
101
+ #
102
+ def configure
103
+ yield @config if block_given?
104
+ @config
105
+ end
106
+
107
+ ##
108
+ # The effective universe domain
109
+ #
110
+ # @return [String]
111
+ #
112
+ def universe_domain
113
+ @region_snapshot_settings_stub.universe_domain
114
+ end
115
+
116
+ ##
117
+ # Create a new RegionSnapshotSettings REST client object.
118
+ #
119
+ # @example
120
+ #
121
+ # # Create a client using the default configuration
122
+ # client = ::Google::Cloud::Compute::V1::RegionSnapshotSettings::Rest::Client.new
123
+ #
124
+ # # Create a client using a custom configuration
125
+ # client = ::Google::Cloud::Compute::V1::RegionSnapshotSettings::Rest::Client.new do |config|
126
+ # config.timeout = 10.0
127
+ # end
128
+ #
129
+ # @yield [config] Configure the RegionSnapshotSettings client.
130
+ # @yieldparam config [Client::Configuration]
131
+ #
132
+ def initialize
133
+ # Create the configuration object
134
+ @config = Configuration.new Client.configure
135
+
136
+ # Yield the configuration if needed
137
+ yield @config if block_given?
138
+
139
+ # Create credentials
140
+ credentials = @config.credentials
141
+ # Use self-signed JWT if the endpoint is unchanged from default,
142
+ # but only if the default endpoint does not have a region prefix.
143
+ enable_self_signed_jwt = @config.endpoint.nil? ||
144
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
145
+ !@config.endpoint.split(".").first.include?("-"))
146
+ credentials ||= Credentials.default scope: @config.scope,
147
+ enable_self_signed_jwt: enable_self_signed_jwt
148
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
149
+ credentials = Credentials.new credentials, scope: @config.scope
150
+ end
151
+
152
+ @quota_project_id = @config.quota_project
153
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
154
+
155
+ @region_operations = ::Google::Cloud::Compute::V1::RegionOperations::Rest::Client.new do |config|
156
+ config.credentials = credentials
157
+ config.quota_project = @quota_project_id
158
+ config.endpoint = @config.endpoint
159
+ config.universe_domain = @config.universe_domain
160
+ end
161
+
162
+ @region_snapshot_settings_stub = ::Google::Cloud::Compute::V1::RegionSnapshotSettings::Rest::ServiceStub.new(
163
+ endpoint: @config.endpoint,
164
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
165
+ universe_domain: @config.universe_domain,
166
+ credentials: credentials,
167
+ logger: @config.logger
168
+ )
169
+
170
+ @region_snapshot_settings_stub.logger(stub: true)&.info do |entry|
171
+ entry.set_system_name
172
+ entry.set_service
173
+ entry.message = "Created client for #{entry.service}"
174
+ entry.set_credentials_fields credentials
175
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
176
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
177
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
178
+ end
179
+ end
180
+
181
+ ##
182
+ # Get the associated client for long-running operations via RegionOperations.
183
+ #
184
+ # @return [::Google::Cloud::Compute::V1::RegionOperations::Rest::Client]
185
+ #
186
+ attr_reader :region_operations
187
+
188
+ ##
189
+ # The logger used for request/response debug logging.
190
+ #
191
+ # @return [Logger]
192
+ #
193
+ def logger
194
+ @region_snapshot_settings_stub.logger
195
+ end
196
+
197
+ # Service calls
198
+
199
+ ##
200
+ # Get region snapshot settings.
201
+ #
202
+ # @overload get(request, options = nil)
203
+ # Pass arguments to `get` via a request object, either of type
204
+ # {::Google::Cloud::Compute::V1::GetRegionSnapshotSettingRequest} or an equivalent Hash.
205
+ #
206
+ # @param request [::Google::Cloud::Compute::V1::GetRegionSnapshotSettingRequest, ::Hash]
207
+ # A request object representing the call parameters. Required. To specify no
208
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
209
+ # @param options [::Gapic::CallOptions, ::Hash]
210
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
211
+ #
212
+ # @overload get(project: nil, region: nil)
213
+ # Pass arguments to `get` via keyword arguments. Note that at
214
+ # least one keyword argument is required. To specify no parameters, or to keep all
215
+ # the default parameter values, pass an empty Hash as a request object (see above).
216
+ #
217
+ # @param project [::String]
218
+ # Project ID for this request.
219
+ # @param region [::String]
220
+ # Name of the region for this request.
221
+ # @yield [result, operation] Access the result along with the TransportOperation object
222
+ # @yieldparam result [::Google::Cloud::Compute::V1::SnapshotSettings]
223
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
224
+ #
225
+ # @return [::Google::Cloud::Compute::V1::SnapshotSettings]
226
+ #
227
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
228
+ #
229
+ # @example Basic example
230
+ # require "google/cloud/compute/v1"
231
+ #
232
+ # # Create a client object. The client can be reused for multiple calls.
233
+ # client = Google::Cloud::Compute::V1::RegionSnapshotSettings::Rest::Client.new
234
+ #
235
+ # # Create a request. To set request fields, pass in keyword arguments.
236
+ # request = Google::Cloud::Compute::V1::GetRegionSnapshotSettingRequest.new
237
+ #
238
+ # # Call the get method.
239
+ # result = client.get request
240
+ #
241
+ # # The returned object is of type Google::Cloud::Compute::V1::SnapshotSettings.
242
+ # p result
243
+ #
244
+ def get request, options = nil
245
+ raise ::ArgumentError, "request must be provided" if request.nil?
246
+
247
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetRegionSnapshotSettingRequest
248
+
249
+ # Converts hash and nil to an options object
250
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
251
+
252
+ # Customize the options with defaults
253
+ call_metadata = @config.rpcs.get.metadata.to_h
254
+
255
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
256
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
257
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
258
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
259
+ transports_version_send: [:rest]
260
+
261
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
262
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
263
+
264
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
265
+ metadata: call_metadata,
266
+ retry_policy: @config.rpcs.get.retry_policy
267
+
268
+ options.apply_defaults timeout: @config.timeout,
269
+ metadata: @config.metadata,
270
+ retry_policy: @config.retry_policy
271
+
272
+ @region_snapshot_settings_stub.get request, options do |result, operation|
273
+ yield result, operation if block_given?
274
+ end
275
+ rescue ::Gapic::Rest::Error => e
276
+ raise ::Google::Cloud::Error.from_error(e)
277
+ end
278
+
279
+ ##
280
+ # Patch region snapshot settings.
281
+ #
282
+ # @overload patch(request, options = nil)
283
+ # Pass arguments to `patch` via a request object, either of type
284
+ # {::Google::Cloud::Compute::V1::PatchRegionSnapshotSettingRequest} or an equivalent Hash.
285
+ #
286
+ # @param request [::Google::Cloud::Compute::V1::PatchRegionSnapshotSettingRequest, ::Hash]
287
+ # A request object representing the call parameters. Required. To specify no
288
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
289
+ # @param options [::Gapic::CallOptions, ::Hash]
290
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
291
+ #
292
+ # @overload patch(project: nil, region: nil, request_id: nil, snapshot_settings_resource: nil, update_mask: nil)
293
+ # Pass arguments to `patch` via keyword arguments. Note that at
294
+ # least one keyword argument is required. To specify no parameters, or to keep all
295
+ # the default parameter values, pass an empty Hash as a request object (see above).
296
+ #
297
+ # @param project [::String]
298
+ # Project ID for this request.
299
+ # @param region [::String]
300
+ # Name of the region for this request.
301
+ # @param request_id [::String]
302
+ # An optional request ID to identify requests. Specify a unique request ID so
303
+ # that if you must retry your request, the server will know to ignore the
304
+ # request if it has already been completed.
305
+ #
306
+ # For example, consider a situation where you make an initial request and
307
+ # the request times out. If you make the request again with the same
308
+ # request ID, the server can check if original operation with the same
309
+ # request ID was received, and if so, will ignore the second request. This
310
+ # prevents clients from accidentally creating duplicate commitments.
311
+ #
312
+ # The request ID must be
313
+ # a valid UUID with the exception that zero UUID is not supported
314
+ # (00000000-0000-0000-0000-000000000000).
315
+ # @param snapshot_settings_resource [::Google::Cloud::Compute::V1::SnapshotSettings, ::Hash]
316
+ # The body resource for this request
317
+ # @param update_mask [::String]
318
+ # update_mask indicates fields to be updated as part of this request.
319
+ # @yield [result, operation] Access the result along with the TransportOperation object
320
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
321
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
322
+ #
323
+ # @return [::Gapic::GenericLRO::Operation]
324
+ #
325
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
326
+ #
327
+ # @example Basic example
328
+ # require "google/cloud/compute/v1"
329
+ #
330
+ # # Create a client object. The client can be reused for multiple calls.
331
+ # client = Google::Cloud::Compute::V1::RegionSnapshotSettings::Rest::Client.new
332
+ #
333
+ # # Create a request. To set request fields, pass in keyword arguments.
334
+ # request = Google::Cloud::Compute::V1::PatchRegionSnapshotSettingRequest.new
335
+ #
336
+ # # Call the patch method.
337
+ # result = client.patch request
338
+ #
339
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
340
+ # p result
341
+ #
342
+ def patch request, options = nil
343
+ raise ::ArgumentError, "request must be provided" if request.nil?
344
+
345
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::PatchRegionSnapshotSettingRequest
346
+
347
+ # Converts hash and nil to an options object
348
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
349
+
350
+ # Customize the options with defaults
351
+ call_metadata = @config.rpcs.patch.metadata.to_h
352
+
353
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
354
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
355
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
356
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
357
+ transports_version_send: [:rest]
358
+
359
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
360
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
361
+
362
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
363
+ metadata: call_metadata,
364
+ retry_policy: @config.rpcs.patch.retry_policy
365
+
366
+ options.apply_defaults timeout: @config.timeout,
367
+ metadata: @config.metadata,
368
+ retry_policy: @config.retry_policy
369
+
370
+ @region_snapshot_settings_stub.patch request, options do |result, response|
371
+ result = ::Google::Cloud::Compute::V1::RegionOperations::Rest::NonstandardLro.create_operation(
372
+ operation: result,
373
+ client: region_operations,
374
+ request_values: {
375
+ "project" => request.project,
376
+ "region" => request.region
377
+ },
378
+ options: options
379
+ )
380
+ yield result, response if block_given?
381
+ throw :response, result
382
+ end
383
+ rescue ::Gapic::Rest::Error => e
384
+ raise ::Google::Cloud::Error.from_error(e)
385
+ end
386
+
387
+ ##
388
+ # Configuration class for the RegionSnapshotSettings REST API.
389
+ #
390
+ # This class represents the configuration for RegionSnapshotSettings REST,
391
+ # providing control over timeouts, retry behavior, logging, transport
392
+ # parameters, and other low-level controls. Certain parameters can also be
393
+ # applied individually to specific RPCs. See
394
+ # {::Google::Cloud::Compute::V1::RegionSnapshotSettings::Rest::Client::Configuration::Rpcs}
395
+ # for a list of RPCs that can be configured independently.
396
+ #
397
+ # Configuration can be applied globally to all clients, or to a single client
398
+ # on construction.
399
+ #
400
+ # @example
401
+ #
402
+ # # Modify the global config, setting the timeout for
403
+ # # get to 20 seconds,
404
+ # # and all remaining timeouts to 10 seconds.
405
+ # ::Google::Cloud::Compute::V1::RegionSnapshotSettings::Rest::Client.configure do |config|
406
+ # config.timeout = 10.0
407
+ # config.rpcs.get.timeout = 20.0
408
+ # end
409
+ #
410
+ # # Apply the above configuration only to a new client.
411
+ # client = ::Google::Cloud::Compute::V1::RegionSnapshotSettings::Rest::Client.new do |config|
412
+ # config.timeout = 10.0
413
+ # config.rpcs.get.timeout = 20.0
414
+ # end
415
+ #
416
+ # @!attribute [rw] endpoint
417
+ # A custom service endpoint, as a hostname or hostname:port. The default is
418
+ # nil, indicating to use the default endpoint in the current universe domain.
419
+ # @return [::String,nil]
420
+ # @!attribute [rw] credentials
421
+ # Credentials to send with calls. You may provide any of the following types:
422
+ # * (`String`) The path to a service account key file in JSON format
423
+ # * (`Hash`) A service account key as a Hash
424
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
425
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
426
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
427
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
428
+ # * (`nil`) indicating no credentials
429
+ #
430
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
431
+ # external source for authentication to Google Cloud, you must validate it before
432
+ # providing it to a Google API client library. Providing an unvalidated credential
433
+ # configuration to Google APIs can compromise the security of your systems and data.
434
+ # For more information, refer to [Validate credential configurations from external
435
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
436
+ # @return [::Object]
437
+ # @!attribute [rw] scope
438
+ # The OAuth scopes
439
+ # @return [::Array<::String>]
440
+ # @!attribute [rw] lib_name
441
+ # The library name as recorded in instrumentation and logging
442
+ # @return [::String]
443
+ # @!attribute [rw] lib_version
444
+ # The library version as recorded in instrumentation and logging
445
+ # @return [::String]
446
+ # @!attribute [rw] timeout
447
+ # The call timeout in seconds.
448
+ # @return [::Numeric]
449
+ # @!attribute [rw] metadata
450
+ # Additional headers to be sent with the call.
451
+ # @return [::Hash{::Symbol=>::String}]
452
+ # @!attribute [rw] retry_policy
453
+ # The retry policy. The value is a hash with the following keys:
454
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
455
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
456
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
457
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
458
+ # trigger a retry.
459
+ # @return [::Hash]
460
+ # @!attribute [rw] quota_project
461
+ # A separate project against which to charge quota.
462
+ # @return [::String]
463
+ # @!attribute [rw] universe_domain
464
+ # The universe domain within which to make requests. This determines the
465
+ # default endpoint URL. The default value of nil uses the environment
466
+ # universe (usually the default "googleapis.com" universe).
467
+ # @return [::String,nil]
468
+ # @!attribute [rw] logger
469
+ # A custom logger to use for request/response debug logging, or the value
470
+ # `:default` (the default) to construct a default logger, or `nil` to
471
+ # explicitly disable logging.
472
+ # @return [::Logger,:default,nil]
473
+ #
474
+ class Configuration
475
+ extend ::Gapic::Config
476
+
477
+ # @private
478
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
479
+ DEFAULT_ENDPOINT = "compute.googleapis.com"
480
+
481
+ config_attr :endpoint, nil, ::String, nil
482
+ config_attr :credentials, nil do |value|
483
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
484
+ allowed.any? { |klass| klass === value }
485
+ end
486
+ config_attr :scope, nil, ::String, ::Array, nil
487
+ config_attr :lib_name, nil, ::String, nil
488
+ config_attr :lib_version, nil, ::String, nil
489
+ config_attr :timeout, nil, ::Numeric, nil
490
+ config_attr :metadata, nil, ::Hash, nil
491
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
492
+ config_attr :quota_project, nil, ::String, nil
493
+ config_attr :universe_domain, nil, ::String, nil
494
+ config_attr :logger, :default, ::Logger, nil, :default
495
+
496
+ # @private
497
+ def initialize parent_config = nil
498
+ @parent_config = parent_config unless parent_config.nil?
499
+
500
+ yield self if block_given?
501
+ end
502
+
503
+ ##
504
+ # Configurations for individual RPCs
505
+ # @return [Rpcs]
506
+ #
507
+ def rpcs
508
+ @rpcs ||= begin
509
+ parent_rpcs = nil
510
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
511
+ Rpcs.new parent_rpcs
512
+ end
513
+ end
514
+
515
+ ##
516
+ # Configuration RPC class for the RegionSnapshotSettings API.
517
+ #
518
+ # Includes fields providing the configuration for each RPC in this service.
519
+ # Each configuration object is of type `Gapic::Config::Method` and includes
520
+ # the following configuration fields:
521
+ #
522
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
523
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
524
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
525
+ # include the following keys:
526
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
527
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
528
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
529
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
530
+ # trigger a retry.
531
+ #
532
+ class Rpcs
533
+ ##
534
+ # RPC-specific configuration for `get`
535
+ # @return [::Gapic::Config::Method]
536
+ #
537
+ attr_reader :get
538
+ ##
539
+ # RPC-specific configuration for `patch`
540
+ # @return [::Gapic::Config::Method]
541
+ #
542
+ attr_reader :patch
543
+
544
+ # @private
545
+ def initialize parent_rpcs = nil
546
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
547
+ @get = ::Gapic::Config::Method.new get_config
548
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
549
+ @patch = ::Gapic::Config::Method.new patch_config
550
+
551
+ yield self if block_given?
552
+ end
553
+ end
554
+ end
555
+ end
556
+ end
557
+ end
558
+ end
559
+ end
560
+ end
561
+ end