google-cloud-compute-v1 3.3.0 → 3.5.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 (182) 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 +330 -20
  4. data/lib/google/cloud/compute/v1/addresses/rest/service_stub.rb +64 -0
  5. data/lib/google/cloud/compute/v1/advice/credentials.rb +52 -0
  6. data/lib/google/cloud/compute/v1/advice/rest/client.rb +431 -0
  7. data/lib/google/cloud/compute/v1/advice/rest/service_stub.rb +144 -0
  8. data/lib/google/cloud/compute/v1/advice/rest.rb +51 -0
  9. data/lib/google/cloud/compute/v1/advice.rb +47 -0
  10. data/lib/google/cloud/compute/v1/autoscalers/rest/client.rb +334 -21
  11. data/lib/google/cloud/compute/v1/autoscalers/rest/service_stub.rb +64 -0
  12. data/lib/google/cloud/compute/v1/backend_buckets/rest/client.rb +198 -23
  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 +281 -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 +390 -42
  23. data/lib/google/cloud/compute/v1/external_vpn_gateways/rest/client.rb +118 -11
  24. data/lib/google/cloud/compute/v1/firewall_policies/rest/client.rb +240 -25
  25. data/lib/google/cloud/compute/v1/firewalls/rest/client.rb +238 -13
  26. data/lib/google/cloud/compute/v1/firewalls/rest/service_stub.rb +63 -0
  27. data/lib/google/cloud/compute/v1/forwarding_rules/rest/client.rb +258 -23
  28. data/lib/google/cloud/compute/v1/future_reservations/credentials.rb +52 -0
  29. data/lib/google/cloud/compute/v1/future_reservations/rest/client.rb +1287 -0
  30. data/lib/google/cloud/compute/v1/future_reservations/rest/service_stub.rb +520 -0
  31. data/lib/google/cloud/compute/v1/future_reservations/rest.rb +51 -0
  32. data/lib/google/cloud/compute/v1/future_reservations.rb +47 -0
  33. data/lib/google/cloud/compute/v1/global_addresses/rest/client.rb +217 -10
  34. data/lib/google/cloud/compute/v1/global_addresses/rest/service_stub.rb +63 -0
  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 +473 -40
  47. data/lib/google/cloud/compute/v1/instance_groups/rest/service_stub.rb +64 -0
  48. data/lib/google/cloud/compute/v1/instance_settings_service/rest/client.rb +13 -1
  49. data/lib/google/cloud/compute/v1/instance_templates/rest/client.rb +220 -20
  50. data/lib/google/cloud/compute/v1/instances/rest/client.rb +1144 -99
  51. data/lib/google/cloud/compute/v1/instances/rest/service_stub.rb +127 -0
  52. data/lib/google/cloud/compute/v1/instant_snapshots/rest/client.rb +235 -21
  53. data/lib/google/cloud/compute/v1/interconnect_attachment_groups/rest/client.rb +139 -14
  54. data/lib/google/cloud/compute/v1/interconnect_attachments/rest/client.rb +242 -21
  55. data/lib/google/cloud/compute/v1/interconnect_groups/rest/client.rb +139 -14
  56. data/lib/google/cloud/compute/v1/interconnect_locations/rest/client.rb +87 -7
  57. data/lib/google/cloud/compute/v1/interconnect_remote_locations/rest/client.rb +87 -7
  58. data/lib/google/cloud/compute/v1/interconnects/rest/client.rb +145 -14
  59. data/lib/google/cloud/compute/v1/license_codes/rest/client.rb +9 -2
  60. data/lib/google/cloud/compute/v1/licenses/rest/client.rb +161 -16
  61. data/lib/google/cloud/compute/v1/machine_images/rest/client.rb +124 -13
  62. data/lib/google/cloud/compute/v1/machine_types/rest/client.rb +181 -14
  63. data/lib/google/cloud/compute/v1/network_attachments/rest/client.rb +232 -20
  64. data/lib/google/cloud/compute/v1/network_edge_security_services/rest/client.rb +138 -12
  65. data/lib/google/cloud/compute/v1/network_endpoint_groups/rest/client.rb +361 -37
  66. data/lib/google/cloud/compute/v1/network_firewall_policies/rest/client.rb +354 -33
  67. data/lib/google/cloud/compute/v1/network_profiles/rest/client.rb +85 -6
  68. data/lib/google/cloud/compute/v1/networks/rest/client.rb +281 -23
  69. data/lib/google/cloud/compute/v1/node_groups/rest/client.rb +381 -32
  70. data/lib/google/cloud/compute/v1/node_templates/rest/client.rb +213 -19
  71. data/lib/google/cloud/compute/v1/node_types/rest/client.rb +181 -14
  72. data/lib/google/cloud/compute/v1/organization_security_policies/credentials.rb +52 -0
  73. data/lib/google/cloud/compute/v1/organization_security_policies/rest/client.rb +2259 -0
  74. data/lib/google/cloud/compute/v1/organization_security_policies/rest/service_stub.rb +1054 -0
  75. data/lib/google/cloud/compute/v1/organization_security_policies/rest.rb +51 -0
  76. data/lib/google/cloud/compute/v1/organization_security_policies.rb +47 -0
  77. data/lib/google/cloud/compute/v1/packet_mirrorings/rest/client.rb +226 -19
  78. data/lib/google/cloud/compute/v1/preview_features/credentials.rb +52 -0
  79. data/lib/google/cloud/compute/v1/preview_features/rest/client.rb +739 -0
  80. data/lib/google/cloud/compute/v1/preview_features/rest/service_stub.rb +267 -0
  81. data/lib/google/cloud/compute/v1/preview_features/rest.rb +51 -0
  82. data/lib/google/cloud/compute/v1/preview_features.rb +47 -0
  83. data/lib/google/cloud/compute/v1/projects/rest/client.rb +346 -30
  84. data/lib/google/cloud/compute/v1/public_advertised_prefixes/rest/client.rb +154 -12
  85. data/lib/google/cloud/compute/v1/public_delegated_prefixes/rest/client.rb +255 -22
  86. data/lib/google/cloud/compute/v1/region_autoscalers/rest/client.rb +238 -13
  87. data/lib/google/cloud/compute/v1/region_autoscalers/rest/service_stub.rb +64 -0
  88. data/lib/google/cloud/compute/v1/region_backend_services/rest/client.rb +260 -26
  89. data/lib/google/cloud/compute/v1/region_commitments/rest/client.rb +212 -18
  90. data/lib/google/cloud/compute/v1/region_composite_health_checks/credentials.rb +52 -0
  91. data/lib/google/cloud/compute/v1/region_composite_health_checks/rest/client.rb +1268 -0
  92. data/lib/google/cloud/compute/v1/region_composite_health_checks/rest/service_stub.rb +521 -0
  93. data/lib/google/cloud/compute/v1/region_composite_health_checks/rest.rb +51 -0
  94. data/lib/google/cloud/compute/v1/region_composite_health_checks.rb +47 -0
  95. data/lib/google/cloud/compute/v1/region_disk_types/rest/client.rb +83 -5
  96. data/lib/google/cloud/compute/v1/region_disks/rest/client.rb +269 -29
  97. data/lib/google/cloud/compute/v1/region_health_aggregation_policies/credentials.rb +52 -0
  98. data/lib/google/cloud/compute/v1/region_health_aggregation_policies/rest/client.rb +1268 -0
  99. data/lib/google/cloud/compute/v1/region_health_aggregation_policies/rest/service_stub.rb +521 -0
  100. data/lib/google/cloud/compute/v1/region_health_aggregation_policies/rest.rb +51 -0
  101. data/lib/google/cloud/compute/v1/region_health_aggregation_policies.rb +47 -0
  102. data/lib/google/cloud/compute/v1/region_health_check_services/rest/client.rb +427 -17
  103. data/lib/google/cloud/compute/v1/region_health_check_services/rest/service_stub.rb +125 -0
  104. data/lib/google/cloud/compute/v1/region_health_checks/rest/client.rb +238 -13
  105. data/lib/google/cloud/compute/v1/region_health_checks/rest/service_stub.rb +64 -0
  106. data/lib/google/cloud/compute/v1/region_health_sources/credentials.rb +52 -0
  107. data/lib/google/cloud/compute/v1/region_health_sources/rest/client.rb +1268 -0
  108. data/lib/google/cloud/compute/v1/region_health_sources/rest/service_stub.rb +521 -0
  109. data/lib/google/cloud/compute/v1/region_health_sources/rest.rb +51 -0
  110. data/lib/google/cloud/compute/v1/region_health_sources.rb +47 -0
  111. data/lib/google/cloud/compute/v1/region_instance_group_managers/rest/client.rb +750 -64
  112. data/lib/google/cloud/compute/v1/region_instance_groups/rest/client.rb +280 -14
  113. data/lib/google/cloud/compute/v1/region_instance_groups/rest/service_stub.rb +64 -0
  114. data/lib/google/cloud/compute/v1/region_instance_templates/rest/client.rb +115 -10
  115. data/lib/google/cloud/compute/v1/region_instances/rest/client.rb +15 -2
  116. data/lib/google/cloud/compute/v1/region_instant_snapshots/rest/client.rb +139 -13
  117. data/lib/google/cloud/compute/v1/region_network_endpoint_groups/rest/client.rb +264 -28
  118. data/lib/google/cloud/compute/v1/region_network_firewall_policies/rest/client.rb +213 -20
  119. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/client.rb +399 -11
  120. data/lib/google/cloud/compute/v1/region_notification_endpoints/rest/service_stub.rb +125 -0
  121. data/lib/google/cloud/compute/v1/region_operations/rest/client.rb +107 -10
  122. data/lib/google/cloud/compute/v1/region_security_policies/rest/client.rb +149 -14
  123. data/lib/google/cloud/compute/v1/region_ssl_certificates/rest/client.rb +116 -10
  124. data/lib/google/cloud/compute/v1/region_ssl_policies/rest/client.rb +220 -20
  125. data/lib/google/cloud/compute/v1/region_target_http_proxies/rest/client.rb +126 -10
  126. data/lib/google/cloud/compute/v1/region_target_https_proxies/rest/client.rb +158 -14
  127. data/lib/google/cloud/compute/v1/region_target_tcp_proxies/rest/client.rb +113 -9
  128. data/lib/google/cloud/compute/v1/region_url_maps/rest/client.rb +104 -14
  129. data/lib/google/cloud/compute/v1/region_zones/rest/client.rb +85 -6
  130. data/lib/google/cloud/compute/v1/regions/rest/client.rb +120 -7
  131. data/lib/google/cloud/compute/v1/reservation_blocks/rest/client.rb +396 -11
  132. data/lib/google/cloud/compute/v1/reservation_blocks/rest/service_stub.rb +194 -0
  133. data/lib/google/cloud/compute/v1/reservation_slots/credentials.rb +52 -0
  134. data/lib/google/cloud/compute/v1/reservation_slots/rest/client.rb +863 -0
  135. data/lib/google/cloud/compute/v1/reservation_slots/rest/service_stub.rb +338 -0
  136. data/lib/google/cloud/compute/v1/reservation_slots/rest.rb +51 -0
  137. data/lib/google/cloud/compute/v1/reservation_slots.rb +47 -0
  138. data/lib/google/cloud/compute/v1/reservation_sub_blocks/rest/client.rb +642 -12
  139. data/lib/google/cloud/compute/v1/reservation_sub_blocks/rest/service_stub.rb +327 -3
  140. data/lib/google/cloud/compute/v1/reservations/rest/client.rb +257 -24
  141. data/lib/google/cloud/compute/v1/resource_policies/rest/client.rb +224 -19
  142. data/lib/google/cloud/compute/v1/rest.rb +10 -0
  143. data/lib/google/cloud/compute/v1/routers/rest/client.rb +555 -50
  144. data/lib/google/cloud/compute/v1/routes/rest/client.rb +202 -8
  145. data/lib/google/cloud/compute/v1/routes/rest/service_stub.rb +63 -0
  146. data/lib/google/cloud/compute/v1/security_policies/rest/client.rb +316 -26
  147. data/lib/google/cloud/compute/v1/service_attachments/rest/client.rb +234 -22
  148. data/lib/google/cloud/compute/v1/snapshot_settings_service/rest/client.rb +13 -1
  149. data/lib/google/cloud/compute/v1/snapshots/rest/client.rb +130 -13
  150. data/lib/google/cloud/compute/v1/ssl_certificates/rest/client.rb +210 -17
  151. data/lib/google/cloud/compute/v1/ssl_policies/rest/client.rb +315 -27
  152. data/lib/google/cloud/compute/v1/storage_pool_types/rest/client.rb +181 -14
  153. data/lib/google/cloud/compute/v1/storage_pools/rest/client.rb +321 -28
  154. data/lib/google/cloud/compute/v1/subnetworks/rest/client.rb +378 -34
  155. data/lib/google/cloud/compute/v1/target_grpc_proxies/rest/client.rb +128 -10
  156. data/lib/google/cloud/compute/v1/target_http_proxies/rest/client.rb +240 -20
  157. data/lib/google/cloud/compute/v1/target_https_proxies/rest/client.rb +306 -30
  158. data/lib/google/cloud/compute/v1/target_instances/rest/client.rb +320 -20
  159. data/lib/google/cloud/compute/v1/target_instances/rest/service_stub.rb +64 -0
  160. data/lib/google/cloud/compute/v1/target_pools/rest/client.rb +387 -26
  161. data/lib/google/cloud/compute/v1/target_pools/rest/service_stub.rb +64 -0
  162. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/client.rb +281 -19
  163. data/lib/google/cloud/compute/v1/target_ssl_proxies/rest/service_stub.rb +63 -0
  164. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/client.rb +329 -20
  165. data/lib/google/cloud/compute/v1/target_tcp_proxies/rest/service_stub.rb +63 -0
  166. data/lib/google/cloud/compute/v1/target_vpn_gateways/rest/client.rb +224 -19
  167. data/lib/google/cloud/compute/v1/url_maps/rest/client.rb +354 -24
  168. data/lib/google/cloud/compute/v1/url_maps/rest/service_stub.rb +63 -0
  169. data/lib/google/cloud/compute/v1/version.rb +1 -1
  170. data/lib/google/cloud/compute/v1/vpn_gateways/rest/client.rb +224 -19
  171. data/lib/google/cloud/compute/v1/vpn_tunnels/rest/client.rb +224 -19
  172. data/lib/google/cloud/compute/v1/wire_groups/credentials.rb +52 -0
  173. data/lib/google/cloud/compute/v1/wire_groups/rest/client.rb +980 -0
  174. data/lib/google/cloud/compute/v1/wire_groups/rest/service_stub.rb +396 -0
  175. data/lib/google/cloud/compute/v1/wire_groups/rest.rb +51 -0
  176. data/lib/google/cloud/compute/v1/wire_groups.rb +47 -0
  177. data/lib/google/cloud/compute/v1/zone_operations/rest/client.rb +106 -10
  178. data/lib/google/cloud/compute/v1/zones/rest/client.rb +83 -5
  179. data/lib/google/cloud/compute/v1.rb +10 -0
  180. data/proto_docs/google/api/client.rb +149 -29
  181. data/proto_docs/google/cloud/compute/v1/compute.rb +44226 -5514
  182. metadata +52 -2
@@ -0,0 +1,431 @@
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/advice/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Compute
26
+ module V1
27
+ module Advice
28
+ module Rest
29
+ ##
30
+ # REST client for the Advice service.
31
+ #
32
+ # The Advice API.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "compute.$UNIVERSE_DOMAIN$"
40
+
41
+ # @private
42
+ attr_reader :advice_stub
43
+
44
+ ##
45
+ # Configure the Advice Client class.
46
+ #
47
+ # See {::Google::Cloud::Compute::V1::Advice::Rest::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all Advice clients
53
+ # ::Google::Cloud::Compute::V1::Advice::Rest::Client.configure do |config|
54
+ # config.timeout = 10.0
55
+ # end
56
+ #
57
+ # @yield [config] Configure the Client client.
58
+ # @yieldparam config [Client::Configuration]
59
+ #
60
+ # @return [Client::Configuration]
61
+ #
62
+ def self.configure
63
+ @configure ||= begin
64
+ namespace = ["Google", "Cloud", "Compute", "V1"]
65
+ parent_config = while namespace.any?
66
+ parent_name = namespace.join "::"
67
+ parent_const = const_get parent_name
68
+ break parent_const.configure if parent_const.respond_to? :configure
69
+ namespace.pop
70
+ end
71
+ default_config = Client::Configuration.new parent_config
72
+
73
+ default_config.rpcs.calendar_mode.timeout = 600.0
74
+
75
+ default_config
76
+ end
77
+ yield @configure if block_given?
78
+ @configure
79
+ end
80
+
81
+ ##
82
+ # Configure the Advice Client instance.
83
+ #
84
+ # The configuration is set to the derived mode, meaning that values can be changed,
85
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
86
+ # should be made on {Client.configure}.
87
+ #
88
+ # See {::Google::Cloud::Compute::V1::Advice::Rest::Client::Configuration}
89
+ # for a description of the configuration fields.
90
+ #
91
+ # @yield [config] Configure the Client client.
92
+ # @yieldparam config [Client::Configuration]
93
+ #
94
+ # @return [Client::Configuration]
95
+ #
96
+ def configure
97
+ yield @config if block_given?
98
+ @config
99
+ end
100
+
101
+ ##
102
+ # The effective universe domain
103
+ #
104
+ # @return [String]
105
+ #
106
+ def universe_domain
107
+ @advice_stub.universe_domain
108
+ end
109
+
110
+ ##
111
+ # Create a new Advice REST client object.
112
+ #
113
+ # @example
114
+ #
115
+ # # Create a client using the default configuration
116
+ # client = ::Google::Cloud::Compute::V1::Advice::Rest::Client.new
117
+ #
118
+ # # Create a client using a custom configuration
119
+ # client = ::Google::Cloud::Compute::V1::Advice::Rest::Client.new do |config|
120
+ # config.timeout = 10.0
121
+ # end
122
+ #
123
+ # @yield [config] Configure the Advice client.
124
+ # @yieldparam config [Client::Configuration]
125
+ #
126
+ def initialize
127
+ # Create the configuration object
128
+ @config = Configuration.new Client.configure
129
+
130
+ # Yield the configuration if needed
131
+ yield @config if block_given?
132
+
133
+ # Create credentials
134
+ credentials = @config.credentials
135
+ # Use self-signed JWT if the endpoint is unchanged from default,
136
+ # but only if the default endpoint does not have a region prefix.
137
+ enable_self_signed_jwt = @config.endpoint.nil? ||
138
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
139
+ !@config.endpoint.split(".").first.include?("-"))
140
+ credentials ||= Credentials.default scope: @config.scope,
141
+ enable_self_signed_jwt: enable_self_signed_jwt
142
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
143
+ credentials = Credentials.new credentials, scope: @config.scope
144
+ end
145
+
146
+ @quota_project_id = @config.quota_project
147
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
148
+
149
+ @advice_stub = ::Google::Cloud::Compute::V1::Advice::Rest::ServiceStub.new(
150
+ endpoint: @config.endpoint,
151
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
152
+ universe_domain: @config.universe_domain,
153
+ credentials: credentials,
154
+ logger: @config.logger
155
+ )
156
+
157
+ @advice_stub.logger(stub: true)&.info do |entry|
158
+ entry.set_system_name
159
+ entry.set_service
160
+ entry.message = "Created client for #{entry.service}"
161
+ entry.set_credentials_fields credentials
162
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
163
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
164
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
165
+ end
166
+ end
167
+
168
+ ##
169
+ # The logger used for request/response debug logging.
170
+ #
171
+ # @return [Logger]
172
+ #
173
+ def logger
174
+ @advice_stub.logger
175
+ end
176
+
177
+ # Service calls
178
+
179
+ ##
180
+ # Advise how, where and when to create the requested amount of instances
181
+ # with specified accelerators, within the specified time and location limits.
182
+ # The method recommends creating future reservations for the requested
183
+ # resources.
184
+ #
185
+ # @overload calendar_mode(request, options = nil)
186
+ # Pass arguments to `calendar_mode` via a request object, either of type
187
+ # {::Google::Cloud::Compute::V1::CalendarModeAdviceRpcRequest} or an equivalent Hash.
188
+ #
189
+ # @param request [::Google::Cloud::Compute::V1::CalendarModeAdviceRpcRequest, ::Hash]
190
+ # A request object representing the call parameters. Required. To specify no
191
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
192
+ # @param options [::Gapic::CallOptions, ::Hash]
193
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
194
+ #
195
+ # @overload calendar_mode(calendar_mode_advice_request_resource: nil, project: nil, region: nil)
196
+ # Pass arguments to `calendar_mode` via keyword arguments. Note that at
197
+ # least one keyword argument is required. To specify no parameters, or to keep all
198
+ # the default parameter values, pass an empty Hash as a request object (see above).
199
+ #
200
+ # @param calendar_mode_advice_request_resource [::Google::Cloud::Compute::V1::CalendarModeAdviceRequest, ::Hash]
201
+ # The body resource for this request
202
+ # @param project [::String]
203
+ # Project ID for this request.
204
+ # @param region [::String]
205
+ # Name of the region for this request.
206
+ # @yield [result, operation] Access the result along with the TransportOperation object
207
+ # @yieldparam result [::Google::Cloud::Compute::V1::CalendarModeAdviceResponse]
208
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
209
+ #
210
+ # @return [::Google::Cloud::Compute::V1::CalendarModeAdviceResponse]
211
+ #
212
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
213
+ #
214
+ # @example Basic example
215
+ # require "google/cloud/compute/v1"
216
+ #
217
+ # # Create a client object. The client can be reused for multiple calls.
218
+ # client = Google::Cloud::Compute::V1::Advice::Rest::Client.new
219
+ #
220
+ # # Create a request. To set request fields, pass in keyword arguments.
221
+ # request = Google::Cloud::Compute::V1::CalendarModeAdviceRpcRequest.new
222
+ #
223
+ # # Call the calendar_mode method.
224
+ # result = client.calendar_mode request
225
+ #
226
+ # # The returned object is of type Google::Cloud::Compute::V1::CalendarModeAdviceResponse.
227
+ # p result
228
+ #
229
+ def calendar_mode request, options = nil
230
+ raise ::ArgumentError, "request must be provided" if request.nil?
231
+
232
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Compute::V1::CalendarModeAdviceRpcRequest
233
+
234
+ # Converts hash and nil to an options object
235
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
236
+
237
+ # Customize the options with defaults
238
+ call_metadata = @config.rpcs.calendar_mode.metadata.to_h
239
+
240
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
241
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
242
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
243
+ gapic_version: ::Google::Cloud::Compute::V1::VERSION,
244
+ transports_version_send: [:rest]
245
+
246
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
247
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
248
+
249
+ options.apply_defaults timeout: @config.rpcs.calendar_mode.timeout,
250
+ metadata: call_metadata,
251
+ retry_policy: @config.rpcs.calendar_mode.retry_policy
252
+
253
+ options.apply_defaults timeout: @config.timeout,
254
+ metadata: @config.metadata,
255
+ retry_policy: @config.retry_policy
256
+
257
+ @advice_stub.calendar_mode request, options do |result, operation|
258
+ yield result, operation if block_given?
259
+ end
260
+ rescue ::Gapic::Rest::Error => e
261
+ raise ::Google::Cloud::Error.from_error(e)
262
+ end
263
+
264
+ ##
265
+ # Configuration class for the Advice REST API.
266
+ #
267
+ # This class represents the configuration for Advice REST,
268
+ # providing control over timeouts, retry behavior, logging, transport
269
+ # parameters, and other low-level controls. Certain parameters can also be
270
+ # applied individually to specific RPCs. See
271
+ # {::Google::Cloud::Compute::V1::Advice::Rest::Client::Configuration::Rpcs}
272
+ # for a list of RPCs that can be configured independently.
273
+ #
274
+ # Configuration can be applied globally to all clients, or to a single client
275
+ # on construction.
276
+ #
277
+ # @example
278
+ #
279
+ # # Modify the global config, setting the timeout for
280
+ # # calendar_mode to 20 seconds,
281
+ # # and all remaining timeouts to 10 seconds.
282
+ # ::Google::Cloud::Compute::V1::Advice::Rest::Client.configure do |config|
283
+ # config.timeout = 10.0
284
+ # config.rpcs.calendar_mode.timeout = 20.0
285
+ # end
286
+ #
287
+ # # Apply the above configuration only to a new client.
288
+ # client = ::Google::Cloud::Compute::V1::Advice::Rest::Client.new do |config|
289
+ # config.timeout = 10.0
290
+ # config.rpcs.calendar_mode.timeout = 20.0
291
+ # end
292
+ #
293
+ # @!attribute [rw] endpoint
294
+ # A custom service endpoint, as a hostname or hostname:port. The default is
295
+ # nil, indicating to use the default endpoint in the current universe domain.
296
+ # @return [::String,nil]
297
+ # @!attribute [rw] credentials
298
+ # Credentials to send with calls. You may provide any of the following types:
299
+ # * (`String`) The path to a service account key file in JSON format
300
+ # * (`Hash`) A service account key as a Hash
301
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
302
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
303
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
304
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
305
+ # * (`nil`) indicating no credentials
306
+ #
307
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
308
+ # external source for authentication to Google Cloud, you must validate it before
309
+ # providing it to a Google API client library. Providing an unvalidated credential
310
+ # configuration to Google APIs can compromise the security of your systems and data.
311
+ # For more information, refer to [Validate credential configurations from external
312
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
313
+ # @return [::Object]
314
+ # @!attribute [rw] scope
315
+ # The OAuth scopes
316
+ # @return [::Array<::String>]
317
+ # @!attribute [rw] lib_name
318
+ # The library name as recorded in instrumentation and logging
319
+ # @return [::String]
320
+ # @!attribute [rw] lib_version
321
+ # The library version as recorded in instrumentation and logging
322
+ # @return [::String]
323
+ # @!attribute [rw] timeout
324
+ # The call timeout in seconds.
325
+ # @return [::Numeric]
326
+ # @!attribute [rw] metadata
327
+ # Additional headers to be sent with the call.
328
+ # @return [::Hash{::Symbol=>::String}]
329
+ # @!attribute [rw] retry_policy
330
+ # The retry policy. The value is a hash with the following keys:
331
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
332
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
333
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
334
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
335
+ # trigger a retry.
336
+ # @return [::Hash]
337
+ # @!attribute [rw] quota_project
338
+ # A separate project against which to charge quota.
339
+ # @return [::String]
340
+ # @!attribute [rw] universe_domain
341
+ # The universe domain within which to make requests. This determines the
342
+ # default endpoint URL. The default value of nil uses the environment
343
+ # universe (usually the default "googleapis.com" universe).
344
+ # @return [::String,nil]
345
+ # @!attribute [rw] logger
346
+ # A custom logger to use for request/response debug logging, or the value
347
+ # `:default` (the default) to construct a default logger, or `nil` to
348
+ # explicitly disable logging.
349
+ # @return [::Logger,:default,nil]
350
+ #
351
+ class Configuration
352
+ extend ::Gapic::Config
353
+
354
+ # @private
355
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
356
+ DEFAULT_ENDPOINT = "compute.googleapis.com"
357
+
358
+ config_attr :endpoint, nil, ::String, nil
359
+ config_attr :credentials, nil do |value|
360
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
361
+ allowed.any? { |klass| klass === value }
362
+ end
363
+ config_attr :scope, nil, ::String, ::Array, nil
364
+ config_attr :lib_name, nil, ::String, nil
365
+ config_attr :lib_version, nil, ::String, nil
366
+ config_attr :timeout, nil, ::Numeric, nil
367
+ config_attr :metadata, nil, ::Hash, nil
368
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
369
+ config_attr :quota_project, nil, ::String, nil
370
+ config_attr :universe_domain, nil, ::String, nil
371
+ config_attr :logger, :default, ::Logger, nil, :default
372
+
373
+ # @private
374
+ def initialize parent_config = nil
375
+ @parent_config = parent_config unless parent_config.nil?
376
+
377
+ yield self if block_given?
378
+ end
379
+
380
+ ##
381
+ # Configurations for individual RPCs
382
+ # @return [Rpcs]
383
+ #
384
+ def rpcs
385
+ @rpcs ||= begin
386
+ parent_rpcs = nil
387
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
388
+ Rpcs.new parent_rpcs
389
+ end
390
+ end
391
+
392
+ ##
393
+ # Configuration RPC class for the Advice API.
394
+ #
395
+ # Includes fields providing the configuration for each RPC in this service.
396
+ # Each configuration object is of type `Gapic::Config::Method` and includes
397
+ # the following configuration fields:
398
+ #
399
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
400
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
401
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
402
+ # include the following keys:
403
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
404
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
405
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
406
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
407
+ # trigger a retry.
408
+ #
409
+ class Rpcs
410
+ ##
411
+ # RPC-specific configuration for `calendar_mode`
412
+ # @return [::Gapic::Config::Method]
413
+ #
414
+ attr_reader :calendar_mode
415
+
416
+ # @private
417
+ def initialize parent_rpcs = nil
418
+ calendar_mode_config = parent_rpcs.calendar_mode if parent_rpcs.respond_to? :calendar_mode
419
+ @calendar_mode = ::Gapic::Config::Method.new calendar_mode_config
420
+
421
+ yield self if block_given?
422
+ end
423
+ end
424
+ end
425
+ end
426
+ end
427
+ end
428
+ end
429
+ end
430
+ end
431
+ end
@@ -0,0 +1,144 @@
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/compute/v1/compute_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Compute
24
+ module V1
25
+ module Advice
26
+ module Rest
27
+ ##
28
+ # REST service stub for the Advice service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
35
+ # These require statements are intentionally placed here to initialize
36
+ # the REST modules only when it's required.
37
+ require "gapic/rest"
38
+
39
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
40
+ endpoint_template: endpoint_template,
41
+ universe_domain: universe_domain,
42
+ credentials: credentials,
43
+ numeric_enums: false,
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
47
+ end
48
+
49
+ ##
50
+ # The effective universe domain
51
+ #
52
+ # @return [String]
53
+ #
54
+ def universe_domain
55
+ @client_stub.universe_domain
56
+ end
57
+
58
+ ##
59
+ # The effective endpoint
60
+ #
61
+ # @return [String]
62
+ #
63
+ def endpoint
64
+ @client_stub.endpoint
65
+ end
66
+
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
76
+ ##
77
+ # Baseline implementation for the calendar_mode REST call
78
+ #
79
+ # @param request_pb [::Google::Cloud::Compute::V1::CalendarModeAdviceRpcRequest]
80
+ # A request object representing the call parameters. Required.
81
+ # @param options [::Gapic::CallOptions]
82
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
83
+ #
84
+ # @yield [result, operation] Access the result along with the TransportOperation object
85
+ # @yieldparam result [::Google::Cloud::Compute::V1::CalendarModeAdviceResponse]
86
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
87
+ #
88
+ # @return [::Google::Cloud::Compute::V1::CalendarModeAdviceResponse]
89
+ # A result object deserialized from the server's reply
90
+ def calendar_mode request_pb, options = nil
91
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
92
+
93
+ verb, uri, query_string_params, body = ServiceStub.transcode_calendar_mode_request request_pb
94
+ query_string_params = if query_string_params.any?
95
+ query_string_params.to_h { |p| p.split "=", 2 }
96
+ else
97
+ {}
98
+ end
99
+
100
+ response = @client_stub.make_http_request(
101
+ verb,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "calendar_mode",
106
+ options: options
107
+ )
108
+ operation = ::Gapic::Rest::TransportOperation.new response
109
+ result = ::Google::Cloud::Compute::V1::CalendarModeAdviceResponse.decode_json response.body, ignore_unknown_fields: true
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
114
+ end
115
+
116
+ ##
117
+ # @private
118
+ #
119
+ # GRPC transcoding helper method for the calendar_mode REST call
120
+ #
121
+ # @param request_pb [::Google::Cloud::Compute::V1::CalendarModeAdviceRpcRequest]
122
+ # A request object representing the call parameters. Required.
123
+ # @return [Array(String, [String, nil], Hash{String => String})]
124
+ # Uri, Body, Query string parameters
125
+ def self.transcode_calendar_mode_request request_pb
126
+ transcoder = Gapic::Rest::GrpcTranscoder.new
127
+ .with_bindings(
128
+ uri_method: :post,
129
+ uri_template: "/compute/v1/projects/{project}/regions/{region}/advice/calendarMode",
130
+ body: "calendar_mode_advice_request_resource",
131
+ matches: [
132
+ ["project", %r{^[^/]+/?$}, false],
133
+ ["region", %r{^[^/]+/?$}, false]
134
+ ]
135
+ )
136
+ transcoder.transcode request_pb
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
142
+ end
143
+ end
144
+ end
@@ -0,0 +1,51 @@
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 "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/compute/v1/version"
24
+
25
+ require "google/cloud/compute/v1/advice/credentials"
26
+ require "google/cloud/compute/v1/advice/rest/client"
27
+
28
+ module Google
29
+ module Cloud
30
+ module Compute
31
+ module V1
32
+ ##
33
+ # The Advice API.
34
+ #
35
+ # To load this service and instantiate a REST client:
36
+ #
37
+ # require "google/cloud/compute/v1/advice/rest"
38
+ # client = ::Google::Cloud::Compute::V1::Advice::Rest::Client.new
39
+ #
40
+ module Advice
41
+ # Client for the REST transport
42
+ module Rest
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
51
+ require "google/cloud/compute/v1/advice/rest/helpers" if ::File.file? helper_path
@@ -0,0 +1,47 @@
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 "gapic/config"
20
+ require "gapic/config/method"
21
+
22
+ require "google/cloud/compute/v1/version"
23
+
24
+ require "google/cloud/compute/v1/advice/credentials"
25
+ require "google/cloud/compute/v1/advice/rest"
26
+
27
+ module Google
28
+ module Cloud
29
+ module Compute
30
+ module V1
31
+ ##
32
+ # The Advice API.
33
+ #
34
+ # @example Load this service and instantiate a REST client
35
+ #
36
+ # require "google/cloud/compute/v1/advice/rest"
37
+ # client = ::Google::Cloud::Compute::V1::Advice::Rest::Client.new
38
+ #
39
+ module Advice
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+
46
+ helper_path = ::File.join __dir__, "advice", "helpers.rb"
47
+ require "google/cloud/compute/v1/advice/helpers" if ::File.file? helper_path