google-cloud-edge_container-v1 0.a → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/edge_container/v1/bindings_override.rb +102 -0
  6. data/lib/google/cloud/edge_container/v1/edge_container/client.rb +2486 -0
  7. data/lib/google/cloud/edge_container/v1/edge_container/credentials.rb +47 -0
  8. data/lib/google/cloud/edge_container/v1/edge_container/operations.rb +809 -0
  9. data/lib/google/cloud/edge_container/v1/edge_container/paths.rb +172 -0
  10. data/lib/google/cloud/edge_container/v1/edge_container/rest/client.rb +2324 -0
  11. data/lib/google/cloud/edge_container/v1/edge_container/rest/operations.rb +902 -0
  12. data/lib/google/cloud/edge_container/v1/edge_container/rest/service_stub.rb +1255 -0
  13. data/lib/google/cloud/edge_container/v1/edge_container/rest.rb +55 -0
  14. data/lib/google/cloud/edge_container/v1/edge_container.rb +57 -0
  15. data/lib/google/cloud/edge_container/v1/rest.rb +38 -0
  16. data/lib/google/cloud/edge_container/v1/version.rb +7 -2
  17. data/lib/google/cloud/edge_container/v1.rb +45 -0
  18. data/lib/google/cloud/edgecontainer/v1/resources_pb.rb +92 -0
  19. data/lib/google/cloud/edgecontainer/v1/service_pb.rb +81 -0
  20. data/lib/google/cloud/edgecontainer/v1/service_services_pb.rb +84 -0
  21. data/lib/google-cloud-edge_container-v1.rb +21 -0
  22. data/proto_docs/README.md +4 -0
  23. data/proto_docs/google/api/client.rb +399 -0
  24. data/proto_docs/google/api/field_behavior.rb +85 -0
  25. data/proto_docs/google/api/launch_stage.rb +71 -0
  26. data/proto_docs/google/api/resource.rb +222 -0
  27. data/proto_docs/google/cloud/edgecontainer/v1/resources.rb +881 -0
  28. data/proto_docs/google/cloud/edgecontainer/v1/service.rb +475 -0
  29. data/proto_docs/google/longrunning/operations.rb +164 -0
  30. data/proto_docs/google/protobuf/any.rb +145 -0
  31. data/proto_docs/google/protobuf/duration.rb +98 -0
  32. data/proto_docs/google/protobuf/empty.rb +34 -0
  33. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  34. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  35. data/proto_docs/google/rpc/status.rb +48 -0
  36. metadata +96 -10
@@ -0,0 +1,2324 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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/edgecontainer/v1/service_pb"
21
+ require "google/cloud/edge_container/v1/edge_container/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module EdgeContainer
27
+ module V1
28
+ module EdgeContainer
29
+ module Rest
30
+ ##
31
+ # REST client for the EdgeContainer service.
32
+ #
33
+ # EdgeContainer API provides management of Kubernetes Clusters on Google Edge
34
+ # Cloud deployments.
35
+ #
36
+ class Client
37
+ # @private
38
+ API_VERSION = ""
39
+
40
+ # @private
41
+ DEFAULT_ENDPOINT_TEMPLATE = "edgecontainer.$UNIVERSE_DOMAIN$"
42
+
43
+ include Paths
44
+
45
+ # @private
46
+ attr_reader :edge_container_stub
47
+
48
+ ##
49
+ # Configure the EdgeContainer Client class.
50
+ #
51
+ # See {::Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client::Configuration}
52
+ # for a description of the configuration fields.
53
+ #
54
+ # @example
55
+ #
56
+ # # Modify the configuration for all EdgeContainer clients
57
+ # ::Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.configure do |config|
58
+ # config.timeout = 10.0
59
+ # end
60
+ #
61
+ # @yield [config] Configure the Client client.
62
+ # @yieldparam config [Client::Configuration]
63
+ #
64
+ # @return [Client::Configuration]
65
+ #
66
+ def self.configure
67
+ @configure ||= begin
68
+ namespace = ["Google", "Cloud", "EdgeContainer", "V1"]
69
+ parent_config = while namespace.any?
70
+ parent_name = namespace.join "::"
71
+ parent_const = const_get parent_name
72
+ break parent_const.configure if parent_const.respond_to? :configure
73
+ namespace.pop
74
+ end
75
+ default_config = Client::Configuration.new parent_config
76
+
77
+ default_config.rpcs.list_clusters.timeout = 60.0
78
+ default_config.rpcs.list_clusters.retry_policy = {
79
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
80
+ }
81
+
82
+ default_config.rpcs.get_cluster.timeout = 60.0
83
+ default_config.rpcs.get_cluster.retry_policy = {
84
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
85
+ }
86
+
87
+ default_config.rpcs.create_cluster.timeout = 60.0
88
+
89
+ default_config.rpcs.update_cluster.timeout = 60.0
90
+
91
+ default_config.rpcs.upgrade_cluster.timeout = 60.0
92
+
93
+ default_config.rpcs.delete_cluster.timeout = 60.0
94
+
95
+ default_config.rpcs.generate_access_token.timeout = 60.0
96
+ default_config.rpcs.generate_access_token.retry_policy = {
97
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
98
+ }
99
+
100
+ default_config.rpcs.generate_offline_credential.timeout = 60.0
101
+ default_config.rpcs.generate_offline_credential.retry_policy = {
102
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
103
+ }
104
+
105
+ default_config.rpcs.list_node_pools.timeout = 60.0
106
+ default_config.rpcs.list_node_pools.retry_policy = {
107
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
108
+ }
109
+
110
+ default_config.rpcs.get_node_pool.timeout = 60.0
111
+ default_config.rpcs.get_node_pool.retry_policy = {
112
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
113
+ }
114
+
115
+ default_config.rpcs.create_node_pool.timeout = 60.0
116
+
117
+ default_config.rpcs.update_node_pool.timeout = 60.0
118
+
119
+ default_config.rpcs.delete_node_pool.timeout = 60.0
120
+
121
+ default_config.rpcs.list_machines.timeout = 60.0
122
+ default_config.rpcs.list_machines.retry_policy = {
123
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
124
+ }
125
+
126
+ default_config.rpcs.get_machine.timeout = 60.0
127
+ default_config.rpcs.get_machine.retry_policy = {
128
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
129
+ }
130
+
131
+ default_config.rpcs.list_vpn_connections.timeout = 60.0
132
+ default_config.rpcs.list_vpn_connections.retry_policy = {
133
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
134
+ }
135
+
136
+ default_config.rpcs.get_vpn_connection.timeout = 60.0
137
+ default_config.rpcs.get_vpn_connection.retry_policy = {
138
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
139
+ }
140
+
141
+ default_config.rpcs.create_vpn_connection.timeout = 60.0
142
+
143
+ default_config.rpcs.delete_vpn_connection.timeout = 60.0
144
+
145
+ default_config.rpcs.get_server_config.timeout = 60.0
146
+ default_config.rpcs.get_server_config.retry_policy = {
147
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
148
+ }
149
+
150
+ default_config
151
+ end
152
+ yield @configure if block_given?
153
+ @configure
154
+ end
155
+
156
+ ##
157
+ # Configure the EdgeContainer Client instance.
158
+ #
159
+ # The configuration is set to the derived mode, meaning that values can be changed,
160
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
161
+ # should be made on {Client.configure}.
162
+ #
163
+ # See {::Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client::Configuration}
164
+ # for a description of the configuration fields.
165
+ #
166
+ # @yield [config] Configure the Client client.
167
+ # @yieldparam config [Client::Configuration]
168
+ #
169
+ # @return [Client::Configuration]
170
+ #
171
+ def configure
172
+ yield @config if block_given?
173
+ @config
174
+ end
175
+
176
+ ##
177
+ # The effective universe domain
178
+ #
179
+ # @return [String]
180
+ #
181
+ def universe_domain
182
+ @edge_container_stub.universe_domain
183
+ end
184
+
185
+ ##
186
+ # Create a new EdgeContainer REST client object.
187
+ #
188
+ # @example
189
+ #
190
+ # # Create a client using the default configuration
191
+ # client = ::Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
192
+ #
193
+ # # Create a client using a custom configuration
194
+ # client = ::Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new do |config|
195
+ # config.timeout = 10.0
196
+ # end
197
+ #
198
+ # @yield [config] Configure the EdgeContainer client.
199
+ # @yieldparam config [Client::Configuration]
200
+ #
201
+ def initialize
202
+ # Create the configuration object
203
+ @config = Configuration.new Client.configure
204
+
205
+ # Yield the configuration if needed
206
+ yield @config if block_given?
207
+
208
+ # Create credentials
209
+ credentials = @config.credentials
210
+ # Use self-signed JWT if the endpoint is unchanged from default,
211
+ # but only if the default endpoint does not have a region prefix.
212
+ enable_self_signed_jwt = @config.endpoint.nil? ||
213
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
214
+ !@config.endpoint.split(".").first.include?("-"))
215
+ credentials ||= Credentials.default scope: @config.scope,
216
+ enable_self_signed_jwt: enable_self_signed_jwt
217
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
218
+ credentials = Credentials.new credentials, scope: @config.scope
219
+ end
220
+
221
+ @quota_project_id = @config.quota_project
222
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
223
+
224
+ @operations_client = ::Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Operations.new do |config|
225
+ config.credentials = credentials
226
+ config.quota_project = @quota_project_id
227
+ config.endpoint = @config.endpoint
228
+ config.universe_domain = @config.universe_domain
229
+ end
230
+
231
+ @edge_container_stub = ::Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::ServiceStub.new(
232
+ endpoint: @config.endpoint,
233
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
234
+ universe_domain: @config.universe_domain,
235
+ credentials: credentials
236
+ )
237
+
238
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
239
+ config.credentials = credentials
240
+ config.quota_project = @quota_project_id
241
+ config.endpoint = @edge_container_stub.endpoint
242
+ config.universe_domain = @edge_container_stub.universe_domain
243
+ config.bindings_override = @config.bindings_override
244
+ end
245
+ end
246
+
247
+ ##
248
+ # Get the associated client for long-running operations.
249
+ #
250
+ # @return [::Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Operations]
251
+ #
252
+ attr_reader :operations_client
253
+
254
+ ##
255
+ # Get the associated client for mix-in of the Locations.
256
+ #
257
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
258
+ #
259
+ attr_reader :location_client
260
+
261
+ # Service calls
262
+
263
+ ##
264
+ # Lists Clusters in a given project and location.
265
+ #
266
+ # @overload list_clusters(request, options = nil)
267
+ # Pass arguments to `list_clusters` via a request object, either of type
268
+ # {::Google::Cloud::EdgeContainer::V1::ListClustersRequest} or an equivalent Hash.
269
+ #
270
+ # @param request [::Google::Cloud::EdgeContainer::V1::ListClustersRequest, ::Hash]
271
+ # A request object representing the call parameters. Required. To specify no
272
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
273
+ # @param options [::Gapic::CallOptions, ::Hash]
274
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
275
+ #
276
+ # @overload list_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
277
+ # Pass arguments to `list_clusters` via keyword arguments. Note that at
278
+ # least one keyword argument is required. To specify no parameters, or to keep all
279
+ # the default parameter values, pass an empty Hash as a request object (see above).
280
+ #
281
+ # @param parent [::String]
282
+ # Required. The parent location, which owns this collection of clusters.
283
+ # @param page_size [::Integer]
284
+ # The maximum number of resources to list.
285
+ # @param page_token [::String]
286
+ # A page token received from previous list request.
287
+ # A page token received from previous list request.
288
+ # @param filter [::String]
289
+ # Only resources matching this filter will be listed.
290
+ # @param order_by [::String]
291
+ # Specifies the order in which resources will be listed.
292
+ # @yield [result, operation] Access the result along with the TransportOperation object
293
+ # @yieldparam result [::Google::Cloud::EdgeContainer::V1::ListClustersResponse]
294
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
295
+ #
296
+ # @return [::Google::Cloud::EdgeContainer::V1::ListClustersResponse]
297
+ #
298
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
299
+ #
300
+ # @example Basic example
301
+ # require "google/cloud/edge_container/v1"
302
+ #
303
+ # # Create a client object. The client can be reused for multiple calls.
304
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
305
+ #
306
+ # # Create a request. To set request fields, pass in keyword arguments.
307
+ # request = Google::Cloud::EdgeContainer::V1::ListClustersRequest.new
308
+ #
309
+ # # Call the list_clusters method.
310
+ # result = client.list_clusters request
311
+ #
312
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
313
+ # # over elements, and API calls will be issued to fetch pages as needed.
314
+ # result.each do |item|
315
+ # # Each element is of type ::Google::Cloud::EdgeContainer::V1::Cluster.
316
+ # p item
317
+ # end
318
+ #
319
+ def list_clusters request, options = nil
320
+ raise ::ArgumentError, "request must be provided" if request.nil?
321
+
322
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::ListClustersRequest
323
+
324
+ # Converts hash and nil to an options object
325
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
326
+
327
+ # Customize the options with defaults
328
+ call_metadata = @config.rpcs.list_clusters.metadata.to_h
329
+
330
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
331
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
332
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
333
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
334
+ transports_version_send: [:rest]
335
+
336
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
337
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
338
+
339
+ options.apply_defaults timeout: @config.rpcs.list_clusters.timeout,
340
+ metadata: call_metadata,
341
+ retry_policy: @config.rpcs.list_clusters.retry_policy
342
+
343
+ options.apply_defaults timeout: @config.timeout,
344
+ metadata: @config.metadata,
345
+ retry_policy: @config.retry_policy
346
+
347
+ @edge_container_stub.list_clusters request, options do |result, operation|
348
+ yield result, operation if block_given?
349
+ return result
350
+ end
351
+ rescue ::Gapic::Rest::Error => e
352
+ raise ::Google::Cloud::Error.from_error(e)
353
+ end
354
+
355
+ ##
356
+ # Gets details of a single Cluster.
357
+ #
358
+ # @overload get_cluster(request, options = nil)
359
+ # Pass arguments to `get_cluster` via a request object, either of type
360
+ # {::Google::Cloud::EdgeContainer::V1::GetClusterRequest} or an equivalent Hash.
361
+ #
362
+ # @param request [::Google::Cloud::EdgeContainer::V1::GetClusterRequest, ::Hash]
363
+ # A request object representing the call parameters. Required. To specify no
364
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
365
+ # @param options [::Gapic::CallOptions, ::Hash]
366
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
367
+ #
368
+ # @overload get_cluster(name: nil)
369
+ # Pass arguments to `get_cluster` via keyword arguments. Note that at
370
+ # least one keyword argument is required. To specify no parameters, or to keep all
371
+ # the default parameter values, pass an empty Hash as a request object (see above).
372
+ #
373
+ # @param name [::String]
374
+ # Required. The resource name of the cluster.
375
+ # @yield [result, operation] Access the result along with the TransportOperation object
376
+ # @yieldparam result [::Google::Cloud::EdgeContainer::V1::Cluster]
377
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
378
+ #
379
+ # @return [::Google::Cloud::EdgeContainer::V1::Cluster]
380
+ #
381
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
382
+ #
383
+ # @example Basic example
384
+ # require "google/cloud/edge_container/v1"
385
+ #
386
+ # # Create a client object. The client can be reused for multiple calls.
387
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
388
+ #
389
+ # # Create a request. To set request fields, pass in keyword arguments.
390
+ # request = Google::Cloud::EdgeContainer::V1::GetClusterRequest.new
391
+ #
392
+ # # Call the get_cluster method.
393
+ # result = client.get_cluster request
394
+ #
395
+ # # The returned object is of type Google::Cloud::EdgeContainer::V1::Cluster.
396
+ # p result
397
+ #
398
+ def get_cluster request, options = nil
399
+ raise ::ArgumentError, "request must be provided" if request.nil?
400
+
401
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::GetClusterRequest
402
+
403
+ # Converts hash and nil to an options object
404
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
405
+
406
+ # Customize the options with defaults
407
+ call_metadata = @config.rpcs.get_cluster.metadata.to_h
408
+
409
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
410
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
411
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
412
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
413
+ transports_version_send: [:rest]
414
+
415
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
416
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
417
+
418
+ options.apply_defaults timeout: @config.rpcs.get_cluster.timeout,
419
+ metadata: call_metadata,
420
+ retry_policy: @config.rpcs.get_cluster.retry_policy
421
+
422
+ options.apply_defaults timeout: @config.timeout,
423
+ metadata: @config.metadata,
424
+ retry_policy: @config.retry_policy
425
+
426
+ @edge_container_stub.get_cluster request, options do |result, operation|
427
+ yield result, operation if block_given?
428
+ return result
429
+ end
430
+ rescue ::Gapic::Rest::Error => e
431
+ raise ::Google::Cloud::Error.from_error(e)
432
+ end
433
+
434
+ ##
435
+ # Creates a new Cluster in a given project and location.
436
+ #
437
+ # @overload create_cluster(request, options = nil)
438
+ # Pass arguments to `create_cluster` via a request object, either of type
439
+ # {::Google::Cloud::EdgeContainer::V1::CreateClusterRequest} or an equivalent Hash.
440
+ #
441
+ # @param request [::Google::Cloud::EdgeContainer::V1::CreateClusterRequest, ::Hash]
442
+ # A request object representing the call parameters. Required. To specify no
443
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
444
+ # @param options [::Gapic::CallOptions, ::Hash]
445
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
446
+ #
447
+ # @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil)
448
+ # Pass arguments to `create_cluster` via keyword arguments. Note that at
449
+ # least one keyword argument is required. To specify no parameters, or to keep all
450
+ # the default parameter values, pass an empty Hash as a request object (see above).
451
+ #
452
+ # @param parent [::String]
453
+ # Required. The parent location where this cluster will be created.
454
+ # @param cluster_id [::String]
455
+ # Required. A client-specified unique identifier for the cluster.
456
+ # @param cluster [::Google::Cloud::EdgeContainer::V1::Cluster, ::Hash]
457
+ # Required. The cluster to create.
458
+ # @param request_id [::String]
459
+ # A unique identifier for this request. Restricted to 36 ASCII characters. A
460
+ # random UUID is recommended. This request is only idempotent if
461
+ # `request_id` is provided.
462
+ # @yield [result, operation] Access the result along with the TransportOperation object
463
+ # @yieldparam result [::Gapic::Operation]
464
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
465
+ #
466
+ # @return [::Gapic::Operation]
467
+ #
468
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
469
+ #
470
+ # @example Basic example
471
+ # require "google/cloud/edge_container/v1"
472
+ #
473
+ # # Create a client object. The client can be reused for multiple calls.
474
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
475
+ #
476
+ # # Create a request. To set request fields, pass in keyword arguments.
477
+ # request = Google::Cloud::EdgeContainer::V1::CreateClusterRequest.new
478
+ #
479
+ # # Call the create_cluster method.
480
+ # result = client.create_cluster request
481
+ #
482
+ # # The returned object is of type Gapic::Operation. You can use it to
483
+ # # check the status of an operation, cancel it, or wait for results.
484
+ # # Here is how to wait for a response.
485
+ # result.wait_until_done! timeout: 60
486
+ # if result.response?
487
+ # p result.response
488
+ # else
489
+ # puts "No response received."
490
+ # end
491
+ #
492
+ def create_cluster request, options = nil
493
+ raise ::ArgumentError, "request must be provided" if request.nil?
494
+
495
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::CreateClusterRequest
496
+
497
+ # Converts hash and nil to an options object
498
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
499
+
500
+ # Customize the options with defaults
501
+ call_metadata = @config.rpcs.create_cluster.metadata.to_h
502
+
503
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
504
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
505
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
506
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
507
+ transports_version_send: [:rest]
508
+
509
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
510
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
511
+
512
+ options.apply_defaults timeout: @config.rpcs.create_cluster.timeout,
513
+ metadata: call_metadata,
514
+ retry_policy: @config.rpcs.create_cluster.retry_policy
515
+
516
+ options.apply_defaults timeout: @config.timeout,
517
+ metadata: @config.metadata,
518
+ retry_policy: @config.retry_policy
519
+
520
+ @edge_container_stub.create_cluster request, options do |result, operation|
521
+ result = ::Gapic::Operation.new result, @operations_client, options: options
522
+ yield result, operation if block_given?
523
+ return result
524
+ end
525
+ rescue ::Gapic::Rest::Error => e
526
+ raise ::Google::Cloud::Error.from_error(e)
527
+ end
528
+
529
+ ##
530
+ # Updates the parameters of a single Cluster.
531
+ #
532
+ # @overload update_cluster(request, options = nil)
533
+ # Pass arguments to `update_cluster` via a request object, either of type
534
+ # {::Google::Cloud::EdgeContainer::V1::UpdateClusterRequest} or an equivalent Hash.
535
+ #
536
+ # @param request [::Google::Cloud::EdgeContainer::V1::UpdateClusterRequest, ::Hash]
537
+ # A request object representing the call parameters. Required. To specify no
538
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
539
+ # @param options [::Gapic::CallOptions, ::Hash]
540
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
541
+ #
542
+ # @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil)
543
+ # Pass arguments to `update_cluster` via keyword arguments. Note that at
544
+ # least one keyword argument is required. To specify no parameters, or to keep all
545
+ # the default parameter values, pass an empty Hash as a request object (see above).
546
+ #
547
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
548
+ # Field mask is used to specify the fields to be overwritten in the
549
+ # Cluster resource by the update.
550
+ # The fields specified in the update_mask are relative to the resource, not
551
+ # the full request. A field will be overwritten if it is in the mask. If the
552
+ # user does not provide a mask then all fields will be overwritten.
553
+ # @param cluster [::Google::Cloud::EdgeContainer::V1::Cluster, ::Hash]
554
+ # The updated cluster.
555
+ # @param request_id [::String]
556
+ # A unique identifier for this request. Restricted to 36 ASCII characters.
557
+ # A random UUID is recommended.
558
+ # This request is only idempotent if `request_id` is provided.
559
+ # @yield [result, operation] Access the result along with the TransportOperation object
560
+ # @yieldparam result [::Gapic::Operation]
561
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
562
+ #
563
+ # @return [::Gapic::Operation]
564
+ #
565
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
566
+ #
567
+ # @example Basic example
568
+ # require "google/cloud/edge_container/v1"
569
+ #
570
+ # # Create a client object. The client can be reused for multiple calls.
571
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
572
+ #
573
+ # # Create a request. To set request fields, pass in keyword arguments.
574
+ # request = Google::Cloud::EdgeContainer::V1::UpdateClusterRequest.new
575
+ #
576
+ # # Call the update_cluster method.
577
+ # result = client.update_cluster request
578
+ #
579
+ # # The returned object is of type Gapic::Operation. You can use it to
580
+ # # check the status of an operation, cancel it, or wait for results.
581
+ # # Here is how to wait for a response.
582
+ # result.wait_until_done! timeout: 60
583
+ # if result.response?
584
+ # p result.response
585
+ # else
586
+ # puts "No response received."
587
+ # end
588
+ #
589
+ def update_cluster request, options = nil
590
+ raise ::ArgumentError, "request must be provided" if request.nil?
591
+
592
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::UpdateClusterRequest
593
+
594
+ # Converts hash and nil to an options object
595
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
596
+
597
+ # Customize the options with defaults
598
+ call_metadata = @config.rpcs.update_cluster.metadata.to_h
599
+
600
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
601
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
602
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
603
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
604
+ transports_version_send: [:rest]
605
+
606
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
607
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
608
+
609
+ options.apply_defaults timeout: @config.rpcs.update_cluster.timeout,
610
+ metadata: call_metadata,
611
+ retry_policy: @config.rpcs.update_cluster.retry_policy
612
+
613
+ options.apply_defaults timeout: @config.timeout,
614
+ metadata: @config.metadata,
615
+ retry_policy: @config.retry_policy
616
+
617
+ @edge_container_stub.update_cluster request, options do |result, operation|
618
+ result = ::Gapic::Operation.new result, @operations_client, options: options
619
+ yield result, operation if block_given?
620
+ return result
621
+ end
622
+ rescue ::Gapic::Rest::Error => e
623
+ raise ::Google::Cloud::Error.from_error(e)
624
+ end
625
+
626
+ ##
627
+ # Upgrades a single cluster.
628
+ #
629
+ # @overload upgrade_cluster(request, options = nil)
630
+ # Pass arguments to `upgrade_cluster` via a request object, either of type
631
+ # {::Google::Cloud::EdgeContainer::V1::UpgradeClusterRequest} or an equivalent Hash.
632
+ #
633
+ # @param request [::Google::Cloud::EdgeContainer::V1::UpgradeClusterRequest, ::Hash]
634
+ # A request object representing the call parameters. Required. To specify no
635
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
636
+ # @param options [::Gapic::CallOptions, ::Hash]
637
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
638
+ #
639
+ # @overload upgrade_cluster(name: nil, target_version: nil, schedule: nil, request_id: nil)
640
+ # Pass arguments to `upgrade_cluster` via keyword arguments. Note that at
641
+ # least one keyword argument is required. To specify no parameters, or to keep all
642
+ # the default parameter values, pass an empty Hash as a request object (see above).
643
+ #
644
+ # @param name [::String]
645
+ # Required. The resource name of the cluster.
646
+ # @param target_version [::String]
647
+ # Required. The version the cluster is going to be upgraded to.
648
+ # @param schedule [::Google::Cloud::EdgeContainer::V1::UpgradeClusterRequest::Schedule]
649
+ # The schedule for the upgrade.
650
+ # @param request_id [::String]
651
+ # A unique identifier for this request. Restricted to 36 ASCII characters. A
652
+ # random UUID is recommended. This request is only idempotent if
653
+ # `request_id` is provided.
654
+ # @yield [result, operation] Access the result along with the TransportOperation object
655
+ # @yieldparam result [::Gapic::Operation]
656
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
657
+ #
658
+ # @return [::Gapic::Operation]
659
+ #
660
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
661
+ #
662
+ # @example Basic example
663
+ # require "google/cloud/edge_container/v1"
664
+ #
665
+ # # Create a client object. The client can be reused for multiple calls.
666
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
667
+ #
668
+ # # Create a request. To set request fields, pass in keyword arguments.
669
+ # request = Google::Cloud::EdgeContainer::V1::UpgradeClusterRequest.new
670
+ #
671
+ # # Call the upgrade_cluster method.
672
+ # result = client.upgrade_cluster request
673
+ #
674
+ # # The returned object is of type Gapic::Operation. You can use it to
675
+ # # check the status of an operation, cancel it, or wait for results.
676
+ # # Here is how to wait for a response.
677
+ # result.wait_until_done! timeout: 60
678
+ # if result.response?
679
+ # p result.response
680
+ # else
681
+ # puts "No response received."
682
+ # end
683
+ #
684
+ def upgrade_cluster request, options = nil
685
+ raise ::ArgumentError, "request must be provided" if request.nil?
686
+
687
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::UpgradeClusterRequest
688
+
689
+ # Converts hash and nil to an options object
690
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
691
+
692
+ # Customize the options with defaults
693
+ call_metadata = @config.rpcs.upgrade_cluster.metadata.to_h
694
+
695
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
696
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
697
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
698
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
699
+ transports_version_send: [:rest]
700
+
701
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
702
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
703
+
704
+ options.apply_defaults timeout: @config.rpcs.upgrade_cluster.timeout,
705
+ metadata: call_metadata,
706
+ retry_policy: @config.rpcs.upgrade_cluster.retry_policy
707
+
708
+ options.apply_defaults timeout: @config.timeout,
709
+ metadata: @config.metadata,
710
+ retry_policy: @config.retry_policy
711
+
712
+ @edge_container_stub.upgrade_cluster request, options do |result, operation|
713
+ result = ::Gapic::Operation.new result, @operations_client, options: options
714
+ yield result, operation if block_given?
715
+ return result
716
+ end
717
+ rescue ::Gapic::Rest::Error => e
718
+ raise ::Google::Cloud::Error.from_error(e)
719
+ end
720
+
721
+ ##
722
+ # Deletes a single Cluster.
723
+ #
724
+ # @overload delete_cluster(request, options = nil)
725
+ # Pass arguments to `delete_cluster` via a request object, either of type
726
+ # {::Google::Cloud::EdgeContainer::V1::DeleteClusterRequest} or an equivalent Hash.
727
+ #
728
+ # @param request [::Google::Cloud::EdgeContainer::V1::DeleteClusterRequest, ::Hash]
729
+ # A request object representing the call parameters. Required. To specify no
730
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
731
+ # @param options [::Gapic::CallOptions, ::Hash]
732
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
733
+ #
734
+ # @overload delete_cluster(name: nil, request_id: nil)
735
+ # Pass arguments to `delete_cluster` via keyword arguments. Note that at
736
+ # least one keyword argument is required. To specify no parameters, or to keep all
737
+ # the default parameter values, pass an empty Hash as a request object (see above).
738
+ #
739
+ # @param name [::String]
740
+ # Required. The resource name of the cluster.
741
+ # @param request_id [::String]
742
+ # A unique identifier for this request. Restricted to 36 ASCII characters. A
743
+ # random UUID is recommended. This request is only idempotent if
744
+ # `request_id` is provided.
745
+ # @yield [result, operation] Access the result along with the TransportOperation object
746
+ # @yieldparam result [::Gapic::Operation]
747
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
748
+ #
749
+ # @return [::Gapic::Operation]
750
+ #
751
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
752
+ #
753
+ # @example Basic example
754
+ # require "google/cloud/edge_container/v1"
755
+ #
756
+ # # Create a client object. The client can be reused for multiple calls.
757
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
758
+ #
759
+ # # Create a request. To set request fields, pass in keyword arguments.
760
+ # request = Google::Cloud::EdgeContainer::V1::DeleteClusterRequest.new
761
+ #
762
+ # # Call the delete_cluster method.
763
+ # result = client.delete_cluster request
764
+ #
765
+ # # The returned object is of type Gapic::Operation. You can use it to
766
+ # # check the status of an operation, cancel it, or wait for results.
767
+ # # Here is how to wait for a response.
768
+ # result.wait_until_done! timeout: 60
769
+ # if result.response?
770
+ # p result.response
771
+ # else
772
+ # puts "No response received."
773
+ # end
774
+ #
775
+ def delete_cluster request, options = nil
776
+ raise ::ArgumentError, "request must be provided" if request.nil?
777
+
778
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::DeleteClusterRequest
779
+
780
+ # Converts hash and nil to an options object
781
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
782
+
783
+ # Customize the options with defaults
784
+ call_metadata = @config.rpcs.delete_cluster.metadata.to_h
785
+
786
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
787
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
788
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
789
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
790
+ transports_version_send: [:rest]
791
+
792
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
793
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
794
+
795
+ options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout,
796
+ metadata: call_metadata,
797
+ retry_policy: @config.rpcs.delete_cluster.retry_policy
798
+
799
+ options.apply_defaults timeout: @config.timeout,
800
+ metadata: @config.metadata,
801
+ retry_policy: @config.retry_policy
802
+
803
+ @edge_container_stub.delete_cluster request, options do |result, operation|
804
+ result = ::Gapic::Operation.new result, @operations_client, options: options
805
+ yield result, operation if block_given?
806
+ return result
807
+ end
808
+ rescue ::Gapic::Rest::Error => e
809
+ raise ::Google::Cloud::Error.from_error(e)
810
+ end
811
+
812
+ ##
813
+ # Generates an access token for a Cluster.
814
+ #
815
+ # @overload generate_access_token(request, options = nil)
816
+ # Pass arguments to `generate_access_token` via a request object, either of type
817
+ # {::Google::Cloud::EdgeContainer::V1::GenerateAccessTokenRequest} or an equivalent Hash.
818
+ #
819
+ # @param request [::Google::Cloud::EdgeContainer::V1::GenerateAccessTokenRequest, ::Hash]
820
+ # A request object representing the call parameters. Required. To specify no
821
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
822
+ # @param options [::Gapic::CallOptions, ::Hash]
823
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
824
+ #
825
+ # @overload generate_access_token(cluster: nil)
826
+ # Pass arguments to `generate_access_token` via keyword arguments. Note that at
827
+ # least one keyword argument is required. To specify no parameters, or to keep all
828
+ # the default parameter values, pass an empty Hash as a request object (see above).
829
+ #
830
+ # @param cluster [::String]
831
+ # Required. The resource name of the cluster.
832
+ # @yield [result, operation] Access the result along with the TransportOperation object
833
+ # @yieldparam result [::Google::Cloud::EdgeContainer::V1::GenerateAccessTokenResponse]
834
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
835
+ #
836
+ # @return [::Google::Cloud::EdgeContainer::V1::GenerateAccessTokenResponse]
837
+ #
838
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
839
+ #
840
+ # @example Basic example
841
+ # require "google/cloud/edge_container/v1"
842
+ #
843
+ # # Create a client object. The client can be reused for multiple calls.
844
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
845
+ #
846
+ # # Create a request. To set request fields, pass in keyword arguments.
847
+ # request = Google::Cloud::EdgeContainer::V1::GenerateAccessTokenRequest.new
848
+ #
849
+ # # Call the generate_access_token method.
850
+ # result = client.generate_access_token request
851
+ #
852
+ # # The returned object is of type Google::Cloud::EdgeContainer::V1::GenerateAccessTokenResponse.
853
+ # p result
854
+ #
855
+ def generate_access_token request, options = nil
856
+ raise ::ArgumentError, "request must be provided" if request.nil?
857
+
858
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::GenerateAccessTokenRequest
859
+
860
+ # Converts hash and nil to an options object
861
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
862
+
863
+ # Customize the options with defaults
864
+ call_metadata = @config.rpcs.generate_access_token.metadata.to_h
865
+
866
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
867
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
868
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
869
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
870
+ transports_version_send: [:rest]
871
+
872
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
873
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
874
+
875
+ options.apply_defaults timeout: @config.rpcs.generate_access_token.timeout,
876
+ metadata: call_metadata,
877
+ retry_policy: @config.rpcs.generate_access_token.retry_policy
878
+
879
+ options.apply_defaults timeout: @config.timeout,
880
+ metadata: @config.metadata,
881
+ retry_policy: @config.retry_policy
882
+
883
+ @edge_container_stub.generate_access_token request, options do |result, operation|
884
+ yield result, operation if block_given?
885
+ return result
886
+ end
887
+ rescue ::Gapic::Rest::Error => e
888
+ raise ::Google::Cloud::Error.from_error(e)
889
+ end
890
+
891
+ ##
892
+ # Generates an offline credential for a Cluster.
893
+ #
894
+ # @overload generate_offline_credential(request, options = nil)
895
+ # Pass arguments to `generate_offline_credential` via a request object, either of type
896
+ # {::Google::Cloud::EdgeContainer::V1::GenerateOfflineCredentialRequest} or an equivalent Hash.
897
+ #
898
+ # @param request [::Google::Cloud::EdgeContainer::V1::GenerateOfflineCredentialRequest, ::Hash]
899
+ # A request object representing the call parameters. Required. To specify no
900
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
901
+ # @param options [::Gapic::CallOptions, ::Hash]
902
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
903
+ #
904
+ # @overload generate_offline_credential(cluster: nil)
905
+ # Pass arguments to `generate_offline_credential` via keyword arguments. Note that at
906
+ # least one keyword argument is required. To specify no parameters, or to keep all
907
+ # the default parameter values, pass an empty Hash as a request object (see above).
908
+ #
909
+ # @param cluster [::String]
910
+ # Required. The resource name of the cluster.
911
+ # @yield [result, operation] Access the result along with the TransportOperation object
912
+ # @yieldparam result [::Google::Cloud::EdgeContainer::V1::GenerateOfflineCredentialResponse]
913
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
914
+ #
915
+ # @return [::Google::Cloud::EdgeContainer::V1::GenerateOfflineCredentialResponse]
916
+ #
917
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
918
+ #
919
+ # @example Basic example
920
+ # require "google/cloud/edge_container/v1"
921
+ #
922
+ # # Create a client object. The client can be reused for multiple calls.
923
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
924
+ #
925
+ # # Create a request. To set request fields, pass in keyword arguments.
926
+ # request = Google::Cloud::EdgeContainer::V1::GenerateOfflineCredentialRequest.new
927
+ #
928
+ # # Call the generate_offline_credential method.
929
+ # result = client.generate_offline_credential request
930
+ #
931
+ # # The returned object is of type Google::Cloud::EdgeContainer::V1::GenerateOfflineCredentialResponse.
932
+ # p result
933
+ #
934
+ def generate_offline_credential request, options = nil
935
+ raise ::ArgumentError, "request must be provided" if request.nil?
936
+
937
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::GenerateOfflineCredentialRequest
938
+
939
+ # Converts hash and nil to an options object
940
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
941
+
942
+ # Customize the options with defaults
943
+ call_metadata = @config.rpcs.generate_offline_credential.metadata.to_h
944
+
945
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
946
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
947
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
948
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
949
+ transports_version_send: [:rest]
950
+
951
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
952
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
953
+
954
+ options.apply_defaults timeout: @config.rpcs.generate_offline_credential.timeout,
955
+ metadata: call_metadata,
956
+ retry_policy: @config.rpcs.generate_offline_credential.retry_policy
957
+
958
+ options.apply_defaults timeout: @config.timeout,
959
+ metadata: @config.metadata,
960
+ retry_policy: @config.retry_policy
961
+
962
+ @edge_container_stub.generate_offline_credential request, options do |result, operation|
963
+ yield result, operation if block_given?
964
+ return result
965
+ end
966
+ rescue ::Gapic::Rest::Error => e
967
+ raise ::Google::Cloud::Error.from_error(e)
968
+ end
969
+
970
+ ##
971
+ # Lists NodePools in a given project and location.
972
+ #
973
+ # @overload list_node_pools(request, options = nil)
974
+ # Pass arguments to `list_node_pools` via a request object, either of type
975
+ # {::Google::Cloud::EdgeContainer::V1::ListNodePoolsRequest} or an equivalent Hash.
976
+ #
977
+ # @param request [::Google::Cloud::EdgeContainer::V1::ListNodePoolsRequest, ::Hash]
978
+ # A request object representing the call parameters. Required. To specify no
979
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
980
+ # @param options [::Gapic::CallOptions, ::Hash]
981
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
982
+ #
983
+ # @overload list_node_pools(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
984
+ # Pass arguments to `list_node_pools` via keyword arguments. Note that at
985
+ # least one keyword argument is required. To specify no parameters, or to keep all
986
+ # the default parameter values, pass an empty Hash as a request object (see above).
987
+ #
988
+ # @param parent [::String]
989
+ # Required. The parent cluster, which owns this collection of node pools.
990
+ # @param page_size [::Integer]
991
+ # The maximum number of resources to list.
992
+ # @param page_token [::String]
993
+ # A page token received from previous list request.
994
+ # @param filter [::String]
995
+ # Only resources matching this filter will be listed.
996
+ # @param order_by [::String]
997
+ # Specifies the order in which resources will be listed.
998
+ # @yield [result, operation] Access the result along with the TransportOperation object
999
+ # @yieldparam result [::Google::Cloud::EdgeContainer::V1::ListNodePoolsResponse]
1000
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1001
+ #
1002
+ # @return [::Google::Cloud::EdgeContainer::V1::ListNodePoolsResponse]
1003
+ #
1004
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1005
+ #
1006
+ # @example Basic example
1007
+ # require "google/cloud/edge_container/v1"
1008
+ #
1009
+ # # Create a client object. The client can be reused for multiple calls.
1010
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
1011
+ #
1012
+ # # Create a request. To set request fields, pass in keyword arguments.
1013
+ # request = Google::Cloud::EdgeContainer::V1::ListNodePoolsRequest.new
1014
+ #
1015
+ # # Call the list_node_pools method.
1016
+ # result = client.list_node_pools request
1017
+ #
1018
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1019
+ # # over elements, and API calls will be issued to fetch pages as needed.
1020
+ # result.each do |item|
1021
+ # # Each element is of type ::Google::Cloud::EdgeContainer::V1::NodePool.
1022
+ # p item
1023
+ # end
1024
+ #
1025
+ def list_node_pools request, options = nil
1026
+ raise ::ArgumentError, "request must be provided" if request.nil?
1027
+
1028
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::ListNodePoolsRequest
1029
+
1030
+ # Converts hash and nil to an options object
1031
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1032
+
1033
+ # Customize the options with defaults
1034
+ call_metadata = @config.rpcs.list_node_pools.metadata.to_h
1035
+
1036
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1037
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1038
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1039
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
1040
+ transports_version_send: [:rest]
1041
+
1042
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1043
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1044
+
1045
+ options.apply_defaults timeout: @config.rpcs.list_node_pools.timeout,
1046
+ metadata: call_metadata,
1047
+ retry_policy: @config.rpcs.list_node_pools.retry_policy
1048
+
1049
+ options.apply_defaults timeout: @config.timeout,
1050
+ metadata: @config.metadata,
1051
+ retry_policy: @config.retry_policy
1052
+
1053
+ @edge_container_stub.list_node_pools request, options do |result, operation|
1054
+ yield result, operation if block_given?
1055
+ return result
1056
+ end
1057
+ rescue ::Gapic::Rest::Error => e
1058
+ raise ::Google::Cloud::Error.from_error(e)
1059
+ end
1060
+
1061
+ ##
1062
+ # Gets details of a single NodePool.
1063
+ #
1064
+ # @overload get_node_pool(request, options = nil)
1065
+ # Pass arguments to `get_node_pool` via a request object, either of type
1066
+ # {::Google::Cloud::EdgeContainer::V1::GetNodePoolRequest} or an equivalent Hash.
1067
+ #
1068
+ # @param request [::Google::Cloud::EdgeContainer::V1::GetNodePoolRequest, ::Hash]
1069
+ # A request object representing the call parameters. Required. To specify no
1070
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1071
+ # @param options [::Gapic::CallOptions, ::Hash]
1072
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1073
+ #
1074
+ # @overload get_node_pool(name: nil)
1075
+ # Pass arguments to `get_node_pool` via keyword arguments. Note that at
1076
+ # least one keyword argument is required. To specify no parameters, or to keep all
1077
+ # the default parameter values, pass an empty Hash as a request object (see above).
1078
+ #
1079
+ # @param name [::String]
1080
+ # Required. The resource name of the node pool.
1081
+ # @yield [result, operation] Access the result along with the TransportOperation object
1082
+ # @yieldparam result [::Google::Cloud::EdgeContainer::V1::NodePool]
1083
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1084
+ #
1085
+ # @return [::Google::Cloud::EdgeContainer::V1::NodePool]
1086
+ #
1087
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1088
+ #
1089
+ # @example Basic example
1090
+ # require "google/cloud/edge_container/v1"
1091
+ #
1092
+ # # Create a client object. The client can be reused for multiple calls.
1093
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
1094
+ #
1095
+ # # Create a request. To set request fields, pass in keyword arguments.
1096
+ # request = Google::Cloud::EdgeContainer::V1::GetNodePoolRequest.new
1097
+ #
1098
+ # # Call the get_node_pool method.
1099
+ # result = client.get_node_pool request
1100
+ #
1101
+ # # The returned object is of type Google::Cloud::EdgeContainer::V1::NodePool.
1102
+ # p result
1103
+ #
1104
+ def get_node_pool request, options = nil
1105
+ raise ::ArgumentError, "request must be provided" if request.nil?
1106
+
1107
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::GetNodePoolRequest
1108
+
1109
+ # Converts hash and nil to an options object
1110
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1111
+
1112
+ # Customize the options with defaults
1113
+ call_metadata = @config.rpcs.get_node_pool.metadata.to_h
1114
+
1115
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1116
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1117
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1118
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
1119
+ transports_version_send: [:rest]
1120
+
1121
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1122
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1123
+
1124
+ options.apply_defaults timeout: @config.rpcs.get_node_pool.timeout,
1125
+ metadata: call_metadata,
1126
+ retry_policy: @config.rpcs.get_node_pool.retry_policy
1127
+
1128
+ options.apply_defaults timeout: @config.timeout,
1129
+ metadata: @config.metadata,
1130
+ retry_policy: @config.retry_policy
1131
+
1132
+ @edge_container_stub.get_node_pool request, options do |result, operation|
1133
+ yield result, operation if block_given?
1134
+ return result
1135
+ end
1136
+ rescue ::Gapic::Rest::Error => e
1137
+ raise ::Google::Cloud::Error.from_error(e)
1138
+ end
1139
+
1140
+ ##
1141
+ # Creates a new NodePool in a given project and location.
1142
+ #
1143
+ # @overload create_node_pool(request, options = nil)
1144
+ # Pass arguments to `create_node_pool` via a request object, either of type
1145
+ # {::Google::Cloud::EdgeContainer::V1::CreateNodePoolRequest} or an equivalent Hash.
1146
+ #
1147
+ # @param request [::Google::Cloud::EdgeContainer::V1::CreateNodePoolRequest, ::Hash]
1148
+ # A request object representing the call parameters. Required. To specify no
1149
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1150
+ # @param options [::Gapic::CallOptions, ::Hash]
1151
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1152
+ #
1153
+ # @overload create_node_pool(parent: nil, node_pool_id: nil, node_pool: nil, request_id: nil)
1154
+ # Pass arguments to `create_node_pool` via keyword arguments. Note that at
1155
+ # least one keyword argument is required. To specify no parameters, or to keep all
1156
+ # the default parameter values, pass an empty Hash as a request object (see above).
1157
+ #
1158
+ # @param parent [::String]
1159
+ # Required. The parent cluster where this node pool will be created.
1160
+ # @param node_pool_id [::String]
1161
+ # Required. A client-specified unique identifier for the node pool.
1162
+ # @param node_pool [::Google::Cloud::EdgeContainer::V1::NodePool, ::Hash]
1163
+ # Required. The node pool to create.
1164
+ # @param request_id [::String]
1165
+ # A unique identifier for this request. Restricted to 36 ASCII characters. A
1166
+ # random UUID is recommended. This request is only idempotent if
1167
+ # `request_id` is provided.
1168
+ # @yield [result, operation] Access the result along with the TransportOperation object
1169
+ # @yieldparam result [::Gapic::Operation]
1170
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1171
+ #
1172
+ # @return [::Gapic::Operation]
1173
+ #
1174
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1175
+ #
1176
+ # @example Basic example
1177
+ # require "google/cloud/edge_container/v1"
1178
+ #
1179
+ # # Create a client object. The client can be reused for multiple calls.
1180
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
1181
+ #
1182
+ # # Create a request. To set request fields, pass in keyword arguments.
1183
+ # request = Google::Cloud::EdgeContainer::V1::CreateNodePoolRequest.new
1184
+ #
1185
+ # # Call the create_node_pool method.
1186
+ # result = client.create_node_pool request
1187
+ #
1188
+ # # The returned object is of type Gapic::Operation. You can use it to
1189
+ # # check the status of an operation, cancel it, or wait for results.
1190
+ # # Here is how to wait for a response.
1191
+ # result.wait_until_done! timeout: 60
1192
+ # if result.response?
1193
+ # p result.response
1194
+ # else
1195
+ # puts "No response received."
1196
+ # end
1197
+ #
1198
+ def create_node_pool request, options = nil
1199
+ raise ::ArgumentError, "request must be provided" if request.nil?
1200
+
1201
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::CreateNodePoolRequest
1202
+
1203
+ # Converts hash and nil to an options object
1204
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1205
+
1206
+ # Customize the options with defaults
1207
+ call_metadata = @config.rpcs.create_node_pool.metadata.to_h
1208
+
1209
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1210
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1211
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1212
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
1213
+ transports_version_send: [:rest]
1214
+
1215
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1216
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1217
+
1218
+ options.apply_defaults timeout: @config.rpcs.create_node_pool.timeout,
1219
+ metadata: call_metadata,
1220
+ retry_policy: @config.rpcs.create_node_pool.retry_policy
1221
+
1222
+ options.apply_defaults timeout: @config.timeout,
1223
+ metadata: @config.metadata,
1224
+ retry_policy: @config.retry_policy
1225
+
1226
+ @edge_container_stub.create_node_pool request, options do |result, operation|
1227
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1228
+ yield result, operation if block_given?
1229
+ return result
1230
+ end
1231
+ rescue ::Gapic::Rest::Error => e
1232
+ raise ::Google::Cloud::Error.from_error(e)
1233
+ end
1234
+
1235
+ ##
1236
+ # Updates the parameters of a single NodePool.
1237
+ #
1238
+ # @overload update_node_pool(request, options = nil)
1239
+ # Pass arguments to `update_node_pool` via a request object, either of type
1240
+ # {::Google::Cloud::EdgeContainer::V1::UpdateNodePoolRequest} or an equivalent Hash.
1241
+ #
1242
+ # @param request [::Google::Cloud::EdgeContainer::V1::UpdateNodePoolRequest, ::Hash]
1243
+ # A request object representing the call parameters. Required. To specify no
1244
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1245
+ # @param options [::Gapic::CallOptions, ::Hash]
1246
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1247
+ #
1248
+ # @overload update_node_pool(update_mask: nil, node_pool: nil, request_id: nil)
1249
+ # Pass arguments to `update_node_pool` via keyword arguments. Note that at
1250
+ # least one keyword argument is required. To specify no parameters, or to keep all
1251
+ # the default parameter values, pass an empty Hash as a request object (see above).
1252
+ #
1253
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1254
+ # Field mask is used to specify the fields to be overwritten in the
1255
+ # NodePool resource by the update.
1256
+ # The fields specified in the update_mask are relative to the resource, not
1257
+ # the full request. A field will be overwritten if it is in the mask. If the
1258
+ # user does not provide a mask then all fields will be overwritten.
1259
+ # @param node_pool [::Google::Cloud::EdgeContainer::V1::NodePool, ::Hash]
1260
+ # The updated node pool.
1261
+ # @param request_id [::String]
1262
+ # A unique identifier for this request. Restricted to 36 ASCII characters. A
1263
+ # random UUID is recommended. This request is only idempotent if
1264
+ # `request_id` is provided.
1265
+ # @yield [result, operation] Access the result along with the TransportOperation object
1266
+ # @yieldparam result [::Gapic::Operation]
1267
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1268
+ #
1269
+ # @return [::Gapic::Operation]
1270
+ #
1271
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1272
+ #
1273
+ # @example Basic example
1274
+ # require "google/cloud/edge_container/v1"
1275
+ #
1276
+ # # Create a client object. The client can be reused for multiple calls.
1277
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
1278
+ #
1279
+ # # Create a request. To set request fields, pass in keyword arguments.
1280
+ # request = Google::Cloud::EdgeContainer::V1::UpdateNodePoolRequest.new
1281
+ #
1282
+ # # Call the update_node_pool method.
1283
+ # result = client.update_node_pool request
1284
+ #
1285
+ # # The returned object is of type Gapic::Operation. You can use it to
1286
+ # # check the status of an operation, cancel it, or wait for results.
1287
+ # # Here is how to wait for a response.
1288
+ # result.wait_until_done! timeout: 60
1289
+ # if result.response?
1290
+ # p result.response
1291
+ # else
1292
+ # puts "No response received."
1293
+ # end
1294
+ #
1295
+ def update_node_pool request, options = nil
1296
+ raise ::ArgumentError, "request must be provided" if request.nil?
1297
+
1298
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::UpdateNodePoolRequest
1299
+
1300
+ # Converts hash and nil to an options object
1301
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1302
+
1303
+ # Customize the options with defaults
1304
+ call_metadata = @config.rpcs.update_node_pool.metadata.to_h
1305
+
1306
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1307
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1308
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1309
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
1310
+ transports_version_send: [:rest]
1311
+
1312
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1313
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1314
+
1315
+ options.apply_defaults timeout: @config.rpcs.update_node_pool.timeout,
1316
+ metadata: call_metadata,
1317
+ retry_policy: @config.rpcs.update_node_pool.retry_policy
1318
+
1319
+ options.apply_defaults timeout: @config.timeout,
1320
+ metadata: @config.metadata,
1321
+ retry_policy: @config.retry_policy
1322
+
1323
+ @edge_container_stub.update_node_pool request, options do |result, operation|
1324
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1325
+ yield result, operation if block_given?
1326
+ return result
1327
+ end
1328
+ rescue ::Gapic::Rest::Error => e
1329
+ raise ::Google::Cloud::Error.from_error(e)
1330
+ end
1331
+
1332
+ ##
1333
+ # Deletes a single NodePool.
1334
+ #
1335
+ # @overload delete_node_pool(request, options = nil)
1336
+ # Pass arguments to `delete_node_pool` via a request object, either of type
1337
+ # {::Google::Cloud::EdgeContainer::V1::DeleteNodePoolRequest} or an equivalent Hash.
1338
+ #
1339
+ # @param request [::Google::Cloud::EdgeContainer::V1::DeleteNodePoolRequest, ::Hash]
1340
+ # A request object representing the call parameters. Required. To specify no
1341
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1342
+ # @param options [::Gapic::CallOptions, ::Hash]
1343
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1344
+ #
1345
+ # @overload delete_node_pool(name: nil, request_id: nil)
1346
+ # Pass arguments to `delete_node_pool` via keyword arguments. Note that at
1347
+ # least one keyword argument is required. To specify no parameters, or to keep all
1348
+ # the default parameter values, pass an empty Hash as a request object (see above).
1349
+ #
1350
+ # @param name [::String]
1351
+ # Required. The resource name of the node pool.
1352
+ # @param request_id [::String]
1353
+ # A unique identifier for this request. Restricted to 36 ASCII characters. A
1354
+ # random UUID is recommended. This request is only idempotent if
1355
+ # `request_id` is provided.
1356
+ # @yield [result, operation] Access the result along with the TransportOperation object
1357
+ # @yieldparam result [::Gapic::Operation]
1358
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1359
+ #
1360
+ # @return [::Gapic::Operation]
1361
+ #
1362
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1363
+ #
1364
+ # @example Basic example
1365
+ # require "google/cloud/edge_container/v1"
1366
+ #
1367
+ # # Create a client object. The client can be reused for multiple calls.
1368
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
1369
+ #
1370
+ # # Create a request. To set request fields, pass in keyword arguments.
1371
+ # request = Google::Cloud::EdgeContainer::V1::DeleteNodePoolRequest.new
1372
+ #
1373
+ # # Call the delete_node_pool method.
1374
+ # result = client.delete_node_pool request
1375
+ #
1376
+ # # The returned object is of type Gapic::Operation. You can use it to
1377
+ # # check the status of an operation, cancel it, or wait for results.
1378
+ # # Here is how to wait for a response.
1379
+ # result.wait_until_done! timeout: 60
1380
+ # if result.response?
1381
+ # p result.response
1382
+ # else
1383
+ # puts "No response received."
1384
+ # end
1385
+ #
1386
+ def delete_node_pool request, options = nil
1387
+ raise ::ArgumentError, "request must be provided" if request.nil?
1388
+
1389
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::DeleteNodePoolRequest
1390
+
1391
+ # Converts hash and nil to an options object
1392
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1393
+
1394
+ # Customize the options with defaults
1395
+ call_metadata = @config.rpcs.delete_node_pool.metadata.to_h
1396
+
1397
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1398
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1399
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1400
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
1401
+ transports_version_send: [:rest]
1402
+
1403
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1404
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1405
+
1406
+ options.apply_defaults timeout: @config.rpcs.delete_node_pool.timeout,
1407
+ metadata: call_metadata,
1408
+ retry_policy: @config.rpcs.delete_node_pool.retry_policy
1409
+
1410
+ options.apply_defaults timeout: @config.timeout,
1411
+ metadata: @config.metadata,
1412
+ retry_policy: @config.retry_policy
1413
+
1414
+ @edge_container_stub.delete_node_pool request, options do |result, operation|
1415
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1416
+ yield result, operation if block_given?
1417
+ return result
1418
+ end
1419
+ rescue ::Gapic::Rest::Error => e
1420
+ raise ::Google::Cloud::Error.from_error(e)
1421
+ end
1422
+
1423
+ ##
1424
+ # Lists Machines in a given project and location.
1425
+ #
1426
+ # @overload list_machines(request, options = nil)
1427
+ # Pass arguments to `list_machines` via a request object, either of type
1428
+ # {::Google::Cloud::EdgeContainer::V1::ListMachinesRequest} or an equivalent Hash.
1429
+ #
1430
+ # @param request [::Google::Cloud::EdgeContainer::V1::ListMachinesRequest, ::Hash]
1431
+ # A request object representing the call parameters. Required. To specify no
1432
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1433
+ # @param options [::Gapic::CallOptions, ::Hash]
1434
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1435
+ #
1436
+ # @overload list_machines(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1437
+ # Pass arguments to `list_machines` via keyword arguments. Note that at
1438
+ # least one keyword argument is required. To specify no parameters, or to keep all
1439
+ # the default parameter values, pass an empty Hash as a request object (see above).
1440
+ #
1441
+ # @param parent [::String]
1442
+ # Required. The parent site, which owns this collection of machines.
1443
+ # @param page_size [::Integer]
1444
+ # The maximum number of resources to list.
1445
+ # @param page_token [::String]
1446
+ # A page token received from previous list request.
1447
+ # @param filter [::String]
1448
+ # Only resources matching this filter will be listed.
1449
+ # @param order_by [::String]
1450
+ # Specifies the order in which resources will be listed.
1451
+ # @yield [result, operation] Access the result along with the TransportOperation object
1452
+ # @yieldparam result [::Google::Cloud::EdgeContainer::V1::ListMachinesResponse]
1453
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1454
+ #
1455
+ # @return [::Google::Cloud::EdgeContainer::V1::ListMachinesResponse]
1456
+ #
1457
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1458
+ #
1459
+ # @example Basic example
1460
+ # require "google/cloud/edge_container/v1"
1461
+ #
1462
+ # # Create a client object. The client can be reused for multiple calls.
1463
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
1464
+ #
1465
+ # # Create a request. To set request fields, pass in keyword arguments.
1466
+ # request = Google::Cloud::EdgeContainer::V1::ListMachinesRequest.new
1467
+ #
1468
+ # # Call the list_machines method.
1469
+ # result = client.list_machines request
1470
+ #
1471
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1472
+ # # over elements, and API calls will be issued to fetch pages as needed.
1473
+ # result.each do |item|
1474
+ # # Each element is of type ::Google::Cloud::EdgeContainer::V1::Machine.
1475
+ # p item
1476
+ # end
1477
+ #
1478
+ def list_machines request, options = nil
1479
+ raise ::ArgumentError, "request must be provided" if request.nil?
1480
+
1481
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::ListMachinesRequest
1482
+
1483
+ # Converts hash and nil to an options object
1484
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1485
+
1486
+ # Customize the options with defaults
1487
+ call_metadata = @config.rpcs.list_machines.metadata.to_h
1488
+
1489
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1490
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1491
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1492
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
1493
+ transports_version_send: [:rest]
1494
+
1495
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1496
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1497
+
1498
+ options.apply_defaults timeout: @config.rpcs.list_machines.timeout,
1499
+ metadata: call_metadata,
1500
+ retry_policy: @config.rpcs.list_machines.retry_policy
1501
+
1502
+ options.apply_defaults timeout: @config.timeout,
1503
+ metadata: @config.metadata,
1504
+ retry_policy: @config.retry_policy
1505
+
1506
+ @edge_container_stub.list_machines request, options do |result, operation|
1507
+ yield result, operation if block_given?
1508
+ return result
1509
+ end
1510
+ rescue ::Gapic::Rest::Error => e
1511
+ raise ::Google::Cloud::Error.from_error(e)
1512
+ end
1513
+
1514
+ ##
1515
+ # Gets details of a single Machine.
1516
+ #
1517
+ # @overload get_machine(request, options = nil)
1518
+ # Pass arguments to `get_machine` via a request object, either of type
1519
+ # {::Google::Cloud::EdgeContainer::V1::GetMachineRequest} or an equivalent Hash.
1520
+ #
1521
+ # @param request [::Google::Cloud::EdgeContainer::V1::GetMachineRequest, ::Hash]
1522
+ # A request object representing the call parameters. Required. To specify no
1523
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1524
+ # @param options [::Gapic::CallOptions, ::Hash]
1525
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1526
+ #
1527
+ # @overload get_machine(name: nil)
1528
+ # Pass arguments to `get_machine` via keyword arguments. Note that at
1529
+ # least one keyword argument is required. To specify no parameters, or to keep all
1530
+ # the default parameter values, pass an empty Hash as a request object (see above).
1531
+ #
1532
+ # @param name [::String]
1533
+ # Required. The resource name of the machine.
1534
+ # @yield [result, operation] Access the result along with the TransportOperation object
1535
+ # @yieldparam result [::Google::Cloud::EdgeContainer::V1::Machine]
1536
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1537
+ #
1538
+ # @return [::Google::Cloud::EdgeContainer::V1::Machine]
1539
+ #
1540
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1541
+ #
1542
+ # @example Basic example
1543
+ # require "google/cloud/edge_container/v1"
1544
+ #
1545
+ # # Create a client object. The client can be reused for multiple calls.
1546
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
1547
+ #
1548
+ # # Create a request. To set request fields, pass in keyword arguments.
1549
+ # request = Google::Cloud::EdgeContainer::V1::GetMachineRequest.new
1550
+ #
1551
+ # # Call the get_machine method.
1552
+ # result = client.get_machine request
1553
+ #
1554
+ # # The returned object is of type Google::Cloud::EdgeContainer::V1::Machine.
1555
+ # p result
1556
+ #
1557
+ def get_machine request, options = nil
1558
+ raise ::ArgumentError, "request must be provided" if request.nil?
1559
+
1560
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::GetMachineRequest
1561
+
1562
+ # Converts hash and nil to an options object
1563
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1564
+
1565
+ # Customize the options with defaults
1566
+ call_metadata = @config.rpcs.get_machine.metadata.to_h
1567
+
1568
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1569
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1570
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1571
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
1572
+ transports_version_send: [:rest]
1573
+
1574
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1575
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1576
+
1577
+ options.apply_defaults timeout: @config.rpcs.get_machine.timeout,
1578
+ metadata: call_metadata,
1579
+ retry_policy: @config.rpcs.get_machine.retry_policy
1580
+
1581
+ options.apply_defaults timeout: @config.timeout,
1582
+ metadata: @config.metadata,
1583
+ retry_policy: @config.retry_policy
1584
+
1585
+ @edge_container_stub.get_machine request, options do |result, operation|
1586
+ yield result, operation if block_given?
1587
+ return result
1588
+ end
1589
+ rescue ::Gapic::Rest::Error => e
1590
+ raise ::Google::Cloud::Error.from_error(e)
1591
+ end
1592
+
1593
+ ##
1594
+ # Lists VPN connections in a given project and location.
1595
+ #
1596
+ # @overload list_vpn_connections(request, options = nil)
1597
+ # Pass arguments to `list_vpn_connections` via a request object, either of type
1598
+ # {::Google::Cloud::EdgeContainer::V1::ListVpnConnectionsRequest} or an equivalent Hash.
1599
+ #
1600
+ # @param request [::Google::Cloud::EdgeContainer::V1::ListVpnConnectionsRequest, ::Hash]
1601
+ # A request object representing the call parameters. Required. To specify no
1602
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1603
+ # @param options [::Gapic::CallOptions, ::Hash]
1604
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1605
+ #
1606
+ # @overload list_vpn_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1607
+ # Pass arguments to `list_vpn_connections` via keyword arguments. Note that at
1608
+ # least one keyword argument is required. To specify no parameters, or to keep all
1609
+ # the default parameter values, pass an empty Hash as a request object (see above).
1610
+ #
1611
+ # @param parent [::String]
1612
+ # Required. The parent location, which owns this collection of VPN
1613
+ # connections.
1614
+ # @param page_size [::Integer]
1615
+ # The maximum number of resources to list.
1616
+ # @param page_token [::String]
1617
+ # A page token received from previous list request.
1618
+ # @param filter [::String]
1619
+ # Only resources matching this filter will be listed.
1620
+ # @param order_by [::String]
1621
+ # Specifies the order in which resources will be listed.
1622
+ # @yield [result, operation] Access the result along with the TransportOperation object
1623
+ # @yieldparam result [::Google::Cloud::EdgeContainer::V1::ListVpnConnectionsResponse]
1624
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1625
+ #
1626
+ # @return [::Google::Cloud::EdgeContainer::V1::ListVpnConnectionsResponse]
1627
+ #
1628
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1629
+ #
1630
+ # @example Basic example
1631
+ # require "google/cloud/edge_container/v1"
1632
+ #
1633
+ # # Create a client object. The client can be reused for multiple calls.
1634
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
1635
+ #
1636
+ # # Create a request. To set request fields, pass in keyword arguments.
1637
+ # request = Google::Cloud::EdgeContainer::V1::ListVpnConnectionsRequest.new
1638
+ #
1639
+ # # Call the list_vpn_connections method.
1640
+ # result = client.list_vpn_connections request
1641
+ #
1642
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1643
+ # # over elements, and API calls will be issued to fetch pages as needed.
1644
+ # result.each do |item|
1645
+ # # Each element is of type ::Google::Cloud::EdgeContainer::V1::VpnConnection.
1646
+ # p item
1647
+ # end
1648
+ #
1649
+ def list_vpn_connections request, options = nil
1650
+ raise ::ArgumentError, "request must be provided" if request.nil?
1651
+
1652
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::ListVpnConnectionsRequest
1653
+
1654
+ # Converts hash and nil to an options object
1655
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1656
+
1657
+ # Customize the options with defaults
1658
+ call_metadata = @config.rpcs.list_vpn_connections.metadata.to_h
1659
+
1660
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1661
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1662
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1663
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
1664
+ transports_version_send: [:rest]
1665
+
1666
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1667
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1668
+
1669
+ options.apply_defaults timeout: @config.rpcs.list_vpn_connections.timeout,
1670
+ metadata: call_metadata,
1671
+ retry_policy: @config.rpcs.list_vpn_connections.retry_policy
1672
+
1673
+ options.apply_defaults timeout: @config.timeout,
1674
+ metadata: @config.metadata,
1675
+ retry_policy: @config.retry_policy
1676
+
1677
+ @edge_container_stub.list_vpn_connections request, options do |result, operation|
1678
+ yield result, operation if block_given?
1679
+ return result
1680
+ end
1681
+ rescue ::Gapic::Rest::Error => e
1682
+ raise ::Google::Cloud::Error.from_error(e)
1683
+ end
1684
+
1685
+ ##
1686
+ # Gets details of a single VPN connection.
1687
+ #
1688
+ # @overload get_vpn_connection(request, options = nil)
1689
+ # Pass arguments to `get_vpn_connection` via a request object, either of type
1690
+ # {::Google::Cloud::EdgeContainer::V1::GetVpnConnectionRequest} or an equivalent Hash.
1691
+ #
1692
+ # @param request [::Google::Cloud::EdgeContainer::V1::GetVpnConnectionRequest, ::Hash]
1693
+ # A request object representing the call parameters. Required. To specify no
1694
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1695
+ # @param options [::Gapic::CallOptions, ::Hash]
1696
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1697
+ #
1698
+ # @overload get_vpn_connection(name: nil)
1699
+ # Pass arguments to `get_vpn_connection` via keyword arguments. Note that at
1700
+ # least one keyword argument is required. To specify no parameters, or to keep all
1701
+ # the default parameter values, pass an empty Hash as a request object (see above).
1702
+ #
1703
+ # @param name [::String]
1704
+ # Required. The resource name of the vpn connection.
1705
+ # @yield [result, operation] Access the result along with the TransportOperation object
1706
+ # @yieldparam result [::Google::Cloud::EdgeContainer::V1::VpnConnection]
1707
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1708
+ #
1709
+ # @return [::Google::Cloud::EdgeContainer::V1::VpnConnection]
1710
+ #
1711
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1712
+ #
1713
+ # @example Basic example
1714
+ # require "google/cloud/edge_container/v1"
1715
+ #
1716
+ # # Create a client object. The client can be reused for multiple calls.
1717
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
1718
+ #
1719
+ # # Create a request. To set request fields, pass in keyword arguments.
1720
+ # request = Google::Cloud::EdgeContainer::V1::GetVpnConnectionRequest.new
1721
+ #
1722
+ # # Call the get_vpn_connection method.
1723
+ # result = client.get_vpn_connection request
1724
+ #
1725
+ # # The returned object is of type Google::Cloud::EdgeContainer::V1::VpnConnection.
1726
+ # p result
1727
+ #
1728
+ def get_vpn_connection request, options = nil
1729
+ raise ::ArgumentError, "request must be provided" if request.nil?
1730
+
1731
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::GetVpnConnectionRequest
1732
+
1733
+ # Converts hash and nil to an options object
1734
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1735
+
1736
+ # Customize the options with defaults
1737
+ call_metadata = @config.rpcs.get_vpn_connection.metadata.to_h
1738
+
1739
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1740
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1741
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1742
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
1743
+ transports_version_send: [:rest]
1744
+
1745
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1746
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1747
+
1748
+ options.apply_defaults timeout: @config.rpcs.get_vpn_connection.timeout,
1749
+ metadata: call_metadata,
1750
+ retry_policy: @config.rpcs.get_vpn_connection.retry_policy
1751
+
1752
+ options.apply_defaults timeout: @config.timeout,
1753
+ metadata: @config.metadata,
1754
+ retry_policy: @config.retry_policy
1755
+
1756
+ @edge_container_stub.get_vpn_connection request, options do |result, operation|
1757
+ yield result, operation if block_given?
1758
+ return result
1759
+ end
1760
+ rescue ::Gapic::Rest::Error => e
1761
+ raise ::Google::Cloud::Error.from_error(e)
1762
+ end
1763
+
1764
+ ##
1765
+ # Creates a new VPN connection in a given project and location.
1766
+ #
1767
+ # @overload create_vpn_connection(request, options = nil)
1768
+ # Pass arguments to `create_vpn_connection` via a request object, either of type
1769
+ # {::Google::Cloud::EdgeContainer::V1::CreateVpnConnectionRequest} or an equivalent Hash.
1770
+ #
1771
+ # @param request [::Google::Cloud::EdgeContainer::V1::CreateVpnConnectionRequest, ::Hash]
1772
+ # A request object representing the call parameters. Required. To specify no
1773
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1774
+ # @param options [::Gapic::CallOptions, ::Hash]
1775
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1776
+ #
1777
+ # @overload create_vpn_connection(parent: nil, vpn_connection_id: nil, vpn_connection: nil, request_id: nil)
1778
+ # Pass arguments to `create_vpn_connection` via keyword arguments. Note that at
1779
+ # least one keyword argument is required. To specify no parameters, or to keep all
1780
+ # the default parameter values, pass an empty Hash as a request object (see above).
1781
+ #
1782
+ # @param parent [::String]
1783
+ # Required. The parent location where this vpn connection will be created.
1784
+ # @param vpn_connection_id [::String]
1785
+ # Required. The VPN connection identifier.
1786
+ # @param vpn_connection [::Google::Cloud::EdgeContainer::V1::VpnConnection, ::Hash]
1787
+ # Required. The VPN connection to create.
1788
+ # @param request_id [::String]
1789
+ # A unique identifier for this request. Restricted to 36 ASCII characters. A
1790
+ # random UUID is recommended. This request is only idempotent if
1791
+ # `request_id` is provided.
1792
+ # @yield [result, operation] Access the result along with the TransportOperation object
1793
+ # @yieldparam result [::Gapic::Operation]
1794
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1795
+ #
1796
+ # @return [::Gapic::Operation]
1797
+ #
1798
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1799
+ #
1800
+ # @example Basic example
1801
+ # require "google/cloud/edge_container/v1"
1802
+ #
1803
+ # # Create a client object. The client can be reused for multiple calls.
1804
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
1805
+ #
1806
+ # # Create a request. To set request fields, pass in keyword arguments.
1807
+ # request = Google::Cloud::EdgeContainer::V1::CreateVpnConnectionRequest.new
1808
+ #
1809
+ # # Call the create_vpn_connection method.
1810
+ # result = client.create_vpn_connection request
1811
+ #
1812
+ # # The returned object is of type Gapic::Operation. You can use it to
1813
+ # # check the status of an operation, cancel it, or wait for results.
1814
+ # # Here is how to wait for a response.
1815
+ # result.wait_until_done! timeout: 60
1816
+ # if result.response?
1817
+ # p result.response
1818
+ # else
1819
+ # puts "No response received."
1820
+ # end
1821
+ #
1822
+ def create_vpn_connection request, options = nil
1823
+ raise ::ArgumentError, "request must be provided" if request.nil?
1824
+
1825
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::CreateVpnConnectionRequest
1826
+
1827
+ # Converts hash and nil to an options object
1828
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1829
+
1830
+ # Customize the options with defaults
1831
+ call_metadata = @config.rpcs.create_vpn_connection.metadata.to_h
1832
+
1833
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1834
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1835
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1836
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
1837
+ transports_version_send: [:rest]
1838
+
1839
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1840
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1841
+
1842
+ options.apply_defaults timeout: @config.rpcs.create_vpn_connection.timeout,
1843
+ metadata: call_metadata,
1844
+ retry_policy: @config.rpcs.create_vpn_connection.retry_policy
1845
+
1846
+ options.apply_defaults timeout: @config.timeout,
1847
+ metadata: @config.metadata,
1848
+ retry_policy: @config.retry_policy
1849
+
1850
+ @edge_container_stub.create_vpn_connection request, options do |result, operation|
1851
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1852
+ yield result, operation if block_given?
1853
+ return result
1854
+ end
1855
+ rescue ::Gapic::Rest::Error => e
1856
+ raise ::Google::Cloud::Error.from_error(e)
1857
+ end
1858
+
1859
+ ##
1860
+ # Deletes a single VPN connection.
1861
+ #
1862
+ # @overload delete_vpn_connection(request, options = nil)
1863
+ # Pass arguments to `delete_vpn_connection` via a request object, either of type
1864
+ # {::Google::Cloud::EdgeContainer::V1::DeleteVpnConnectionRequest} or an equivalent Hash.
1865
+ #
1866
+ # @param request [::Google::Cloud::EdgeContainer::V1::DeleteVpnConnectionRequest, ::Hash]
1867
+ # A request object representing the call parameters. Required. To specify no
1868
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1869
+ # @param options [::Gapic::CallOptions, ::Hash]
1870
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1871
+ #
1872
+ # @overload delete_vpn_connection(name: nil, request_id: nil)
1873
+ # Pass arguments to `delete_vpn_connection` via keyword arguments. Note that at
1874
+ # least one keyword argument is required. To specify no parameters, or to keep all
1875
+ # the default parameter values, pass an empty Hash as a request object (see above).
1876
+ #
1877
+ # @param name [::String]
1878
+ # Required. The resource name of the vpn connection.
1879
+ # @param request_id [::String]
1880
+ # A unique identifier for this request. Restricted to 36 ASCII characters. A
1881
+ # random UUID is recommended. This request is only idempotent if
1882
+ # `request_id` is provided.
1883
+ # @yield [result, operation] Access the result along with the TransportOperation object
1884
+ # @yieldparam result [::Gapic::Operation]
1885
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1886
+ #
1887
+ # @return [::Gapic::Operation]
1888
+ #
1889
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1890
+ #
1891
+ # @example Basic example
1892
+ # require "google/cloud/edge_container/v1"
1893
+ #
1894
+ # # Create a client object. The client can be reused for multiple calls.
1895
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
1896
+ #
1897
+ # # Create a request. To set request fields, pass in keyword arguments.
1898
+ # request = Google::Cloud::EdgeContainer::V1::DeleteVpnConnectionRequest.new
1899
+ #
1900
+ # # Call the delete_vpn_connection method.
1901
+ # result = client.delete_vpn_connection request
1902
+ #
1903
+ # # The returned object is of type Gapic::Operation. You can use it to
1904
+ # # check the status of an operation, cancel it, or wait for results.
1905
+ # # Here is how to wait for a response.
1906
+ # result.wait_until_done! timeout: 60
1907
+ # if result.response?
1908
+ # p result.response
1909
+ # else
1910
+ # puts "No response received."
1911
+ # end
1912
+ #
1913
+ def delete_vpn_connection request, options = nil
1914
+ raise ::ArgumentError, "request must be provided" if request.nil?
1915
+
1916
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::DeleteVpnConnectionRequest
1917
+
1918
+ # Converts hash and nil to an options object
1919
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1920
+
1921
+ # Customize the options with defaults
1922
+ call_metadata = @config.rpcs.delete_vpn_connection.metadata.to_h
1923
+
1924
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1925
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1926
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1927
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
1928
+ transports_version_send: [:rest]
1929
+
1930
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1931
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1932
+
1933
+ options.apply_defaults timeout: @config.rpcs.delete_vpn_connection.timeout,
1934
+ metadata: call_metadata,
1935
+ retry_policy: @config.rpcs.delete_vpn_connection.retry_policy
1936
+
1937
+ options.apply_defaults timeout: @config.timeout,
1938
+ metadata: @config.metadata,
1939
+ retry_policy: @config.retry_policy
1940
+
1941
+ @edge_container_stub.delete_vpn_connection request, options do |result, operation|
1942
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1943
+ yield result, operation if block_given?
1944
+ return result
1945
+ end
1946
+ rescue ::Gapic::Rest::Error => e
1947
+ raise ::Google::Cloud::Error.from_error(e)
1948
+ end
1949
+
1950
+ ##
1951
+ # Gets the server config.
1952
+ #
1953
+ # @overload get_server_config(request, options = nil)
1954
+ # Pass arguments to `get_server_config` via a request object, either of type
1955
+ # {::Google::Cloud::EdgeContainer::V1::GetServerConfigRequest} or an equivalent Hash.
1956
+ #
1957
+ # @param request [::Google::Cloud::EdgeContainer::V1::GetServerConfigRequest, ::Hash]
1958
+ # A request object representing the call parameters. Required. To specify no
1959
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1960
+ # @param options [::Gapic::CallOptions, ::Hash]
1961
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1962
+ #
1963
+ # @overload get_server_config(name: nil)
1964
+ # Pass arguments to `get_server_config` via keyword arguments. Note that at
1965
+ # least one keyword argument is required. To specify no parameters, or to keep all
1966
+ # the default parameter values, pass an empty Hash as a request object (see above).
1967
+ #
1968
+ # @param name [::String]
1969
+ # Required. The name (project and location) of the server config to get,
1970
+ # specified in the format `projects/*/locations/*`.
1971
+ # @yield [result, operation] Access the result along with the TransportOperation object
1972
+ # @yieldparam result [::Google::Cloud::EdgeContainer::V1::ServerConfig]
1973
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1974
+ #
1975
+ # @return [::Google::Cloud::EdgeContainer::V1::ServerConfig]
1976
+ #
1977
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1978
+ #
1979
+ # @example Basic example
1980
+ # require "google/cloud/edge_container/v1"
1981
+ #
1982
+ # # Create a client object. The client can be reused for multiple calls.
1983
+ # client = Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new
1984
+ #
1985
+ # # Create a request. To set request fields, pass in keyword arguments.
1986
+ # request = Google::Cloud::EdgeContainer::V1::GetServerConfigRequest.new
1987
+ #
1988
+ # # Call the get_server_config method.
1989
+ # result = client.get_server_config request
1990
+ #
1991
+ # # The returned object is of type Google::Cloud::EdgeContainer::V1::ServerConfig.
1992
+ # p result
1993
+ #
1994
+ def get_server_config request, options = nil
1995
+ raise ::ArgumentError, "request must be provided" if request.nil?
1996
+
1997
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::EdgeContainer::V1::GetServerConfigRequest
1998
+
1999
+ # Converts hash and nil to an options object
2000
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2001
+
2002
+ # Customize the options with defaults
2003
+ call_metadata = @config.rpcs.get_server_config.metadata.to_h
2004
+
2005
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2006
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2007
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2008
+ gapic_version: ::Google::Cloud::EdgeContainer::V1::VERSION,
2009
+ transports_version_send: [:rest]
2010
+
2011
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2012
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2013
+
2014
+ options.apply_defaults timeout: @config.rpcs.get_server_config.timeout,
2015
+ metadata: call_metadata,
2016
+ retry_policy: @config.rpcs.get_server_config.retry_policy
2017
+
2018
+ options.apply_defaults timeout: @config.timeout,
2019
+ metadata: @config.metadata,
2020
+ retry_policy: @config.retry_policy
2021
+
2022
+ @edge_container_stub.get_server_config request, options do |result, operation|
2023
+ yield result, operation if block_given?
2024
+ return result
2025
+ end
2026
+ rescue ::Gapic::Rest::Error => e
2027
+ raise ::Google::Cloud::Error.from_error(e)
2028
+ end
2029
+
2030
+ ##
2031
+ # Configuration class for the EdgeContainer REST API.
2032
+ #
2033
+ # This class represents the configuration for EdgeContainer REST,
2034
+ # providing control over timeouts, retry behavior, logging, transport
2035
+ # parameters, and other low-level controls. Certain parameters can also be
2036
+ # applied individually to specific RPCs. See
2037
+ # {::Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client::Configuration::Rpcs}
2038
+ # for a list of RPCs that can be configured independently.
2039
+ #
2040
+ # Configuration can be applied globally to all clients, or to a single client
2041
+ # on construction.
2042
+ #
2043
+ # @example
2044
+ #
2045
+ # # Modify the global config, setting the timeout for
2046
+ # # list_clusters to 20 seconds,
2047
+ # # and all remaining timeouts to 10 seconds.
2048
+ # ::Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.configure do |config|
2049
+ # config.timeout = 10.0
2050
+ # config.rpcs.list_clusters.timeout = 20.0
2051
+ # end
2052
+ #
2053
+ # # Apply the above configuration only to a new client.
2054
+ # client = ::Google::Cloud::EdgeContainer::V1::EdgeContainer::Rest::Client.new do |config|
2055
+ # config.timeout = 10.0
2056
+ # config.rpcs.list_clusters.timeout = 20.0
2057
+ # end
2058
+ #
2059
+ # @!attribute [rw] endpoint
2060
+ # A custom service endpoint, as a hostname or hostname:port. The default is
2061
+ # nil, indicating to use the default endpoint in the current universe domain.
2062
+ # @return [::String,nil]
2063
+ # @!attribute [rw] credentials
2064
+ # Credentials to send with calls. You may provide any of the following types:
2065
+ # * (`String`) The path to a service account key file in JSON format
2066
+ # * (`Hash`) A service account key as a Hash
2067
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
2068
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
2069
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
2070
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
2071
+ # * (`nil`) indicating no credentials
2072
+ # @return [::Object]
2073
+ # @!attribute [rw] scope
2074
+ # The OAuth scopes
2075
+ # @return [::Array<::String>]
2076
+ # @!attribute [rw] lib_name
2077
+ # The library name as recorded in instrumentation and logging
2078
+ # @return [::String]
2079
+ # @!attribute [rw] lib_version
2080
+ # The library version as recorded in instrumentation and logging
2081
+ # @return [::String]
2082
+ # @!attribute [rw] timeout
2083
+ # The call timeout in seconds.
2084
+ # @return [::Numeric]
2085
+ # @!attribute [rw] metadata
2086
+ # Additional headers to be sent with the call.
2087
+ # @return [::Hash{::Symbol=>::String}]
2088
+ # @!attribute [rw] retry_policy
2089
+ # The retry policy. The value is a hash with the following keys:
2090
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2091
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2092
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2093
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2094
+ # trigger a retry.
2095
+ # @return [::Hash]
2096
+ # @!attribute [rw] quota_project
2097
+ # A separate project against which to charge quota.
2098
+ # @return [::String]
2099
+ # @!attribute [rw] universe_domain
2100
+ # The universe domain within which to make requests. This determines the
2101
+ # default endpoint URL. The default value of nil uses the environment
2102
+ # universe (usually the default "googleapis.com" universe).
2103
+ # @return [::String,nil]
2104
+ #
2105
+ class Configuration
2106
+ extend ::Gapic::Config
2107
+
2108
+ # @private
2109
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
2110
+ DEFAULT_ENDPOINT = "edgecontainer.googleapis.com"
2111
+
2112
+ config_attr :endpoint, nil, ::String, nil
2113
+ config_attr :credentials, nil do |value|
2114
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2115
+ allowed.any? { |klass| klass === value }
2116
+ end
2117
+ config_attr :scope, nil, ::String, ::Array, nil
2118
+ config_attr :lib_name, nil, ::String, nil
2119
+ config_attr :lib_version, nil, ::String, nil
2120
+ config_attr :timeout, nil, ::Numeric, nil
2121
+ config_attr :metadata, nil, ::Hash, nil
2122
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
2123
+ config_attr :quota_project, nil, ::String, nil
2124
+ config_attr :universe_domain, nil, ::String, nil
2125
+
2126
+ # @private
2127
+ # Overrides for http bindings for the RPCs of this service
2128
+ # are only used when this service is used as mixin, and only
2129
+ # by the host service.
2130
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
2131
+ config_attr :bindings_override, {}, ::Hash, nil
2132
+
2133
+ # @private
2134
+ def initialize parent_config = nil
2135
+ @parent_config = parent_config unless parent_config.nil?
2136
+
2137
+ yield self if block_given?
2138
+ end
2139
+
2140
+ ##
2141
+ # Configurations for individual RPCs
2142
+ # @return [Rpcs]
2143
+ #
2144
+ def rpcs
2145
+ @rpcs ||= begin
2146
+ parent_rpcs = nil
2147
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
2148
+ Rpcs.new parent_rpcs
2149
+ end
2150
+ end
2151
+
2152
+ ##
2153
+ # Configuration RPC class for the EdgeContainer API.
2154
+ #
2155
+ # Includes fields providing the configuration for each RPC in this service.
2156
+ # Each configuration object is of type `Gapic::Config::Method` and includes
2157
+ # the following configuration fields:
2158
+ #
2159
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
2160
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
2161
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
2162
+ # include the following keys:
2163
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
2164
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
2165
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
2166
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
2167
+ # trigger a retry.
2168
+ #
2169
+ class Rpcs
2170
+ ##
2171
+ # RPC-specific configuration for `list_clusters`
2172
+ # @return [::Gapic::Config::Method]
2173
+ #
2174
+ attr_reader :list_clusters
2175
+ ##
2176
+ # RPC-specific configuration for `get_cluster`
2177
+ # @return [::Gapic::Config::Method]
2178
+ #
2179
+ attr_reader :get_cluster
2180
+ ##
2181
+ # RPC-specific configuration for `create_cluster`
2182
+ # @return [::Gapic::Config::Method]
2183
+ #
2184
+ attr_reader :create_cluster
2185
+ ##
2186
+ # RPC-specific configuration for `update_cluster`
2187
+ # @return [::Gapic::Config::Method]
2188
+ #
2189
+ attr_reader :update_cluster
2190
+ ##
2191
+ # RPC-specific configuration for `upgrade_cluster`
2192
+ # @return [::Gapic::Config::Method]
2193
+ #
2194
+ attr_reader :upgrade_cluster
2195
+ ##
2196
+ # RPC-specific configuration for `delete_cluster`
2197
+ # @return [::Gapic::Config::Method]
2198
+ #
2199
+ attr_reader :delete_cluster
2200
+ ##
2201
+ # RPC-specific configuration for `generate_access_token`
2202
+ # @return [::Gapic::Config::Method]
2203
+ #
2204
+ attr_reader :generate_access_token
2205
+ ##
2206
+ # RPC-specific configuration for `generate_offline_credential`
2207
+ # @return [::Gapic::Config::Method]
2208
+ #
2209
+ attr_reader :generate_offline_credential
2210
+ ##
2211
+ # RPC-specific configuration for `list_node_pools`
2212
+ # @return [::Gapic::Config::Method]
2213
+ #
2214
+ attr_reader :list_node_pools
2215
+ ##
2216
+ # RPC-specific configuration for `get_node_pool`
2217
+ # @return [::Gapic::Config::Method]
2218
+ #
2219
+ attr_reader :get_node_pool
2220
+ ##
2221
+ # RPC-specific configuration for `create_node_pool`
2222
+ # @return [::Gapic::Config::Method]
2223
+ #
2224
+ attr_reader :create_node_pool
2225
+ ##
2226
+ # RPC-specific configuration for `update_node_pool`
2227
+ # @return [::Gapic::Config::Method]
2228
+ #
2229
+ attr_reader :update_node_pool
2230
+ ##
2231
+ # RPC-specific configuration for `delete_node_pool`
2232
+ # @return [::Gapic::Config::Method]
2233
+ #
2234
+ attr_reader :delete_node_pool
2235
+ ##
2236
+ # RPC-specific configuration for `list_machines`
2237
+ # @return [::Gapic::Config::Method]
2238
+ #
2239
+ attr_reader :list_machines
2240
+ ##
2241
+ # RPC-specific configuration for `get_machine`
2242
+ # @return [::Gapic::Config::Method]
2243
+ #
2244
+ attr_reader :get_machine
2245
+ ##
2246
+ # RPC-specific configuration for `list_vpn_connections`
2247
+ # @return [::Gapic::Config::Method]
2248
+ #
2249
+ attr_reader :list_vpn_connections
2250
+ ##
2251
+ # RPC-specific configuration for `get_vpn_connection`
2252
+ # @return [::Gapic::Config::Method]
2253
+ #
2254
+ attr_reader :get_vpn_connection
2255
+ ##
2256
+ # RPC-specific configuration for `create_vpn_connection`
2257
+ # @return [::Gapic::Config::Method]
2258
+ #
2259
+ attr_reader :create_vpn_connection
2260
+ ##
2261
+ # RPC-specific configuration for `delete_vpn_connection`
2262
+ # @return [::Gapic::Config::Method]
2263
+ #
2264
+ attr_reader :delete_vpn_connection
2265
+ ##
2266
+ # RPC-specific configuration for `get_server_config`
2267
+ # @return [::Gapic::Config::Method]
2268
+ #
2269
+ attr_reader :get_server_config
2270
+
2271
+ # @private
2272
+ def initialize parent_rpcs = nil
2273
+ list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters
2274
+ @list_clusters = ::Gapic::Config::Method.new list_clusters_config
2275
+ get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster
2276
+ @get_cluster = ::Gapic::Config::Method.new get_cluster_config
2277
+ create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster
2278
+ @create_cluster = ::Gapic::Config::Method.new create_cluster_config
2279
+ update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster
2280
+ @update_cluster = ::Gapic::Config::Method.new update_cluster_config
2281
+ upgrade_cluster_config = parent_rpcs.upgrade_cluster if parent_rpcs.respond_to? :upgrade_cluster
2282
+ @upgrade_cluster = ::Gapic::Config::Method.new upgrade_cluster_config
2283
+ delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster
2284
+ @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config
2285
+ generate_access_token_config = parent_rpcs.generate_access_token if parent_rpcs.respond_to? :generate_access_token
2286
+ @generate_access_token = ::Gapic::Config::Method.new generate_access_token_config
2287
+ generate_offline_credential_config = parent_rpcs.generate_offline_credential if parent_rpcs.respond_to? :generate_offline_credential
2288
+ @generate_offline_credential = ::Gapic::Config::Method.new generate_offline_credential_config
2289
+ list_node_pools_config = parent_rpcs.list_node_pools if parent_rpcs.respond_to? :list_node_pools
2290
+ @list_node_pools = ::Gapic::Config::Method.new list_node_pools_config
2291
+ get_node_pool_config = parent_rpcs.get_node_pool if parent_rpcs.respond_to? :get_node_pool
2292
+ @get_node_pool = ::Gapic::Config::Method.new get_node_pool_config
2293
+ create_node_pool_config = parent_rpcs.create_node_pool if parent_rpcs.respond_to? :create_node_pool
2294
+ @create_node_pool = ::Gapic::Config::Method.new create_node_pool_config
2295
+ update_node_pool_config = parent_rpcs.update_node_pool if parent_rpcs.respond_to? :update_node_pool
2296
+ @update_node_pool = ::Gapic::Config::Method.new update_node_pool_config
2297
+ delete_node_pool_config = parent_rpcs.delete_node_pool if parent_rpcs.respond_to? :delete_node_pool
2298
+ @delete_node_pool = ::Gapic::Config::Method.new delete_node_pool_config
2299
+ list_machines_config = parent_rpcs.list_machines if parent_rpcs.respond_to? :list_machines
2300
+ @list_machines = ::Gapic::Config::Method.new list_machines_config
2301
+ get_machine_config = parent_rpcs.get_machine if parent_rpcs.respond_to? :get_machine
2302
+ @get_machine = ::Gapic::Config::Method.new get_machine_config
2303
+ list_vpn_connections_config = parent_rpcs.list_vpn_connections if parent_rpcs.respond_to? :list_vpn_connections
2304
+ @list_vpn_connections = ::Gapic::Config::Method.new list_vpn_connections_config
2305
+ get_vpn_connection_config = parent_rpcs.get_vpn_connection if parent_rpcs.respond_to? :get_vpn_connection
2306
+ @get_vpn_connection = ::Gapic::Config::Method.new get_vpn_connection_config
2307
+ create_vpn_connection_config = parent_rpcs.create_vpn_connection if parent_rpcs.respond_to? :create_vpn_connection
2308
+ @create_vpn_connection = ::Gapic::Config::Method.new create_vpn_connection_config
2309
+ delete_vpn_connection_config = parent_rpcs.delete_vpn_connection if parent_rpcs.respond_to? :delete_vpn_connection
2310
+ @delete_vpn_connection = ::Gapic::Config::Method.new delete_vpn_connection_config
2311
+ get_server_config_config = parent_rpcs.get_server_config if parent_rpcs.respond_to? :get_server_config
2312
+ @get_server_config = ::Gapic::Config::Method.new get_server_config_config
2313
+
2314
+ yield self if block_given?
2315
+ end
2316
+ end
2317
+ end
2318
+ end
2319
+ end
2320
+ end
2321
+ end
2322
+ end
2323
+ end
2324
+ end