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,863 @@
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/reservation_slots/rest/service_stub"
22
+ require "google/cloud/compute/v1/zone_operations/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Compute
27
+ module V1
28
+ module ReservationSlots
29
+ module Rest
30
+ ##
31
+ # REST client for the ReservationSlots service.
32
+ #
33
+ # The ReservationSlots 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 :reservation_slots_stub
44
+
45
+ ##
46
+ # Configure the ReservationSlots Client class.
47
+ #
48
+ # See {::Google::Cloud::Compute::V1::ReservationSlots::Rest::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all ReservationSlots clients
54
+ # ::Google::Cloud::Compute::V1::ReservationSlots::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.get_version.timeout = 600.0
80
+
81
+ default_config.rpcs.list.timeout = 600.0
82
+ default_config.rpcs.list.retry_policy = {
83
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
84
+ }
85
+
86
+ default_config.rpcs.update.timeout = 600.0
87
+
88
+ default_config
89
+ end
90
+ yield @configure if block_given?
91
+ @configure
92
+ end
93
+
94
+ ##
95
+ # Configure the ReservationSlots Client instance.
96
+ #
97
+ # The configuration is set to the derived mode, meaning that values can be changed,
98
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
99
+ # should be made on {Client.configure}.
100
+ #
101
+ # See {::Google::Cloud::Compute::V1::ReservationSlots::Rest::Client::Configuration}
102
+ # for a description of the configuration fields.
103
+ #
104
+ # @yield [config] Configure the Client client.
105
+ # @yieldparam config [Client::Configuration]
106
+ #
107
+ # @return [Client::Configuration]
108
+ #
109
+ def configure
110
+ yield @config if block_given?
111
+ @config
112
+ end
113
+
114
+ ##
115
+ # The effective universe domain
116
+ #
117
+ # @return [String]
118
+ #
119
+ def universe_domain
120
+ @reservation_slots_stub.universe_domain
121
+ end
122
+
123
+ ##
124
+ # Create a new ReservationSlots REST client object.
125
+ #
126
+ # @example
127
+ #
128
+ # # Create a client using the default configuration
129
+ # client = ::Google::Cloud::Compute::V1::ReservationSlots::Rest::Client.new
130
+ #
131
+ # # Create a client using a custom configuration
132
+ # client = ::Google::Cloud::Compute::V1::ReservationSlots::Rest::Client.new do |config|
133
+ # config.timeout = 10.0
134
+ # end
135
+ #
136
+ # @yield [config] Configure the ReservationSlots client.
137
+ # @yieldparam config [Client::Configuration]
138
+ #
139
+ def initialize
140
+ # Create the configuration object
141
+ @config = Configuration.new Client.configure
142
+
143
+ # Yield the configuration if needed
144
+ yield @config if block_given?
145
+
146
+ # Create credentials
147
+ credentials = @config.credentials
148
+ # Use self-signed JWT if the endpoint is unchanged from default,
149
+ # but only if the default endpoint does not have a region prefix.
150
+ enable_self_signed_jwt = @config.endpoint.nil? ||
151
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
152
+ !@config.endpoint.split(".").first.include?("-"))
153
+ credentials ||= Credentials.default scope: @config.scope,
154
+ enable_self_signed_jwt: enable_self_signed_jwt
155
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
156
+ credentials = Credentials.new credentials, scope: @config.scope
157
+ end
158
+
159
+ @quota_project_id = @config.quota_project
160
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
161
+
162
+ @zone_operations = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client.new do |config|
163
+ config.credentials = credentials
164
+ config.quota_project = @quota_project_id
165
+ config.endpoint = @config.endpoint
166
+ config.universe_domain = @config.universe_domain
167
+ end
168
+
169
+ @reservation_slots_stub = ::Google::Cloud::Compute::V1::ReservationSlots::Rest::ServiceStub.new(
170
+ endpoint: @config.endpoint,
171
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
172
+ universe_domain: @config.universe_domain,
173
+ credentials: credentials,
174
+ logger: @config.logger
175
+ )
176
+
177
+ @reservation_slots_stub.logger(stub: true)&.info do |entry|
178
+ entry.set_system_name
179
+ entry.set_service
180
+ entry.message = "Created client for #{entry.service}"
181
+ entry.set_credentials_fields credentials
182
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
183
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
184
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
185
+ end
186
+ end
187
+
188
+ ##
189
+ # Get the associated client for long-running operations via ZoneOperations.
190
+ #
191
+ # @return [::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client]
192
+ #
193
+ attr_reader :zone_operations
194
+
195
+ ##
196
+ # The logger used for request/response debug logging.
197
+ #
198
+ # @return [Logger]
199
+ #
200
+ def logger
201
+ @reservation_slots_stub.logger
202
+ end
203
+
204
+ # Service calls
205
+
206
+ ##
207
+ # Retrieves information about the specified reservation slot.
208
+ #
209
+ # @overload get(request, options = nil)
210
+ # Pass arguments to `get` via a request object, either of type
211
+ # {::Google::Cloud::Compute::V1::GetReservationSlotRequest} or an equivalent Hash.
212
+ #
213
+ # @param request [::Google::Cloud::Compute::V1::GetReservationSlotRequest, ::Hash]
214
+ # A request object representing the call parameters. Required. To specify no
215
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
216
+ # @param options [::Gapic::CallOptions, ::Hash]
217
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
218
+ #
219
+ # @overload get(parent_name: nil, project: nil, reservation_slot: nil, zone: nil)
220
+ # Pass arguments to `get` via keyword arguments. Note that at
221
+ # least one keyword argument is required. To specify no parameters, or to keep all
222
+ # the default parameter values, pass an empty Hash as a request object (see above).
223
+ #
224
+ # @param parent_name [::String]
225
+ # The name of the parent reservation and parent block, formatted as
226
+ # reservations/\\{reservation_name}/reservationBlocks/\\{reservation_block_name}/reservationSubBlocks/\\{reservation_sub_block_name}
227
+ # @param project [::String]
228
+ # The project ID for this request.
229
+ # @param reservation_slot [::String]
230
+ # The name of the reservation slot, formatted as RFC1035 or a resource ID
231
+ # number.
232
+ # @param zone [::String]
233
+ # The name of the zone for this request, formatted as RFC1035.
234
+ # @yield [result, operation] Access the result along with the TransportOperation object
235
+ # @yieldparam result [::Google::Cloud::Compute::V1::ReservationSlotsGetResponse]
236
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
237
+ #
238
+ # @return [::Google::Cloud::Compute::V1::ReservationSlotsGetResponse]
239
+ #
240
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
241
+ #
242
+ # @example Basic example
243
+ # require "google/cloud/compute/v1"
244
+ #
245
+ # # Create a client object. The client can be reused for multiple calls.
246
+ # client = Google::Cloud::Compute::V1::ReservationSlots::Rest::Client.new
247
+ #
248
+ # # Create a request. To set request fields, pass in keyword arguments.
249
+ # request = Google::Cloud::Compute::V1::GetReservationSlotRequest.new
250
+ #
251
+ # # Call the get method.
252
+ # result = client.get request
253
+ #
254
+ # # The returned object is of type Google::Cloud::Compute::V1::ReservationSlotsGetResponse.
255
+ # p result
256
+ #
257
+ def get request, options = nil
258
+ raise ::ArgumentError, "request must be provided" if request.nil?
259
+
260
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetReservationSlotRequest
261
+
262
+ # Converts hash and nil to an options object
263
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
264
+
265
+ # Customize the options with defaults
266
+ call_metadata = @config.rpcs.get.metadata.to_h
267
+
268
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
269
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
270
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
271
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
272
+ transports_version_send: [:rest]
273
+
274
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
275
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
276
+
277
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
278
+ metadata: call_metadata,
279
+ retry_policy: @config.rpcs.get.retry_policy
280
+
281
+ options.apply_defaults timeout: @config.timeout,
282
+ metadata: @config.metadata,
283
+ retry_policy: @config.retry_policy
284
+
285
+ @reservation_slots_stub.get request, options do |result, operation|
286
+ yield result, operation if block_given?
287
+ end
288
+ rescue ::Gapic::Rest::Error => e
289
+ raise ::Google::Cloud::Error.from_error(e)
290
+ end
291
+
292
+ ##
293
+ # Allows customers to get SBOM versions of a reservation slot.
294
+ #
295
+ # @overload get_version(request, options = nil)
296
+ # Pass arguments to `get_version` via a request object, either of type
297
+ # {::Google::Cloud::Compute::V1::GetVersionReservationSlotRequest} or an equivalent Hash.
298
+ #
299
+ # @param request [::Google::Cloud::Compute::V1::GetVersionReservationSlotRequest, ::Hash]
300
+ # A request object representing the call parameters. Required. To specify no
301
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
302
+ # @param options [::Gapic::CallOptions, ::Hash]
303
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
304
+ #
305
+ # @overload get_version(parent_name: nil, project: nil, request_id: nil, reservation_slot: nil, reservation_slots_get_version_request_resource: nil, zone: nil)
306
+ # Pass arguments to `get_version` via keyword arguments. Note that at
307
+ # least one keyword argument is required. To specify no parameters, or to keep all
308
+ # the default parameter values, pass an empty Hash as a request object (see above).
309
+ #
310
+ # @param parent_name [::String]
311
+ # The name of the parent reservation and parent block. In the format of
312
+ # reservations/\\{reservation_name}/reservationBlocks/\\{reservation_block_name}/reservationSubBlocks/\\{reservation_sub_block_name}
313
+ # @param project [::String]
314
+ # Project ID for this request.
315
+ # @param request_id [::String]
316
+ # An optional request ID to identify requests. Specify a unique request ID so
317
+ # that if you must retry your request, the server will know to ignore the
318
+ # request if it has already been completed.
319
+ #
320
+ # For example, consider a situation where you make an initial request and
321
+ # the request times out. If you make the request again with the same
322
+ # request ID, the server can check if original operation with the same
323
+ # request ID was received, and if so, will ignore the second request. This
324
+ # prevents clients from accidentally creating duplicate commitments.
325
+ #
326
+ # The request ID must be
327
+ # a valid UUID with the exception that zero UUID is not supported
328
+ # (00000000-0000-0000-0000-000000000000).
329
+ # @param reservation_slot [::String]
330
+ # The name of the reservation slot.
331
+ # Name should conform to RFC1035 or be a resource ID.
332
+ # @param reservation_slots_get_version_request_resource [::Google::Cloud::Compute::V1::ReservationSlotsGetVersionRequest, ::Hash]
333
+ # The body resource for this request
334
+ # @param zone [::String]
335
+ # Name of the zone for this request. Zone name should conform to RFC1035.
336
+ # @yield [result, operation] Access the result along with the TransportOperation object
337
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
338
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
339
+ #
340
+ # @return [::Gapic::GenericLRO::Operation]
341
+ #
342
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
343
+ #
344
+ # @example Basic example
345
+ # require "google/cloud/compute/v1"
346
+ #
347
+ # # Create a client object. The client can be reused for multiple calls.
348
+ # client = Google::Cloud::Compute::V1::ReservationSlots::Rest::Client.new
349
+ #
350
+ # # Create a request. To set request fields, pass in keyword arguments.
351
+ # request = Google::Cloud::Compute::V1::GetVersionReservationSlotRequest.new
352
+ #
353
+ # # Call the get_version method.
354
+ # result = client.get_version request
355
+ #
356
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
357
+ # p result
358
+ #
359
+ def get_version request, options = nil
360
+ raise ::ArgumentError, "request must be provided" if request.nil?
361
+
362
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::GetVersionReservationSlotRequest
363
+
364
+ # Converts hash and nil to an options object
365
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
366
+
367
+ # Customize the options with defaults
368
+ call_metadata = @config.rpcs.get_version.metadata.to_h
369
+
370
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
371
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
372
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
373
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
374
+ transports_version_send: [:rest]
375
+
376
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
377
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
378
+
379
+ options.apply_defaults timeout: @config.rpcs.get_version.timeout,
380
+ metadata: call_metadata,
381
+ retry_policy: @config.rpcs.get_version.retry_policy
382
+
383
+ options.apply_defaults timeout: @config.timeout,
384
+ metadata: @config.metadata,
385
+ retry_policy: @config.retry_policy
386
+
387
+ @reservation_slots_stub.get_version request, options do |result, response|
388
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
389
+ operation: result,
390
+ client: zone_operations,
391
+ request_values: {
392
+ "project" => request.project,
393
+ "zone" => request.zone
394
+ },
395
+ options: options
396
+ )
397
+ yield result, response if block_given?
398
+ throw :response, result
399
+ end
400
+ rescue ::Gapic::Rest::Error => e
401
+ raise ::Google::Cloud::Error.from_error(e)
402
+ end
403
+
404
+ ##
405
+ # Retrieves a list of reservation slots under a single reservation.
406
+ #
407
+ # @overload list(request, options = nil)
408
+ # Pass arguments to `list` via a request object, either of type
409
+ # {::Google::Cloud::Compute::V1::ListReservationSlotsRequest} or an equivalent Hash.
410
+ #
411
+ # @param request [::Google::Cloud::Compute::V1::ListReservationSlotsRequest, ::Hash]
412
+ # A request object representing the call parameters. Required. To specify no
413
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
414
+ # @param options [::Gapic::CallOptions, ::Hash]
415
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
416
+ #
417
+ # @overload list(filter: nil, max_results: nil, order_by: nil, page_token: nil, parent_name: nil, project: nil, return_partial_success: nil, zone: nil)
418
+ # Pass arguments to `list` via keyword arguments. Note that at
419
+ # least one keyword argument is required. To specify no parameters, or to keep all
420
+ # the default parameter values, pass an empty Hash as a request object (see above).
421
+ #
422
+ # @param filter [::String]
423
+ # A filter expression that filters resources listed in the response. Most
424
+ # Compute resources support two types of filter expressions:
425
+ # expressions that support regular expressions and expressions that follow
426
+ # API improvement proposal AIP-160.
427
+ # These two types of filter expressions cannot be mixed in one request.
428
+ #
429
+ # If you want to use AIP-160, your expression must specify the field name, an
430
+ # operator, and the value that you want to use for filtering. The value
431
+ # must be a string, a number, or a boolean. The operator
432
+ # must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`.
433
+ #
434
+ # For example, if you are filtering Compute Engine instances, you can
435
+ # exclude instances named `example-instance` by specifying
436
+ # `name != example-instance`.
437
+ #
438
+ # The `:*` comparison can be used to test whether a key has been defined.
439
+ # For example, to find all objects with `owner` label use:
440
+ # ```
441
+ # labels.owner:*
442
+ # ```
443
+ #
444
+ # You can also filter nested fields. For example, you could specify
445
+ # `scheduling.automaticRestart = false` to include instances only
446
+ # if they are not scheduled for automatic restarts. You can use filtering
447
+ # on nested fields to filter based onresource labels.
448
+ #
449
+ # To filter on multiple expressions, provide each separate expression within
450
+ # parentheses. For example:
451
+ # ```
452
+ # (scheduling.automaticRestart = true)
453
+ # (cpuPlatform = "Intel Skylake")
454
+ # ```
455
+ # By default, each expression is an `AND` expression. However, you
456
+ # can include `AND` and `OR` expressions explicitly.
457
+ # For example:
458
+ # ```
459
+ # (cpuPlatform = "Intel Skylake") OR
460
+ # (cpuPlatform = "Intel Broadwell") AND
461
+ # (scheduling.automaticRestart = true)
462
+ # ```
463
+ #
464
+ # If you want to use a regular expression, use the `eq` (equal) or `ne`
465
+ # (not equal) operator against a single un-parenthesized expression with or
466
+ # without quotes or against multiple parenthesized expressions. Examples:
467
+ #
468
+ # `fieldname eq unquoted literal`
469
+ # `fieldname eq 'single quoted literal'`
470
+ # `fieldname eq "double quoted literal"`
471
+ # `(fieldname1 eq literal) (fieldname2 ne "literal")`
472
+ #
473
+ # The literal value is interpreted as a regular expression using GoogleRE2 library syntax.
474
+ # The literal value must match the entire field.
475
+ #
476
+ # For example, to filter for instances that do not end with name "instance",
477
+ # you would use `name ne .*instance`.
478
+ #
479
+ # You cannot combine constraints on multiple fields using regular
480
+ # expressions.
481
+ # @param max_results [::Integer]
482
+ # The maximum number of results per page that should be returned.
483
+ # If the number of available results is larger than `maxResults`,
484
+ # Compute Engine returns a `nextPageToken` that can be used to get
485
+ # the next page of results in subsequent list requests. Acceptable values are
486
+ # `0` to `500`, inclusive. (Default: `500`)
487
+ # @param order_by [::String]
488
+ # Sorts list results by a certain order. By default, results
489
+ # are returned in alphanumerical order based on the resource name.
490
+ #
491
+ # You can also sort results in descending order based on the creation
492
+ # timestamp using `orderBy="creationTimestamp desc"`. This sorts
493
+ # results based on the `creationTimestamp` field in
494
+ # reverse chronological order (newest result first). Use this to sort
495
+ # resources like operations so that the newest operation is returned first.
496
+ #
497
+ # Currently, only sorting by `name` or
498
+ # `creationTimestamp desc` is supported.
499
+ # @param page_token [::String]
500
+ # Specifies a page token to use. Set `pageToken` to the
501
+ # `nextPageToken` returned by a previous list request to get
502
+ # the next page of results.
503
+ # @param parent_name [::String]
504
+ # The name of the parent reservation and parent block, formatted as
505
+ # reservations/\\{reservation_name}/reservationBlocks/\\{reservation_block_name}/reservationSubBlocks/\\{reservation_sub_block_name}
506
+ # @param project [::String]
507
+ # The project ID for this request.
508
+ # @param return_partial_success [::Boolean]
509
+ # Opt-in for partial success behavior which provides partial results in case
510
+ # of failure. The default value is false.
511
+ #
512
+ # For example, when partial success behavior is enabled, aggregatedList for a
513
+ # single zone scope either returns all resources in the zone or no resources,
514
+ # with an error code.
515
+ # @param zone [::String]
516
+ # The name of the zone for this request, formatted as RFC1035.
517
+ # @yield [result, operation] Access the result along with the TransportOperation object
518
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ReservationSlot>]
519
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
520
+ #
521
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Compute::V1::ReservationSlot>]
522
+ #
523
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
524
+ #
525
+ # @example Basic example
526
+ # require "google/cloud/compute/v1"
527
+ #
528
+ # # Create a client object. The client can be reused for multiple calls.
529
+ # client = Google::Cloud::Compute::V1::ReservationSlots::Rest::Client.new
530
+ #
531
+ # # Create a request. To set request fields, pass in keyword arguments.
532
+ # request = Google::Cloud::Compute::V1::ListReservationSlotsRequest.new
533
+ #
534
+ # # Call the list method.
535
+ # result = client.list request
536
+ #
537
+ # # The returned object is of type Google::Cloud::Compute::V1::ReservationSlotsListResponse.
538
+ # p result
539
+ #
540
+ def list request, options = nil
541
+ raise ::ArgumentError, "request must be provided" if request.nil?
542
+
543
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::ListReservationSlotsRequest
544
+
545
+ # Converts hash and nil to an options object
546
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
547
+
548
+ # Customize the options with defaults
549
+ call_metadata = @config.rpcs.list.metadata.to_h
550
+
551
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
552
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
553
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
554
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
555
+ transports_version_send: [:rest]
556
+
557
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
558
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
559
+
560
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
561
+ metadata: call_metadata,
562
+ retry_policy: @config.rpcs.list.retry_policy
563
+
564
+ options.apply_defaults timeout: @config.timeout,
565
+ metadata: @config.metadata,
566
+ retry_policy: @config.retry_policy
567
+
568
+ @reservation_slots_stub.list request, options do |result, operation|
569
+ result = ::Gapic::Rest::PagedEnumerable.new @reservation_slots_stub, :list, "items", request, result, options
570
+ yield result, operation if block_given?
571
+ throw :response, result
572
+ end
573
+ rescue ::Gapic::Rest::Error => e
574
+ raise ::Google::Cloud::Error.from_error(e)
575
+ end
576
+
577
+ ##
578
+ # Update a reservation slot in the specified sub-block.
579
+ #
580
+ # @overload update(request, options = nil)
581
+ # Pass arguments to `update` via a request object, either of type
582
+ # {::Google::Cloud::Compute::V1::UpdateReservationSlotRequest} or an equivalent Hash.
583
+ #
584
+ # @param request [::Google::Cloud::Compute::V1::UpdateReservationSlotRequest, ::Hash]
585
+ # A request object representing the call parameters. Required. To specify no
586
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
587
+ # @param options [::Gapic::CallOptions, ::Hash]
588
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
589
+ #
590
+ # @overload update(parent_name: nil, project: nil, reservation_slot: nil, reservation_slot_resource: nil, update_mask: nil, zone: nil)
591
+ # Pass arguments to `update` via keyword arguments. Note that at
592
+ # least one keyword argument is required. To specify no parameters, or to keep all
593
+ # the default parameter values, pass an empty Hash as a request object (see above).
594
+ #
595
+ # @param parent_name [::String]
596
+ # The name of the sub-block resource.
597
+ # @param project [::String]
598
+ # The project ID for this request.
599
+ # @param reservation_slot [::String]
600
+ # The name of the slot resource.
601
+ # @param reservation_slot_resource [::Google::Cloud::Compute::V1::ReservationSlot, ::Hash]
602
+ # The body resource for this request
603
+ # @param update_mask [::String]
604
+ # The fields to be updated as part of this request.
605
+ # @param zone [::String]
606
+ # The name of the zone for this request, formatted as RFC1035.
607
+ # @yield [result, operation] Access the result along with the TransportOperation object
608
+ # @yieldparam result [::Gapic::GenericLRO::Operation]
609
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
610
+ #
611
+ # @return [::Gapic::GenericLRO::Operation]
612
+ #
613
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
614
+ #
615
+ # @example Basic example
616
+ # require "google/cloud/compute/v1"
617
+ #
618
+ # # Create a client object. The client can be reused for multiple calls.
619
+ # client = Google::Cloud::Compute::V1::ReservationSlots::Rest::Client.new
620
+ #
621
+ # # Create a request. To set request fields, pass in keyword arguments.
622
+ # request = Google::Cloud::Compute::V1::UpdateReservationSlotRequest.new
623
+ #
624
+ # # Call the update method.
625
+ # result = client.update request
626
+ #
627
+ # # The returned object is of type Google::Cloud::Compute::V1::Operation.
628
+ # p result
629
+ #
630
+ def update request, options = nil
631
+ raise ::ArgumentError, "request must be provided" if request.nil?
632
+
633
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::UpdateReservationSlotRequest
634
+
635
+ # Converts hash and nil to an options object
636
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
637
+
638
+ # Customize the options with defaults
639
+ call_metadata = @config.rpcs.update.metadata.to_h
640
+
641
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
642
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
643
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
644
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
645
+ transports_version_send: [:rest]
646
+
647
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
648
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
649
+
650
+ options.apply_defaults timeout: @config.rpcs.update.timeout,
651
+ metadata: call_metadata,
652
+ retry_policy: @config.rpcs.update.retry_policy
653
+
654
+ options.apply_defaults timeout: @config.timeout,
655
+ metadata: @config.metadata,
656
+ retry_policy: @config.retry_policy
657
+
658
+ @reservation_slots_stub.update request, options do |result, response|
659
+ result = ::Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro.create_operation(
660
+ operation: result,
661
+ client: zone_operations,
662
+ request_values: {
663
+ "project" => request.project,
664
+ "zone" => request.zone
665
+ },
666
+ options: options
667
+ )
668
+ yield result, response if block_given?
669
+ throw :response, result
670
+ end
671
+ rescue ::Gapic::Rest::Error => e
672
+ raise ::Google::Cloud::Error.from_error(e)
673
+ end
674
+
675
+ ##
676
+ # Configuration class for the ReservationSlots REST API.
677
+ #
678
+ # This class represents the configuration for ReservationSlots REST,
679
+ # providing control over timeouts, retry behavior, logging, transport
680
+ # parameters, and other low-level controls. Certain parameters can also be
681
+ # applied individually to specific RPCs. See
682
+ # {::Google::Cloud::Compute::V1::ReservationSlots::Rest::Client::Configuration::Rpcs}
683
+ # for a list of RPCs that can be configured independently.
684
+ #
685
+ # Configuration can be applied globally to all clients, or to a single client
686
+ # on construction.
687
+ #
688
+ # @example
689
+ #
690
+ # # Modify the global config, setting the timeout for
691
+ # # get to 20 seconds,
692
+ # # and all remaining timeouts to 10 seconds.
693
+ # ::Google::Cloud::Compute::V1::ReservationSlots::Rest::Client.configure do |config|
694
+ # config.timeout = 10.0
695
+ # config.rpcs.get.timeout = 20.0
696
+ # end
697
+ #
698
+ # # Apply the above configuration only to a new client.
699
+ # client = ::Google::Cloud::Compute::V1::ReservationSlots::Rest::Client.new do |config|
700
+ # config.timeout = 10.0
701
+ # config.rpcs.get.timeout = 20.0
702
+ # end
703
+ #
704
+ # @!attribute [rw] endpoint
705
+ # A custom service endpoint, as a hostname or hostname:port. The default is
706
+ # nil, indicating to use the default endpoint in the current universe domain.
707
+ # @return [::String,nil]
708
+ # @!attribute [rw] credentials
709
+ # Credentials to send with calls. You may provide any of the following types:
710
+ # * (`String`) The path to a service account key file in JSON format
711
+ # * (`Hash`) A service account key as a Hash
712
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
713
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
714
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
715
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
716
+ # * (`nil`) indicating no credentials
717
+ #
718
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
719
+ # external source for authentication to Google Cloud, you must validate it before
720
+ # providing it to a Google API client library. Providing an unvalidated credential
721
+ # configuration to Google APIs can compromise the security of your systems and data.
722
+ # For more information, refer to [Validate credential configurations from external
723
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
724
+ # @return [::Object]
725
+ # @!attribute [rw] scope
726
+ # The OAuth scopes
727
+ # @return [::Array<::String>]
728
+ # @!attribute [rw] lib_name
729
+ # The library name as recorded in instrumentation and logging
730
+ # @return [::String]
731
+ # @!attribute [rw] lib_version
732
+ # The library version as recorded in instrumentation and logging
733
+ # @return [::String]
734
+ # @!attribute [rw] timeout
735
+ # The call timeout in seconds.
736
+ # @return [::Numeric]
737
+ # @!attribute [rw] metadata
738
+ # Additional headers to be sent with the call.
739
+ # @return [::Hash{::Symbol=>::String}]
740
+ # @!attribute [rw] retry_policy
741
+ # The retry policy. The value is a hash with the following keys:
742
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
743
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
744
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
745
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
746
+ # trigger a retry.
747
+ # @return [::Hash]
748
+ # @!attribute [rw] quota_project
749
+ # A separate project against which to charge quota.
750
+ # @return [::String]
751
+ # @!attribute [rw] universe_domain
752
+ # The universe domain within which to make requests. This determines the
753
+ # default endpoint URL. The default value of nil uses the environment
754
+ # universe (usually the default "googleapis.com" universe).
755
+ # @return [::String,nil]
756
+ # @!attribute [rw] logger
757
+ # A custom logger to use for request/response debug logging, or the value
758
+ # `:default` (the default) to construct a default logger, or `nil` to
759
+ # explicitly disable logging.
760
+ # @return [::Logger,:default,nil]
761
+ #
762
+ class Configuration
763
+ extend ::Gapic::Config
764
+
765
+ # @private
766
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
767
+ DEFAULT_ENDPOINT = "compute.googleapis.com"
768
+
769
+ config_attr :endpoint, nil, ::String, nil
770
+ config_attr :credentials, nil do |value|
771
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
772
+ allowed.any? { |klass| klass === value }
773
+ end
774
+ config_attr :scope, nil, ::String, ::Array, nil
775
+ config_attr :lib_name, nil, ::String, nil
776
+ config_attr :lib_version, nil, ::String, nil
777
+ config_attr :timeout, nil, ::Numeric, nil
778
+ config_attr :metadata, nil, ::Hash, nil
779
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
780
+ config_attr :quota_project, nil, ::String, nil
781
+ config_attr :universe_domain, nil, ::String, nil
782
+ config_attr :logger, :default, ::Logger, nil, :default
783
+
784
+ # @private
785
+ def initialize parent_config = nil
786
+ @parent_config = parent_config unless parent_config.nil?
787
+
788
+ yield self if block_given?
789
+ end
790
+
791
+ ##
792
+ # Configurations for individual RPCs
793
+ # @return [Rpcs]
794
+ #
795
+ def rpcs
796
+ @rpcs ||= begin
797
+ parent_rpcs = nil
798
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
799
+ Rpcs.new parent_rpcs
800
+ end
801
+ end
802
+
803
+ ##
804
+ # Configuration RPC class for the ReservationSlots API.
805
+ #
806
+ # Includes fields providing the configuration for each RPC in this service.
807
+ # Each configuration object is of type `Gapic::Config::Method` and includes
808
+ # the following configuration fields:
809
+ #
810
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
811
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
812
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
813
+ # include the following keys:
814
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
815
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
816
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
817
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
818
+ # trigger a retry.
819
+ #
820
+ class Rpcs
821
+ ##
822
+ # RPC-specific configuration for `get`
823
+ # @return [::Gapic::Config::Method]
824
+ #
825
+ attr_reader :get
826
+ ##
827
+ # RPC-specific configuration for `get_version`
828
+ # @return [::Gapic::Config::Method]
829
+ #
830
+ attr_reader :get_version
831
+ ##
832
+ # RPC-specific configuration for `list`
833
+ # @return [::Gapic::Config::Method]
834
+ #
835
+ attr_reader :list
836
+ ##
837
+ # RPC-specific configuration for `update`
838
+ # @return [::Gapic::Config::Method]
839
+ #
840
+ attr_reader :update
841
+
842
+ # @private
843
+ def initialize parent_rpcs = nil
844
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
845
+ @get = ::Gapic::Config::Method.new get_config
846
+ get_version_config = parent_rpcs.get_version if parent_rpcs.respond_to? :get_version
847
+ @get_version = ::Gapic::Config::Method.new get_version_config
848
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
849
+ @list = ::Gapic::Config::Method.new list_config
850
+ update_config = parent_rpcs.update if parent_rpcs.respond_to? :update
851
+ @update = ::Gapic::Config::Method.new update_config
852
+
853
+ yield self if block_given?
854
+ end
855
+ end
856
+ end
857
+ end
858
+ end
859
+ end
860
+ end
861
+ end
862
+ end
863
+ end