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