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