google-cloud-alloy_db-v1alpha 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/LICENSE.md +201 -0
  5. data/README.md +144 -0
  6. data/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/client.rb +3986 -0
  7. data/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/credentials.rb +47 -0
  8. data/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/operations.rb +770 -0
  9. data/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/paths.rb +170 -0
  10. data/lib/google/cloud/alloy_db/v1alpha/alloy_db_admin.rb +50 -0
  11. data/lib/google/cloud/alloy_db/v1alpha/version.rb +28 -0
  12. data/lib/google/cloud/alloy_db/v1alpha.rb +40 -0
  13. data/lib/google/cloud/alloydb/v1alpha/resources_pb.rb +100 -0
  14. data/lib/google/cloud/alloydb/v1alpha/service_pb.rb +102 -0
  15. data/lib/google/cloud/alloydb/v1alpha/service_services_pb.rb +128 -0
  16. data/lib/google-cloud-alloy_db-v1alpha.rb +21 -0
  17. data/proto_docs/README.md +4 -0
  18. data/proto_docs/google/api/client.rb +381 -0
  19. data/proto_docs/google/api/field_behavior.rb +71 -0
  20. data/proto_docs/google/api/launch_stage.rb +71 -0
  21. data/proto_docs/google/api/resource.rb +222 -0
  22. data/proto_docs/google/cloud/alloydb/v1alpha/resources.rb +1227 -0
  23. data/proto_docs/google/cloud/alloydb/v1alpha/service.rb +1206 -0
  24. data/proto_docs/google/longrunning/operations.rb +164 -0
  25. data/proto_docs/google/protobuf/any.rb +144 -0
  26. data/proto_docs/google/protobuf/duration.rb +98 -0
  27. data/proto_docs/google/protobuf/empty.rb +34 -0
  28. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  29. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  30. data/proto_docs/google/protobuf/wrappers.rb +121 -0
  31. data/proto_docs/google/rpc/status.rb +48 -0
  32. data/proto_docs/google/type/dayofweek.rb +49 -0
  33. data/proto_docs/google/type/expr.rb +75 -0
  34. data/proto_docs/google/type/timeofday.rb +45 -0
  35. metadata +281 -0
@@ -0,0 +1,3986 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/alloydb/v1alpha/service_pb"
21
+ require "google/cloud/location"
22
+ require "google/iam/v1"
23
+
24
+ module Google
25
+ module Cloud
26
+ module AlloyDB
27
+ module V1alpha
28
+ module AlloyDBAdmin
29
+ ##
30
+ # Client for the AlloyDBAdmin service.
31
+ #
32
+ # Service describing handlers for resources
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :alloy_db_admin_stub
39
+
40
+ ##
41
+ # Configure the AlloyDBAdmin Client class.
42
+ #
43
+ # See {::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all AlloyDBAdmin clients
49
+ # ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "AlloyDB", "V1alpha"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config.timeout = 60.0
70
+
71
+ default_config.rpcs.list_clusters.timeout = 60.0
72
+ default_config.rpcs.list_clusters.retry_policy = {
73
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
74
+ }
75
+
76
+ default_config.rpcs.get_cluster.timeout = 60.0
77
+ default_config.rpcs.get_cluster.retry_policy = {
78
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
79
+ }
80
+
81
+ default_config.rpcs.list_instances.timeout = 60.0
82
+ default_config.rpcs.list_instances.retry_policy = {
83
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
84
+ }
85
+
86
+ default_config.rpcs.get_instance.timeout = 60.0
87
+ default_config.rpcs.get_instance.retry_policy = {
88
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
89
+ }
90
+
91
+ default_config.rpcs.list_backups.timeout = 60.0
92
+ default_config.rpcs.list_backups.retry_policy = {
93
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
94
+ }
95
+
96
+ default_config.rpcs.get_backup.timeout = 60.0
97
+ default_config.rpcs.get_backup.retry_policy = {
98
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
99
+ }
100
+
101
+ default_config.rpcs.list_supported_database_flags.timeout = 60.0
102
+ default_config.rpcs.list_supported_database_flags.retry_policy = {
103
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
104
+ }
105
+
106
+ default_config.rpcs.generate_client_certificate.timeout = 60.0
107
+ default_config.rpcs.generate_client_certificate.retry_policy = {
108
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
109
+ }
110
+
111
+ default_config.rpcs.get_connection_info.timeout = 60.0
112
+ default_config.rpcs.get_connection_info.retry_policy = {
113
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
114
+ }
115
+
116
+ default_config.rpcs.list_users.timeout = 60.0
117
+ default_config.rpcs.list_users.retry_policy = {
118
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
119
+ }
120
+
121
+ default_config.rpcs.get_user.timeout = 60.0
122
+ default_config.rpcs.get_user.retry_policy = {
123
+ initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
124
+ }
125
+
126
+ default_config
127
+ end
128
+ yield @configure if block_given?
129
+ @configure
130
+ end
131
+
132
+ ##
133
+ # Configure the AlloyDBAdmin Client instance.
134
+ #
135
+ # The configuration is set to the derived mode, meaning that values can be changed,
136
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
137
+ # should be made on {Client.configure}.
138
+ #
139
+ # See {::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client::Configuration}
140
+ # for a description of the configuration fields.
141
+ #
142
+ # @yield [config] Configure the Client client.
143
+ # @yieldparam config [Client::Configuration]
144
+ #
145
+ # @return [Client::Configuration]
146
+ #
147
+ def configure
148
+ yield @config if block_given?
149
+ @config
150
+ end
151
+
152
+ ##
153
+ # Create a new AlloyDBAdmin client object.
154
+ #
155
+ # @example
156
+ #
157
+ # # Create a client using the default configuration
158
+ # client = ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
159
+ #
160
+ # # Create a client using a custom configuration
161
+ # client = ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new do |config|
162
+ # config.timeout = 10.0
163
+ # end
164
+ #
165
+ # @yield [config] Configure the AlloyDBAdmin client.
166
+ # @yieldparam config [Client::Configuration]
167
+ #
168
+ def initialize
169
+ # These require statements are intentionally placed here to initialize
170
+ # the gRPC module only when it's required.
171
+ # See https://github.com/googleapis/toolkit/issues/446
172
+ require "gapic/grpc"
173
+ require "google/cloud/alloydb/v1alpha/service_services_pb"
174
+
175
+ # Create the configuration object
176
+ @config = Configuration.new Client.configure
177
+
178
+ # Yield the configuration if needed
179
+ yield @config if block_given?
180
+
181
+ # Create credentials
182
+ credentials = @config.credentials
183
+ # Use self-signed JWT if the endpoint is unchanged from default,
184
+ # but only if the default endpoint does not have a region prefix.
185
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
186
+ !@config.endpoint.split(".").first.include?("-")
187
+ credentials ||= Credentials.default scope: @config.scope,
188
+ enable_self_signed_jwt: enable_self_signed_jwt
189
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
190
+ credentials = Credentials.new credentials, scope: @config.scope
191
+ end
192
+ @quota_project_id = @config.quota_project
193
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
194
+
195
+ @operations_client = Operations.new do |config|
196
+ config.credentials = credentials
197
+ config.quota_project = @quota_project_id
198
+ config.endpoint = @config.endpoint
199
+ end
200
+
201
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
202
+ config.credentials = credentials
203
+ config.quota_project = @quota_project_id
204
+ config.endpoint = @config.endpoint
205
+ end
206
+
207
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
208
+ config.credentials = credentials
209
+ config.quota_project = @quota_project_id
210
+ config.endpoint = @config.endpoint
211
+ end
212
+
213
+ @alloy_db_admin_stub = ::Gapic::ServiceStub.new(
214
+ ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Stub,
215
+ credentials: credentials,
216
+ endpoint: @config.endpoint,
217
+ channel_args: @config.channel_args,
218
+ interceptors: @config.interceptors
219
+ )
220
+ end
221
+
222
+ ##
223
+ # Get the associated client for long-running operations.
224
+ #
225
+ # @return [::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Operations]
226
+ #
227
+ attr_reader :operations_client
228
+
229
+ ##
230
+ # Get the associated client for mix-in of the Locations.
231
+ #
232
+ # @return [Google::Cloud::Location::Locations::Client]
233
+ #
234
+ attr_reader :location_client
235
+
236
+ ##
237
+ # Get the associated client for mix-in of the IAMPolicy.
238
+ #
239
+ # @return [Google::Iam::V1::IAMPolicy::Client]
240
+ #
241
+ attr_reader :iam_policy_client
242
+
243
+ # Service calls
244
+
245
+ ##
246
+ # Lists Clusters in a given project and location.
247
+ #
248
+ # @overload list_clusters(request, options = nil)
249
+ # Pass arguments to `list_clusters` via a request object, either of type
250
+ # {::Google::Cloud::AlloyDB::V1alpha::ListClustersRequest} or an equivalent Hash.
251
+ #
252
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::ListClustersRequest, ::Hash]
253
+ # A request object representing the call parameters. Required. To specify no
254
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
255
+ # @param options [::Gapic::CallOptions, ::Hash]
256
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
257
+ #
258
+ # @overload list_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
259
+ # Pass arguments to `list_clusters` via keyword arguments. Note that at
260
+ # least one keyword argument is required. To specify no parameters, or to keep all
261
+ # the default parameter values, pass an empty Hash as a request object (see above).
262
+ #
263
+ # @param parent [::String]
264
+ # Required. The name of the parent resource. For the required format, see the
265
+ # comment on the Cluster.name field. Additionally, you can perform an
266
+ # aggregated list operation by specifying a value with the following format:
267
+ # * projects/\\{project}/locations/-
268
+ # @param page_size [::Integer]
269
+ # Optional. Requested page size. Server may return fewer items than
270
+ # requested. If unspecified, server will pick an appropriate default.
271
+ # @param page_token [::String]
272
+ # A token identifying a page of results the server should return.
273
+ # @param filter [::String]
274
+ # Optional. Filtering results
275
+ # @param order_by [::String]
276
+ # Optional. Hint for how to order the results
277
+ #
278
+ # @yield [response, operation] Access the result along with the RPC operation
279
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1alpha::Cluster>]
280
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
281
+ #
282
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1alpha::Cluster>]
283
+ #
284
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
285
+ #
286
+ # @example Basic example
287
+ # require "google/cloud/alloy_db/v1alpha"
288
+ #
289
+ # # Create a client object. The client can be reused for multiple calls.
290
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
291
+ #
292
+ # # Create a request. To set request fields, pass in keyword arguments.
293
+ # request = Google::Cloud::AlloyDB::V1alpha::ListClustersRequest.new
294
+ #
295
+ # # Call the list_clusters method.
296
+ # result = client.list_clusters request
297
+ #
298
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
299
+ # # over elements, and API calls will be issued to fetch pages as needed.
300
+ # result.each do |item|
301
+ # # Each element is of type ::Google::Cloud::AlloyDB::V1alpha::Cluster.
302
+ # p item
303
+ # end
304
+ #
305
+ def list_clusters request, options = nil
306
+ raise ::ArgumentError, "request must be provided" if request.nil?
307
+
308
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::ListClustersRequest
309
+
310
+ # Converts hash and nil to an options object
311
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
312
+
313
+ # Customize the options with defaults
314
+ metadata = @config.rpcs.list_clusters.metadata.to_h
315
+
316
+ # Set x-goog-api-client and x-goog-user-project headers
317
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
318
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
319
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
320
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
321
+
322
+ header_params = {}
323
+ if request.parent
324
+ header_params["parent"] = request.parent
325
+ end
326
+
327
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
328
+ metadata[:"x-goog-request-params"] ||= request_params_header
329
+
330
+ options.apply_defaults timeout: @config.rpcs.list_clusters.timeout,
331
+ metadata: metadata,
332
+ retry_policy: @config.rpcs.list_clusters.retry_policy
333
+
334
+ options.apply_defaults timeout: @config.timeout,
335
+ metadata: @config.metadata,
336
+ retry_policy: @config.retry_policy
337
+
338
+ @alloy_db_admin_stub.call_rpc :list_clusters, request, options: options do |response, operation|
339
+ response = ::Gapic::PagedEnumerable.new @alloy_db_admin_stub, :list_clusters, request, response, operation, options
340
+ yield response, operation if block_given?
341
+ return response
342
+ end
343
+ rescue ::GRPC::BadStatus => e
344
+ raise ::Google::Cloud::Error.from_error(e)
345
+ end
346
+
347
+ ##
348
+ # Gets details of a single Cluster.
349
+ #
350
+ # @overload get_cluster(request, options = nil)
351
+ # Pass arguments to `get_cluster` via a request object, either of type
352
+ # {::Google::Cloud::AlloyDB::V1alpha::GetClusterRequest} or an equivalent Hash.
353
+ #
354
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::GetClusterRequest, ::Hash]
355
+ # A request object representing the call parameters. Required. To specify no
356
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
357
+ # @param options [::Gapic::CallOptions, ::Hash]
358
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
359
+ #
360
+ # @overload get_cluster(name: nil, view: nil)
361
+ # Pass arguments to `get_cluster` via keyword arguments. Note that at
362
+ # least one keyword argument is required. To specify no parameters, or to keep all
363
+ # the default parameter values, pass an empty Hash as a request object (see above).
364
+ #
365
+ # @param name [::String]
366
+ # Required. The name of the resource. For the required format, see the
367
+ # comment on the Cluster.name field.
368
+ # @param view [::Google::Cloud::AlloyDB::V1alpha::ClusterView]
369
+ # Optional. The view of the cluster to return. Returns all default fields if
370
+ # not set.
371
+ #
372
+ # @yield [response, operation] Access the result along with the RPC operation
373
+ # @yieldparam response [::Google::Cloud::AlloyDB::V1alpha::Cluster]
374
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
375
+ #
376
+ # @return [::Google::Cloud::AlloyDB::V1alpha::Cluster]
377
+ #
378
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
379
+ #
380
+ # @example Basic example
381
+ # require "google/cloud/alloy_db/v1alpha"
382
+ #
383
+ # # Create a client object. The client can be reused for multiple calls.
384
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
385
+ #
386
+ # # Create a request. To set request fields, pass in keyword arguments.
387
+ # request = Google::Cloud::AlloyDB::V1alpha::GetClusterRequest.new
388
+ #
389
+ # # Call the get_cluster method.
390
+ # result = client.get_cluster request
391
+ #
392
+ # # The returned object is of type Google::Cloud::AlloyDB::V1alpha::Cluster.
393
+ # p result
394
+ #
395
+ def get_cluster request, options = nil
396
+ raise ::ArgumentError, "request must be provided" if request.nil?
397
+
398
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::GetClusterRequest
399
+
400
+ # Converts hash and nil to an options object
401
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
402
+
403
+ # Customize the options with defaults
404
+ metadata = @config.rpcs.get_cluster.metadata.to_h
405
+
406
+ # Set x-goog-api-client and x-goog-user-project headers
407
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
408
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
409
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
410
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
411
+
412
+ header_params = {}
413
+ if request.name
414
+ header_params["name"] = request.name
415
+ end
416
+
417
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
418
+ metadata[:"x-goog-request-params"] ||= request_params_header
419
+
420
+ options.apply_defaults timeout: @config.rpcs.get_cluster.timeout,
421
+ metadata: metadata,
422
+ retry_policy: @config.rpcs.get_cluster.retry_policy
423
+
424
+ options.apply_defaults timeout: @config.timeout,
425
+ metadata: @config.metadata,
426
+ retry_policy: @config.retry_policy
427
+
428
+ @alloy_db_admin_stub.call_rpc :get_cluster, request, options: options do |response, operation|
429
+ yield response, operation if block_given?
430
+ return response
431
+ end
432
+ rescue ::GRPC::BadStatus => e
433
+ raise ::Google::Cloud::Error.from_error(e)
434
+ end
435
+
436
+ ##
437
+ # Creates a new Cluster in a given project and location.
438
+ #
439
+ # @overload create_cluster(request, options = nil)
440
+ # Pass arguments to `create_cluster` via a request object, either of type
441
+ # {::Google::Cloud::AlloyDB::V1alpha::CreateClusterRequest} or an equivalent Hash.
442
+ #
443
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::CreateClusterRequest, ::Hash]
444
+ # A request object representing the call parameters. Required. To specify no
445
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
446
+ # @param options [::Gapic::CallOptions, ::Hash]
447
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
448
+ #
449
+ # @overload create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil)
450
+ # Pass arguments to `create_cluster` via keyword arguments. Note that at
451
+ # least one keyword argument is required. To specify no parameters, or to keep all
452
+ # the default parameter values, pass an empty Hash as a request object (see above).
453
+ #
454
+ # @param parent [::String]
455
+ # Required. The location of the new cluster. For the required format, see the
456
+ # comment on the Cluster.name field.
457
+ # @param cluster_id [::String]
458
+ # Required. ID of the requesting object.
459
+ # @param cluster [::Google::Cloud::AlloyDB::V1alpha::Cluster, ::Hash]
460
+ # Required. The resource being created
461
+ # @param request_id [::String]
462
+ # Optional. An optional request ID to identify requests. Specify a unique
463
+ # request ID so that if you must retry your request, the server will know to
464
+ # ignore the request if it has already been completed. The server will
465
+ # guarantee that for at least 60 minutes since the first request.
466
+ #
467
+ # For example, consider a situation where you make an initial request and
468
+ # the request times out. If you make the request again with the same request
469
+ # ID, the server can check if original operation with the same request ID
470
+ # was received, and if so, will ignore the second request. This prevents
471
+ # clients from accidentally creating duplicate commitments.
472
+ #
473
+ # The request ID must be a valid UUID with the exception that zero UUID is
474
+ # not supported (00000000-0000-0000-0000-000000000000).
475
+ # @param validate_only [::Boolean]
476
+ # Optional. If set, performs request validation (e.g. permission checks and
477
+ # any other type of validation), but do not actually execute the create
478
+ # request.
479
+ #
480
+ # @yield [response, operation] Access the result along with the RPC operation
481
+ # @yieldparam response [::Gapic::Operation]
482
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
483
+ #
484
+ # @return [::Gapic::Operation]
485
+ #
486
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
487
+ #
488
+ # @example Basic example
489
+ # require "google/cloud/alloy_db/v1alpha"
490
+ #
491
+ # # Create a client object. The client can be reused for multiple calls.
492
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
493
+ #
494
+ # # Create a request. To set request fields, pass in keyword arguments.
495
+ # request = Google::Cloud::AlloyDB::V1alpha::CreateClusterRequest.new
496
+ #
497
+ # # Call the create_cluster method.
498
+ # result = client.create_cluster request
499
+ #
500
+ # # The returned object is of type Gapic::Operation. You can use it to
501
+ # # check the status of an operation, cancel it, or wait for results.
502
+ # # Here is how to wait for a response.
503
+ # result.wait_until_done! timeout: 60
504
+ # if result.response?
505
+ # p result.response
506
+ # else
507
+ # puts "No response received."
508
+ # end
509
+ #
510
+ def create_cluster request, options = nil
511
+ raise ::ArgumentError, "request must be provided" if request.nil?
512
+
513
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::CreateClusterRequest
514
+
515
+ # Converts hash and nil to an options object
516
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
517
+
518
+ # Customize the options with defaults
519
+ metadata = @config.rpcs.create_cluster.metadata.to_h
520
+
521
+ # Set x-goog-api-client and x-goog-user-project headers
522
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
523
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
524
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
525
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
526
+
527
+ header_params = {}
528
+ if request.parent
529
+ header_params["parent"] = request.parent
530
+ end
531
+
532
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
533
+ metadata[:"x-goog-request-params"] ||= request_params_header
534
+
535
+ options.apply_defaults timeout: @config.rpcs.create_cluster.timeout,
536
+ metadata: metadata,
537
+ retry_policy: @config.rpcs.create_cluster.retry_policy
538
+
539
+ options.apply_defaults timeout: @config.timeout,
540
+ metadata: @config.metadata,
541
+ retry_policy: @config.retry_policy
542
+
543
+ @alloy_db_admin_stub.call_rpc :create_cluster, request, options: options do |response, operation|
544
+ response = ::Gapic::Operation.new response, @operations_client, options: options
545
+ yield response, operation if block_given?
546
+ return response
547
+ end
548
+ rescue ::GRPC::BadStatus => e
549
+ raise ::Google::Cloud::Error.from_error(e)
550
+ end
551
+
552
+ ##
553
+ # Updates the parameters of a single Cluster.
554
+ #
555
+ # @overload update_cluster(request, options = nil)
556
+ # Pass arguments to `update_cluster` via a request object, either of type
557
+ # {::Google::Cloud::AlloyDB::V1alpha::UpdateClusterRequest} or an equivalent Hash.
558
+ #
559
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::UpdateClusterRequest, ::Hash]
560
+ # A request object representing the call parameters. Required. To specify no
561
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
562
+ # @param options [::Gapic::CallOptions, ::Hash]
563
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
564
+ #
565
+ # @overload update_cluster(update_mask: nil, cluster: nil, request_id: nil, validate_only: nil, allow_missing: nil)
566
+ # Pass arguments to `update_cluster` via keyword arguments. Note that at
567
+ # least one keyword argument is required. To specify no parameters, or to keep all
568
+ # the default parameter values, pass an empty Hash as a request object (see above).
569
+ #
570
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
571
+ # Optional. Field mask is used to specify the fields to be overwritten in the
572
+ # Cluster resource by the update.
573
+ # The fields specified in the update_mask are relative to the resource, not
574
+ # the full request. A field will be overwritten if it is in the mask. If the
575
+ # user does not provide a mask then all fields will be overwritten.
576
+ # @param cluster [::Google::Cloud::AlloyDB::V1alpha::Cluster, ::Hash]
577
+ # Required. The resource being updated
578
+ # @param request_id [::String]
579
+ # Optional. An optional request ID to identify requests. Specify a unique
580
+ # request ID so that if you must retry your request, the server will know to
581
+ # ignore the request if it has already been completed. The server will
582
+ # guarantee that for at least 60 minutes since the first request.
583
+ #
584
+ # For example, consider a situation where you make an initial request and
585
+ # the request times out. If you make the request again with the same request
586
+ # ID, the server can check if original operation with the same request ID
587
+ # was received, and if so, will ignore the second request. This prevents
588
+ # clients from accidentally creating duplicate commitments.
589
+ #
590
+ # The request ID must be a valid UUID with the exception that zero UUID is
591
+ # not supported (00000000-0000-0000-0000-000000000000).
592
+ # @param validate_only [::Boolean]
593
+ # Optional. If set, performs request validation (e.g. permission checks and
594
+ # any other type of validation), but do not actually execute the update
595
+ # request.
596
+ # @param allow_missing [::Boolean]
597
+ # Optional. If set to true, update succeeds even if cluster is not found. In
598
+ # that case, a new cluster is created and `update_mask` is ignored.
599
+ #
600
+ # @yield [response, operation] Access the result along with the RPC operation
601
+ # @yieldparam response [::Gapic::Operation]
602
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
603
+ #
604
+ # @return [::Gapic::Operation]
605
+ #
606
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
607
+ #
608
+ # @example Basic example
609
+ # require "google/cloud/alloy_db/v1alpha"
610
+ #
611
+ # # Create a client object. The client can be reused for multiple calls.
612
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
613
+ #
614
+ # # Create a request. To set request fields, pass in keyword arguments.
615
+ # request = Google::Cloud::AlloyDB::V1alpha::UpdateClusterRequest.new
616
+ #
617
+ # # Call the update_cluster method.
618
+ # result = client.update_cluster request
619
+ #
620
+ # # The returned object is of type Gapic::Operation. You can use it to
621
+ # # check the status of an operation, cancel it, or wait for results.
622
+ # # Here is how to wait for a response.
623
+ # result.wait_until_done! timeout: 60
624
+ # if result.response?
625
+ # p result.response
626
+ # else
627
+ # puts "No response received."
628
+ # end
629
+ #
630
+ def update_cluster request, options = nil
631
+ raise ::ArgumentError, "request must be provided" if request.nil?
632
+
633
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::UpdateClusterRequest
634
+
635
+ # Converts hash and nil to an options object
636
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
637
+
638
+ # Customize the options with defaults
639
+ metadata = @config.rpcs.update_cluster.metadata.to_h
640
+
641
+ # Set x-goog-api-client and x-goog-user-project headers
642
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
643
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
644
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
645
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
646
+
647
+ header_params = {}
648
+ if request.cluster&.name
649
+ header_params["cluster.name"] = request.cluster.name
650
+ end
651
+
652
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
653
+ metadata[:"x-goog-request-params"] ||= request_params_header
654
+
655
+ options.apply_defaults timeout: @config.rpcs.update_cluster.timeout,
656
+ metadata: metadata,
657
+ retry_policy: @config.rpcs.update_cluster.retry_policy
658
+
659
+ options.apply_defaults timeout: @config.timeout,
660
+ metadata: @config.metadata,
661
+ retry_policy: @config.retry_policy
662
+
663
+ @alloy_db_admin_stub.call_rpc :update_cluster, request, options: options do |response, operation|
664
+ response = ::Gapic::Operation.new response, @operations_client, options: options
665
+ yield response, operation if block_given?
666
+ return response
667
+ end
668
+ rescue ::GRPC::BadStatus => e
669
+ raise ::Google::Cloud::Error.from_error(e)
670
+ end
671
+
672
+ ##
673
+ # Deletes a single Cluster.
674
+ #
675
+ # @overload delete_cluster(request, options = nil)
676
+ # Pass arguments to `delete_cluster` via a request object, either of type
677
+ # {::Google::Cloud::AlloyDB::V1alpha::DeleteClusterRequest} or an equivalent Hash.
678
+ #
679
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::DeleteClusterRequest, ::Hash]
680
+ # A request object representing the call parameters. Required. To specify no
681
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
682
+ # @param options [::Gapic::CallOptions, ::Hash]
683
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
684
+ #
685
+ # @overload delete_cluster(name: nil, request_id: nil, etag: nil, validate_only: nil, force: nil)
686
+ # Pass arguments to `delete_cluster` via keyword arguments. Note that at
687
+ # least one keyword argument is required. To specify no parameters, or to keep all
688
+ # the default parameter values, pass an empty Hash as a request object (see above).
689
+ #
690
+ # @param name [::String]
691
+ # Required. The name of the resource. For the required format, see the
692
+ # comment on the Cluster.name field.
693
+ # @param request_id [::String]
694
+ # Optional. An optional request ID to identify requests. Specify a unique
695
+ # request ID so that if you must retry your request, the server will know to
696
+ # ignore the request if it has already been completed. The server will
697
+ # guarantee that for at least 60 minutes after the first request.
698
+ #
699
+ # For example, consider a situation where you make an initial request and
700
+ # the request times out. If you make the request again with the same request
701
+ # ID, the server can check if original operation with the same request ID
702
+ # was received, and if so, will ignore the second request. This prevents
703
+ # clients from accidentally creating duplicate commitments.
704
+ #
705
+ # The request ID must be a valid UUID with the exception that zero UUID is
706
+ # not supported (00000000-0000-0000-0000-000000000000).
707
+ # @param etag [::String]
708
+ # Optional. The current etag of the Cluster.
709
+ # If an etag is provided and does not match the current etag of the Cluster,
710
+ # deletion will be blocked and an ABORTED error will be returned.
711
+ # @param validate_only [::Boolean]
712
+ # Optional. If set, performs request validation (e.g. permission checks and
713
+ # any other type of validation), but do not actually execute the delete.
714
+ # @param force [::Boolean]
715
+ # Optional. Whether to cascade delete child instances for given cluster.
716
+ #
717
+ # @yield [response, operation] Access the result along with the RPC operation
718
+ # @yieldparam response [::Gapic::Operation]
719
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
720
+ #
721
+ # @return [::Gapic::Operation]
722
+ #
723
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
724
+ #
725
+ # @example Basic example
726
+ # require "google/cloud/alloy_db/v1alpha"
727
+ #
728
+ # # Create a client object. The client can be reused for multiple calls.
729
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
730
+ #
731
+ # # Create a request. To set request fields, pass in keyword arguments.
732
+ # request = Google::Cloud::AlloyDB::V1alpha::DeleteClusterRequest.new
733
+ #
734
+ # # Call the delete_cluster method.
735
+ # result = client.delete_cluster request
736
+ #
737
+ # # The returned object is of type Gapic::Operation. You can use it to
738
+ # # check the status of an operation, cancel it, or wait for results.
739
+ # # Here is how to wait for a response.
740
+ # result.wait_until_done! timeout: 60
741
+ # if result.response?
742
+ # p result.response
743
+ # else
744
+ # puts "No response received."
745
+ # end
746
+ #
747
+ def delete_cluster request, options = nil
748
+ raise ::ArgumentError, "request must be provided" if request.nil?
749
+
750
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::DeleteClusterRequest
751
+
752
+ # Converts hash and nil to an options object
753
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
754
+
755
+ # Customize the options with defaults
756
+ metadata = @config.rpcs.delete_cluster.metadata.to_h
757
+
758
+ # Set x-goog-api-client and x-goog-user-project headers
759
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
760
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
761
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
762
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
763
+
764
+ header_params = {}
765
+ if request.name
766
+ header_params["name"] = request.name
767
+ end
768
+
769
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
770
+ metadata[:"x-goog-request-params"] ||= request_params_header
771
+
772
+ options.apply_defaults timeout: @config.rpcs.delete_cluster.timeout,
773
+ metadata: metadata,
774
+ retry_policy: @config.rpcs.delete_cluster.retry_policy
775
+
776
+ options.apply_defaults timeout: @config.timeout,
777
+ metadata: @config.metadata,
778
+ retry_policy: @config.retry_policy
779
+
780
+ @alloy_db_admin_stub.call_rpc :delete_cluster, request, options: options do |response, operation|
781
+ response = ::Gapic::Operation.new response, @operations_client, options: options
782
+ yield response, operation if block_given?
783
+ return response
784
+ end
785
+ rescue ::GRPC::BadStatus => e
786
+ raise ::Google::Cloud::Error.from_error(e)
787
+ end
788
+
789
+ ##
790
+ # Promotes a SECONDARY cluster. This turns down replication
791
+ # from the PRIMARY cluster and promotes a secondary cluster
792
+ # into its own standalone cluster.
793
+ # Imperative only.
794
+ #
795
+ # @overload promote_cluster(request, options = nil)
796
+ # Pass arguments to `promote_cluster` via a request object, either of type
797
+ # {::Google::Cloud::AlloyDB::V1alpha::PromoteClusterRequest} or an equivalent Hash.
798
+ #
799
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::PromoteClusterRequest, ::Hash]
800
+ # A request object representing the call parameters. Required. To specify no
801
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
802
+ # @param options [::Gapic::CallOptions, ::Hash]
803
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
804
+ #
805
+ # @overload promote_cluster(name: nil, request_id: nil, etag: nil, validate_only: nil)
806
+ # Pass arguments to `promote_cluster` via keyword arguments. Note that at
807
+ # least one keyword argument is required. To specify no parameters, or to keep all
808
+ # the default parameter values, pass an empty Hash as a request object (see above).
809
+ #
810
+ # @param name [::String]
811
+ # Required. The name of the resource. For the required format, see the
812
+ # comment on the Cluster.name field
813
+ # @param request_id [::String]
814
+ # Optional. An optional request ID to identify requests. Specify a unique
815
+ # request ID so that if you must retry your request, the server will know to
816
+ # ignore the request if it has already been completed. The server will
817
+ # guarantee that for at least 60 minutes after the first request.
818
+ #
819
+ # For example, consider a situation where you make an initial request and
820
+ # the request times out. If you make the request again with the same request
821
+ # ID, the server can check if original operation with the same request ID
822
+ # was received, and if so, will ignore the second request. This prevents
823
+ # clients from accidentally creating duplicate commitments.
824
+ #
825
+ # The request ID must be a valid UUID with the exception that zero UUID is
826
+ # not supported (00000000-0000-0000-0000-000000000000).
827
+ # @param etag [::String]
828
+ # Optional. The current etag of the Cluster.
829
+ # If an etag is provided and does not match the current etag of the Cluster,
830
+ # deletion will be blocked and an ABORTED error will be returned.
831
+ # @param validate_only [::Boolean]
832
+ # Optional. If set, performs request validation (e.g. permission checks and
833
+ # any other type of validation), but do not actually execute the delete.
834
+ #
835
+ # @yield [response, operation] Access the result along with the RPC operation
836
+ # @yieldparam response [::Gapic::Operation]
837
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
838
+ #
839
+ # @return [::Gapic::Operation]
840
+ #
841
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
842
+ #
843
+ # @example Basic example
844
+ # require "google/cloud/alloy_db/v1alpha"
845
+ #
846
+ # # Create a client object. The client can be reused for multiple calls.
847
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
848
+ #
849
+ # # Create a request. To set request fields, pass in keyword arguments.
850
+ # request = Google::Cloud::AlloyDB::V1alpha::PromoteClusterRequest.new
851
+ #
852
+ # # Call the promote_cluster method.
853
+ # result = client.promote_cluster request
854
+ #
855
+ # # The returned object is of type Gapic::Operation. You can use it to
856
+ # # check the status of an operation, cancel it, or wait for results.
857
+ # # Here is how to wait for a response.
858
+ # result.wait_until_done! timeout: 60
859
+ # if result.response?
860
+ # p result.response
861
+ # else
862
+ # puts "No response received."
863
+ # end
864
+ #
865
+ def promote_cluster request, options = nil
866
+ raise ::ArgumentError, "request must be provided" if request.nil?
867
+
868
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::PromoteClusterRequest
869
+
870
+ # Converts hash and nil to an options object
871
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
872
+
873
+ # Customize the options with defaults
874
+ metadata = @config.rpcs.promote_cluster.metadata.to_h
875
+
876
+ # Set x-goog-api-client and x-goog-user-project headers
877
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
878
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
879
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
880
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
881
+
882
+ header_params = {}
883
+ if request.name
884
+ header_params["name"] = request.name
885
+ end
886
+
887
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
888
+ metadata[:"x-goog-request-params"] ||= request_params_header
889
+
890
+ options.apply_defaults timeout: @config.rpcs.promote_cluster.timeout,
891
+ metadata: metadata,
892
+ retry_policy: @config.rpcs.promote_cluster.retry_policy
893
+
894
+ options.apply_defaults timeout: @config.timeout,
895
+ metadata: @config.metadata,
896
+ retry_policy: @config.retry_policy
897
+
898
+ @alloy_db_admin_stub.call_rpc :promote_cluster, request, options: options do |response, operation|
899
+ response = ::Gapic::Operation.new response, @operations_client, options: options
900
+ yield response, operation if block_given?
901
+ return response
902
+ end
903
+ rescue ::GRPC::BadStatus => e
904
+ raise ::Google::Cloud::Error.from_error(e)
905
+ end
906
+
907
+ ##
908
+ # Creates a new Cluster in a given project and location, with a volume
909
+ # restored from the provided source, either a backup ID or a point-in-time
910
+ # and a source cluster.
911
+ #
912
+ # @overload restore_cluster(request, options = nil)
913
+ # Pass arguments to `restore_cluster` via a request object, either of type
914
+ # {::Google::Cloud::AlloyDB::V1alpha::RestoreClusterRequest} or an equivalent Hash.
915
+ #
916
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::RestoreClusterRequest, ::Hash]
917
+ # A request object representing the call parameters. Required. To specify no
918
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
919
+ # @param options [::Gapic::CallOptions, ::Hash]
920
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
921
+ #
922
+ # @overload restore_cluster(backup_source: nil, continuous_backup_source: nil, parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil)
923
+ # Pass arguments to `restore_cluster` via keyword arguments. Note that at
924
+ # least one keyword argument is required. To specify no parameters, or to keep all
925
+ # the default parameter values, pass an empty Hash as a request object (see above).
926
+ #
927
+ # @param backup_source [::Google::Cloud::AlloyDB::V1alpha::BackupSource, ::Hash]
928
+ # Backup source.
929
+ # @param continuous_backup_source [::Google::Cloud::AlloyDB::V1alpha::ContinuousBackupSource, ::Hash]
930
+ # ContinuousBackup source. Continuous backup needs to be enabled in the
931
+ # source cluster for this operation to succeed.
932
+ # @param parent [::String]
933
+ # Required. The name of the parent resource. For the required format, see the
934
+ # comment on the Cluster.name field.
935
+ # @param cluster_id [::String]
936
+ # Required. ID of the requesting object.
937
+ # @param cluster [::Google::Cloud::AlloyDB::V1alpha::Cluster, ::Hash]
938
+ # Required. The resource being created
939
+ # @param request_id [::String]
940
+ # Optional. An optional request ID to identify requests. Specify a unique
941
+ # request ID so that if you must retry your request, the server will know to
942
+ # ignore the request if it has already been completed. The server will
943
+ # guarantee that for at least 60 minutes since the first request.
944
+ #
945
+ # For example, consider a situation where you make an initial request and
946
+ # the request times out. If you make the request again with the same request
947
+ # ID, the server can check if original operation with the same request ID
948
+ # was received, and if so, will ignore the second request. This prevents
949
+ # clients from accidentally creating duplicate commitments.
950
+ #
951
+ # The request ID must be a valid UUID with the exception that zero UUID is
952
+ # not supported (00000000-0000-0000-0000-000000000000).
953
+ # @param validate_only [::Boolean]
954
+ # Optional. If set, performs request validation (e.g. permission checks and
955
+ # any other type of validation), but do not actually execute the import
956
+ # request.
957
+ #
958
+ # @yield [response, operation] Access the result along with the RPC operation
959
+ # @yieldparam response [::Gapic::Operation]
960
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
961
+ #
962
+ # @return [::Gapic::Operation]
963
+ #
964
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
965
+ #
966
+ # @example Basic example
967
+ # require "google/cloud/alloy_db/v1alpha"
968
+ #
969
+ # # Create a client object. The client can be reused for multiple calls.
970
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
971
+ #
972
+ # # Create a request. To set request fields, pass in keyword arguments.
973
+ # request = Google::Cloud::AlloyDB::V1alpha::RestoreClusterRequest.new
974
+ #
975
+ # # Call the restore_cluster method.
976
+ # result = client.restore_cluster request
977
+ #
978
+ # # The returned object is of type Gapic::Operation. You can use it to
979
+ # # check the status of an operation, cancel it, or wait for results.
980
+ # # Here is how to wait for a response.
981
+ # result.wait_until_done! timeout: 60
982
+ # if result.response?
983
+ # p result.response
984
+ # else
985
+ # puts "No response received."
986
+ # end
987
+ #
988
+ def restore_cluster request, options = nil
989
+ raise ::ArgumentError, "request must be provided" if request.nil?
990
+
991
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::RestoreClusterRequest
992
+
993
+ # Converts hash and nil to an options object
994
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
995
+
996
+ # Customize the options with defaults
997
+ metadata = @config.rpcs.restore_cluster.metadata.to_h
998
+
999
+ # Set x-goog-api-client and x-goog-user-project headers
1000
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1001
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1002
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
1003
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1004
+
1005
+ header_params = {}
1006
+ if request.parent
1007
+ header_params["parent"] = request.parent
1008
+ end
1009
+
1010
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1011
+ metadata[:"x-goog-request-params"] ||= request_params_header
1012
+
1013
+ options.apply_defaults timeout: @config.rpcs.restore_cluster.timeout,
1014
+ metadata: metadata,
1015
+ retry_policy: @config.rpcs.restore_cluster.retry_policy
1016
+
1017
+ options.apply_defaults timeout: @config.timeout,
1018
+ metadata: @config.metadata,
1019
+ retry_policy: @config.retry_policy
1020
+
1021
+ @alloy_db_admin_stub.call_rpc :restore_cluster, request, options: options do |response, operation|
1022
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1023
+ yield response, operation if block_given?
1024
+ return response
1025
+ end
1026
+ rescue ::GRPC::BadStatus => e
1027
+ raise ::Google::Cloud::Error.from_error(e)
1028
+ end
1029
+
1030
+ ##
1031
+ # Creates a cluster of type SECONDARY in the given location using
1032
+ # the primary cluster as the source.
1033
+ #
1034
+ # @overload create_secondary_cluster(request, options = nil)
1035
+ # Pass arguments to `create_secondary_cluster` via a request object, either of type
1036
+ # {::Google::Cloud::AlloyDB::V1alpha::CreateSecondaryClusterRequest} or an equivalent Hash.
1037
+ #
1038
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::CreateSecondaryClusterRequest, ::Hash]
1039
+ # A request object representing the call parameters. Required. To specify no
1040
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1041
+ # @param options [::Gapic::CallOptions, ::Hash]
1042
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1043
+ #
1044
+ # @overload create_secondary_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil)
1045
+ # Pass arguments to `create_secondary_cluster` via keyword arguments. Note that at
1046
+ # least one keyword argument is required. To specify no parameters, or to keep all
1047
+ # the default parameter values, pass an empty Hash as a request object (see above).
1048
+ #
1049
+ # @param parent [::String]
1050
+ # Required. The location of the new cluster. For the required
1051
+ # format, see the comment on the Cluster.name field.
1052
+ # @param cluster_id [::String]
1053
+ # Required. ID of the requesting object (the secondary cluster).
1054
+ # @param cluster [::Google::Cloud::AlloyDB::V1alpha::Cluster, ::Hash]
1055
+ # Required. Configuration of the requesting object (the secondary cluster).
1056
+ # @param request_id [::String]
1057
+ # Optional. An optional request ID to identify requests. Specify a unique
1058
+ # request ID so that if you must retry your request, the server will know to
1059
+ # ignore the request if it has already been completed. The server will
1060
+ # guarantee that for at least 60 minutes since the first request.
1061
+ #
1062
+ # For example, consider a situation where you make an initial request and
1063
+ # the request times out. If you make the request again with the same request
1064
+ # ID, the server can check if original operation with the same request ID
1065
+ # was received, and if so, will ignore the second request. This prevents
1066
+ # clients from accidentally creating duplicate commitments.
1067
+ #
1068
+ # The request ID must be a valid UUID with the exception that zero UUID is
1069
+ # not supported (00000000-0000-0000-0000-000000000000).
1070
+ # @param validate_only [::Boolean]
1071
+ # Optional. If set, performs request validation (e.g. permission checks and
1072
+ # any other type of validation), but do not actually execute the create
1073
+ # request.
1074
+ #
1075
+ # @yield [response, operation] Access the result along with the RPC operation
1076
+ # @yieldparam response [::Gapic::Operation]
1077
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1078
+ #
1079
+ # @return [::Gapic::Operation]
1080
+ #
1081
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1082
+ #
1083
+ # @example Basic example
1084
+ # require "google/cloud/alloy_db/v1alpha"
1085
+ #
1086
+ # # Create a client object. The client can be reused for multiple calls.
1087
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
1088
+ #
1089
+ # # Create a request. To set request fields, pass in keyword arguments.
1090
+ # request = Google::Cloud::AlloyDB::V1alpha::CreateSecondaryClusterRequest.new
1091
+ #
1092
+ # # Call the create_secondary_cluster method.
1093
+ # result = client.create_secondary_cluster request
1094
+ #
1095
+ # # The returned object is of type Gapic::Operation. You can use it to
1096
+ # # check the status of an operation, cancel it, or wait for results.
1097
+ # # Here is how to wait for a response.
1098
+ # result.wait_until_done! timeout: 60
1099
+ # if result.response?
1100
+ # p result.response
1101
+ # else
1102
+ # puts "No response received."
1103
+ # end
1104
+ #
1105
+ def create_secondary_cluster request, options = nil
1106
+ raise ::ArgumentError, "request must be provided" if request.nil?
1107
+
1108
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::CreateSecondaryClusterRequest
1109
+
1110
+ # Converts hash and nil to an options object
1111
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1112
+
1113
+ # Customize the options with defaults
1114
+ metadata = @config.rpcs.create_secondary_cluster.metadata.to_h
1115
+
1116
+ # Set x-goog-api-client and x-goog-user-project headers
1117
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1118
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1119
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
1120
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1121
+
1122
+ header_params = {}
1123
+ if request.parent
1124
+ header_params["parent"] = request.parent
1125
+ end
1126
+
1127
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1128
+ metadata[:"x-goog-request-params"] ||= request_params_header
1129
+
1130
+ options.apply_defaults timeout: @config.rpcs.create_secondary_cluster.timeout,
1131
+ metadata: metadata,
1132
+ retry_policy: @config.rpcs.create_secondary_cluster.retry_policy
1133
+
1134
+ options.apply_defaults timeout: @config.timeout,
1135
+ metadata: @config.metadata,
1136
+ retry_policy: @config.retry_policy
1137
+
1138
+ @alloy_db_admin_stub.call_rpc :create_secondary_cluster, request, options: options do |response, operation|
1139
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1140
+ yield response, operation if block_given?
1141
+ return response
1142
+ end
1143
+ rescue ::GRPC::BadStatus => e
1144
+ raise ::Google::Cloud::Error.from_error(e)
1145
+ end
1146
+
1147
+ ##
1148
+ # Lists Instances in a given project and location.
1149
+ #
1150
+ # @overload list_instances(request, options = nil)
1151
+ # Pass arguments to `list_instances` via a request object, either of type
1152
+ # {::Google::Cloud::AlloyDB::V1alpha::ListInstancesRequest} or an equivalent Hash.
1153
+ #
1154
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::ListInstancesRequest, ::Hash]
1155
+ # A request object representing the call parameters. Required. To specify no
1156
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1157
+ # @param options [::Gapic::CallOptions, ::Hash]
1158
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1159
+ #
1160
+ # @overload list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
1161
+ # Pass arguments to `list_instances` via keyword arguments. Note that at
1162
+ # least one keyword argument is required. To specify no parameters, or to keep all
1163
+ # the default parameter values, pass an empty Hash as a request object (see above).
1164
+ #
1165
+ # @param parent [::String]
1166
+ # Required. The name of the parent resource. For the required format, see the
1167
+ # comment on the Instance.name field. Additionally, you can perform an
1168
+ # aggregated list operation by specifying a value with one of the following
1169
+ # formats:
1170
+ # * projects/\\{project}/locations/-/clusters/-
1171
+ # * projects/\\{project}/locations/\\{region}/clusters/-
1172
+ # @param page_size [::Integer]
1173
+ # Optional. Requested page size. Server may return fewer items than
1174
+ # requested. If unspecified, server will pick an appropriate default.
1175
+ # @param page_token [::String]
1176
+ # A token identifying a page of results the server should return.
1177
+ # @param filter [::String]
1178
+ # Optional. Filtering results
1179
+ # @param order_by [::String]
1180
+ # Optional. Hint for how to order the results
1181
+ #
1182
+ # @yield [response, operation] Access the result along with the RPC operation
1183
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1alpha::Instance>]
1184
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1185
+ #
1186
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1alpha::Instance>]
1187
+ #
1188
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1189
+ #
1190
+ # @example Basic example
1191
+ # require "google/cloud/alloy_db/v1alpha"
1192
+ #
1193
+ # # Create a client object. The client can be reused for multiple calls.
1194
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
1195
+ #
1196
+ # # Create a request. To set request fields, pass in keyword arguments.
1197
+ # request = Google::Cloud::AlloyDB::V1alpha::ListInstancesRequest.new
1198
+ #
1199
+ # # Call the list_instances method.
1200
+ # result = client.list_instances request
1201
+ #
1202
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1203
+ # # over elements, and API calls will be issued to fetch pages as needed.
1204
+ # result.each do |item|
1205
+ # # Each element is of type ::Google::Cloud::AlloyDB::V1alpha::Instance.
1206
+ # p item
1207
+ # end
1208
+ #
1209
+ def list_instances request, options = nil
1210
+ raise ::ArgumentError, "request must be provided" if request.nil?
1211
+
1212
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::ListInstancesRequest
1213
+
1214
+ # Converts hash and nil to an options object
1215
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1216
+
1217
+ # Customize the options with defaults
1218
+ metadata = @config.rpcs.list_instances.metadata.to_h
1219
+
1220
+ # Set x-goog-api-client and x-goog-user-project headers
1221
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1222
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1223
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
1224
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1225
+
1226
+ header_params = {}
1227
+ if request.parent
1228
+ header_params["parent"] = request.parent
1229
+ end
1230
+
1231
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1232
+ metadata[:"x-goog-request-params"] ||= request_params_header
1233
+
1234
+ options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
1235
+ metadata: metadata,
1236
+ retry_policy: @config.rpcs.list_instances.retry_policy
1237
+
1238
+ options.apply_defaults timeout: @config.timeout,
1239
+ metadata: @config.metadata,
1240
+ retry_policy: @config.retry_policy
1241
+
1242
+ @alloy_db_admin_stub.call_rpc :list_instances, request, options: options do |response, operation|
1243
+ response = ::Gapic::PagedEnumerable.new @alloy_db_admin_stub, :list_instances, request, response, operation, options
1244
+ yield response, operation if block_given?
1245
+ return response
1246
+ end
1247
+ rescue ::GRPC::BadStatus => e
1248
+ raise ::Google::Cloud::Error.from_error(e)
1249
+ end
1250
+
1251
+ ##
1252
+ # Gets details of a single Instance.
1253
+ #
1254
+ # @overload get_instance(request, options = nil)
1255
+ # Pass arguments to `get_instance` via a request object, either of type
1256
+ # {::Google::Cloud::AlloyDB::V1alpha::GetInstanceRequest} or an equivalent Hash.
1257
+ #
1258
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::GetInstanceRequest, ::Hash]
1259
+ # A request object representing the call parameters. Required. To specify no
1260
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1261
+ # @param options [::Gapic::CallOptions, ::Hash]
1262
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1263
+ #
1264
+ # @overload get_instance(name: nil, view: nil)
1265
+ # Pass arguments to `get_instance` via keyword arguments. Note that at
1266
+ # least one keyword argument is required. To specify no parameters, or to keep all
1267
+ # the default parameter values, pass an empty Hash as a request object (see above).
1268
+ #
1269
+ # @param name [::String]
1270
+ # Required. The name of the resource. For the required format, see the
1271
+ # comment on the Instance.name field.
1272
+ # @param view [::Google::Cloud::AlloyDB::V1alpha::InstanceView]
1273
+ # The view of the instance to return.
1274
+ #
1275
+ # @yield [response, operation] Access the result along with the RPC operation
1276
+ # @yieldparam response [::Google::Cloud::AlloyDB::V1alpha::Instance]
1277
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1278
+ #
1279
+ # @return [::Google::Cloud::AlloyDB::V1alpha::Instance]
1280
+ #
1281
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1282
+ #
1283
+ # @example Basic example
1284
+ # require "google/cloud/alloy_db/v1alpha"
1285
+ #
1286
+ # # Create a client object. The client can be reused for multiple calls.
1287
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
1288
+ #
1289
+ # # Create a request. To set request fields, pass in keyword arguments.
1290
+ # request = Google::Cloud::AlloyDB::V1alpha::GetInstanceRequest.new
1291
+ #
1292
+ # # Call the get_instance method.
1293
+ # result = client.get_instance request
1294
+ #
1295
+ # # The returned object is of type Google::Cloud::AlloyDB::V1alpha::Instance.
1296
+ # p result
1297
+ #
1298
+ def get_instance request, options = nil
1299
+ raise ::ArgumentError, "request must be provided" if request.nil?
1300
+
1301
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::GetInstanceRequest
1302
+
1303
+ # Converts hash and nil to an options object
1304
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1305
+
1306
+ # Customize the options with defaults
1307
+ metadata = @config.rpcs.get_instance.metadata.to_h
1308
+
1309
+ # Set x-goog-api-client and x-goog-user-project headers
1310
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1311
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1312
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
1313
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1314
+
1315
+ header_params = {}
1316
+ if request.name
1317
+ header_params["name"] = request.name
1318
+ end
1319
+
1320
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1321
+ metadata[:"x-goog-request-params"] ||= request_params_header
1322
+
1323
+ options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
1324
+ metadata: metadata,
1325
+ retry_policy: @config.rpcs.get_instance.retry_policy
1326
+
1327
+ options.apply_defaults timeout: @config.timeout,
1328
+ metadata: @config.metadata,
1329
+ retry_policy: @config.retry_policy
1330
+
1331
+ @alloy_db_admin_stub.call_rpc :get_instance, request, options: options do |response, operation|
1332
+ yield response, operation if block_given?
1333
+ return response
1334
+ end
1335
+ rescue ::GRPC::BadStatus => e
1336
+ raise ::Google::Cloud::Error.from_error(e)
1337
+ end
1338
+
1339
+ ##
1340
+ # Creates a new Instance in a given project and location.
1341
+ #
1342
+ # @overload create_instance(request, options = nil)
1343
+ # Pass arguments to `create_instance` via a request object, either of type
1344
+ # {::Google::Cloud::AlloyDB::V1alpha::CreateInstanceRequest} or an equivalent Hash.
1345
+ #
1346
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::CreateInstanceRequest, ::Hash]
1347
+ # A request object representing the call parameters. Required. To specify no
1348
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1349
+ # @param options [::Gapic::CallOptions, ::Hash]
1350
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1351
+ #
1352
+ # @overload create_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: nil)
1353
+ # Pass arguments to `create_instance` via keyword arguments. Note that at
1354
+ # least one keyword argument is required. To specify no parameters, or to keep all
1355
+ # the default parameter values, pass an empty Hash as a request object (see above).
1356
+ #
1357
+ # @param parent [::String]
1358
+ # Required. The name of the parent resource. For the required format, see the
1359
+ # comment on the Instance.name field.
1360
+ # @param instance_id [::String]
1361
+ # Required. ID of the requesting object.
1362
+ # @param instance [::Google::Cloud::AlloyDB::V1alpha::Instance, ::Hash]
1363
+ # Required. The resource being created
1364
+ # @param request_id [::String]
1365
+ # Optional. An optional request ID to identify requests. Specify a unique
1366
+ # request ID so that if you must retry your request, the server will know to
1367
+ # ignore the request if it has already been completed. The server will
1368
+ # guarantee that for at least 60 minutes since the first request.
1369
+ #
1370
+ # For example, consider a situation where you make an initial request and
1371
+ # the request times out. If you make the request again with the same request
1372
+ # ID, the server can check if original operation with the same request ID
1373
+ # was received, and if so, will ignore the second request. This prevents
1374
+ # clients from accidentally creating duplicate commitments.
1375
+ #
1376
+ # The request ID must be a valid UUID with the exception that zero UUID is
1377
+ # not supported (00000000-0000-0000-0000-000000000000).
1378
+ # @param validate_only [::Boolean]
1379
+ # Optional. If set, performs request validation (e.g. permission checks and
1380
+ # any other type of validation), but do not actually execute the create
1381
+ # request.
1382
+ #
1383
+ # @yield [response, operation] Access the result along with the RPC operation
1384
+ # @yieldparam response [::Gapic::Operation]
1385
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1386
+ #
1387
+ # @return [::Gapic::Operation]
1388
+ #
1389
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1390
+ #
1391
+ # @example Basic example
1392
+ # require "google/cloud/alloy_db/v1alpha"
1393
+ #
1394
+ # # Create a client object. The client can be reused for multiple calls.
1395
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
1396
+ #
1397
+ # # Create a request. To set request fields, pass in keyword arguments.
1398
+ # request = Google::Cloud::AlloyDB::V1alpha::CreateInstanceRequest.new
1399
+ #
1400
+ # # Call the create_instance method.
1401
+ # result = client.create_instance request
1402
+ #
1403
+ # # The returned object is of type Gapic::Operation. You can use it to
1404
+ # # check the status of an operation, cancel it, or wait for results.
1405
+ # # Here is how to wait for a response.
1406
+ # result.wait_until_done! timeout: 60
1407
+ # if result.response?
1408
+ # p result.response
1409
+ # else
1410
+ # puts "No response received."
1411
+ # end
1412
+ #
1413
+ def create_instance request, options = nil
1414
+ raise ::ArgumentError, "request must be provided" if request.nil?
1415
+
1416
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::CreateInstanceRequest
1417
+
1418
+ # Converts hash and nil to an options object
1419
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1420
+
1421
+ # Customize the options with defaults
1422
+ metadata = @config.rpcs.create_instance.metadata.to_h
1423
+
1424
+ # Set x-goog-api-client and x-goog-user-project headers
1425
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1426
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1427
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
1428
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1429
+
1430
+ header_params = {}
1431
+ if request.parent
1432
+ header_params["parent"] = request.parent
1433
+ end
1434
+
1435
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1436
+ metadata[:"x-goog-request-params"] ||= request_params_header
1437
+
1438
+ options.apply_defaults timeout: @config.rpcs.create_instance.timeout,
1439
+ metadata: metadata,
1440
+ retry_policy: @config.rpcs.create_instance.retry_policy
1441
+
1442
+ options.apply_defaults timeout: @config.timeout,
1443
+ metadata: @config.metadata,
1444
+ retry_policy: @config.retry_policy
1445
+
1446
+ @alloy_db_admin_stub.call_rpc :create_instance, request, options: options do |response, operation|
1447
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1448
+ yield response, operation if block_given?
1449
+ return response
1450
+ end
1451
+ rescue ::GRPC::BadStatus => e
1452
+ raise ::Google::Cloud::Error.from_error(e)
1453
+ end
1454
+
1455
+ ##
1456
+ # Creates a new SECONDARY Instance in a given project and location.
1457
+ #
1458
+ # @overload create_secondary_instance(request, options = nil)
1459
+ # Pass arguments to `create_secondary_instance` via a request object, either of type
1460
+ # {::Google::Cloud::AlloyDB::V1alpha::CreateSecondaryInstanceRequest} or an equivalent Hash.
1461
+ #
1462
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::CreateSecondaryInstanceRequest, ::Hash]
1463
+ # A request object representing the call parameters. Required. To specify no
1464
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1465
+ # @param options [::Gapic::CallOptions, ::Hash]
1466
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1467
+ #
1468
+ # @overload create_secondary_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: nil)
1469
+ # Pass arguments to `create_secondary_instance` via keyword arguments. Note that at
1470
+ # least one keyword argument is required. To specify no parameters, or to keep all
1471
+ # the default parameter values, pass an empty Hash as a request object (see above).
1472
+ #
1473
+ # @param parent [::String]
1474
+ # Required. The name of the parent resource. For the required format, see the
1475
+ # comment on the Instance.name field.
1476
+ # @param instance_id [::String]
1477
+ # Required. ID of the requesting object.
1478
+ # @param instance [::Google::Cloud::AlloyDB::V1alpha::Instance, ::Hash]
1479
+ # Required. The resource being created
1480
+ # @param request_id [::String]
1481
+ # Optional. An optional request ID to identify requests. Specify a unique
1482
+ # request ID so that if you must retry your request, the server will know to
1483
+ # ignore the request if it has already been completed. The server will
1484
+ # guarantee that for at least 60 minutes since the first request.
1485
+ #
1486
+ # For example, consider a situation where you make an initial request and
1487
+ # the request times out. If you make the request again with the same request
1488
+ # ID, the server can check if original operation with the same request ID
1489
+ # was received, and if so, will ignore the second request. This prevents
1490
+ # clients from accidentally creating duplicate commitments.
1491
+ #
1492
+ # The request ID must be a valid UUID with the exception that zero UUID is
1493
+ # not supported (00000000-0000-0000-0000-000000000000).
1494
+ # @param validate_only [::Boolean]
1495
+ # Optional. If set, performs request validation (e.g. permission checks and
1496
+ # any other type of validation), but do not actually execute the create
1497
+ # request.
1498
+ #
1499
+ # @yield [response, operation] Access the result along with the RPC operation
1500
+ # @yieldparam response [::Gapic::Operation]
1501
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1502
+ #
1503
+ # @return [::Gapic::Operation]
1504
+ #
1505
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1506
+ #
1507
+ # @example Basic example
1508
+ # require "google/cloud/alloy_db/v1alpha"
1509
+ #
1510
+ # # Create a client object. The client can be reused for multiple calls.
1511
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
1512
+ #
1513
+ # # Create a request. To set request fields, pass in keyword arguments.
1514
+ # request = Google::Cloud::AlloyDB::V1alpha::CreateSecondaryInstanceRequest.new
1515
+ #
1516
+ # # Call the create_secondary_instance method.
1517
+ # result = client.create_secondary_instance request
1518
+ #
1519
+ # # The returned object is of type Gapic::Operation. You can use it to
1520
+ # # check the status of an operation, cancel it, or wait for results.
1521
+ # # Here is how to wait for a response.
1522
+ # result.wait_until_done! timeout: 60
1523
+ # if result.response?
1524
+ # p result.response
1525
+ # else
1526
+ # puts "No response received."
1527
+ # end
1528
+ #
1529
+ def create_secondary_instance request, options = nil
1530
+ raise ::ArgumentError, "request must be provided" if request.nil?
1531
+
1532
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::CreateSecondaryInstanceRequest
1533
+
1534
+ # Converts hash and nil to an options object
1535
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1536
+
1537
+ # Customize the options with defaults
1538
+ metadata = @config.rpcs.create_secondary_instance.metadata.to_h
1539
+
1540
+ # Set x-goog-api-client and x-goog-user-project headers
1541
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1542
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1543
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
1544
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1545
+
1546
+ header_params = {}
1547
+ if request.parent
1548
+ header_params["parent"] = request.parent
1549
+ end
1550
+
1551
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1552
+ metadata[:"x-goog-request-params"] ||= request_params_header
1553
+
1554
+ options.apply_defaults timeout: @config.rpcs.create_secondary_instance.timeout,
1555
+ metadata: metadata,
1556
+ retry_policy: @config.rpcs.create_secondary_instance.retry_policy
1557
+
1558
+ options.apply_defaults timeout: @config.timeout,
1559
+ metadata: @config.metadata,
1560
+ retry_policy: @config.retry_policy
1561
+
1562
+ @alloy_db_admin_stub.call_rpc :create_secondary_instance, request, options: options do |response, operation|
1563
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1564
+ yield response, operation if block_given?
1565
+ return response
1566
+ end
1567
+ rescue ::GRPC::BadStatus => e
1568
+ raise ::Google::Cloud::Error.from_error(e)
1569
+ end
1570
+
1571
+ ##
1572
+ # Creates new instances under the given project, location and cluster.
1573
+ # There can be only one primary instance in a cluster. If the primary
1574
+ # instance exists in the cluster as well as this request, then API will
1575
+ # throw an error.
1576
+ # The primary instance should exist before any read pool instance is
1577
+ # created. If the primary instance is a part of the request payload, then
1578
+ # the API will take care of creating instances in the correct order.
1579
+ # This method is here to support Google-internal use cases, and is not meant
1580
+ # for external customers to consume. Please do not start relying on it; its
1581
+ # behavior is subject to change without notice.
1582
+ #
1583
+ # @overload batch_create_instances(request, options = nil)
1584
+ # Pass arguments to `batch_create_instances` via a request object, either of type
1585
+ # {::Google::Cloud::AlloyDB::V1alpha::BatchCreateInstancesRequest} or an equivalent Hash.
1586
+ #
1587
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::BatchCreateInstancesRequest, ::Hash]
1588
+ # A request object representing the call parameters. Required. To specify no
1589
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1590
+ # @param options [::Gapic::CallOptions, ::Hash]
1591
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1592
+ #
1593
+ # @overload batch_create_instances(parent: nil, requests: nil, request_id: nil)
1594
+ # Pass arguments to `batch_create_instances` via keyword arguments. Note that at
1595
+ # least one keyword argument is required. To specify no parameters, or to keep all
1596
+ # the default parameter values, pass an empty Hash as a request object (see above).
1597
+ #
1598
+ # @param parent [::String]
1599
+ # Required. The name of the parent resource.
1600
+ # @param requests [::Google::Cloud::AlloyDB::V1alpha::CreateInstanceRequests, ::Hash]
1601
+ # Required. Resources being created.
1602
+ # @param request_id [::String]
1603
+ # Optional. An optional request ID to identify requests. Specify a unique
1604
+ # request ID so that if you must retry your request, the server will know to
1605
+ # ignore the request if it has already been completed. The server will
1606
+ # guarantee that for at least 60 minutes since the first request.
1607
+ #
1608
+ # For example, consider a situation where you make an initial request and
1609
+ # the request times out. If you make the request again with the same request
1610
+ # ID, the server can check if original operation with the same request ID
1611
+ # was received, and if so, will ignore the second request. This prevents
1612
+ # clients from accidentally creating duplicate commitments.
1613
+ #
1614
+ # The request ID must be a valid UUID with the exception that zero UUID is
1615
+ # not supported (00000000-0000-0000-0000-000000000000).
1616
+ #
1617
+ # @yield [response, operation] Access the result along with the RPC operation
1618
+ # @yieldparam response [::Gapic::Operation]
1619
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1620
+ #
1621
+ # @return [::Gapic::Operation]
1622
+ #
1623
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1624
+ #
1625
+ # @example Basic example
1626
+ # require "google/cloud/alloy_db/v1alpha"
1627
+ #
1628
+ # # Create a client object. The client can be reused for multiple calls.
1629
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
1630
+ #
1631
+ # # Create a request. To set request fields, pass in keyword arguments.
1632
+ # request = Google::Cloud::AlloyDB::V1alpha::BatchCreateInstancesRequest.new
1633
+ #
1634
+ # # Call the batch_create_instances method.
1635
+ # result = client.batch_create_instances request
1636
+ #
1637
+ # # The returned object is of type Gapic::Operation. You can use it to
1638
+ # # check the status of an operation, cancel it, or wait for results.
1639
+ # # Here is how to wait for a response.
1640
+ # result.wait_until_done! timeout: 60
1641
+ # if result.response?
1642
+ # p result.response
1643
+ # else
1644
+ # puts "No response received."
1645
+ # end
1646
+ #
1647
+ def batch_create_instances request, options = nil
1648
+ raise ::ArgumentError, "request must be provided" if request.nil?
1649
+
1650
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::BatchCreateInstancesRequest
1651
+
1652
+ # Converts hash and nil to an options object
1653
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1654
+
1655
+ # Customize the options with defaults
1656
+ metadata = @config.rpcs.batch_create_instances.metadata.to_h
1657
+
1658
+ # Set x-goog-api-client and x-goog-user-project headers
1659
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1660
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1661
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
1662
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1663
+
1664
+ header_params = {}
1665
+ if request.parent
1666
+ header_params["parent"] = request.parent
1667
+ end
1668
+
1669
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1670
+ metadata[:"x-goog-request-params"] ||= request_params_header
1671
+
1672
+ options.apply_defaults timeout: @config.rpcs.batch_create_instances.timeout,
1673
+ metadata: metadata,
1674
+ retry_policy: @config.rpcs.batch_create_instances.retry_policy
1675
+
1676
+ options.apply_defaults timeout: @config.timeout,
1677
+ metadata: @config.metadata,
1678
+ retry_policy: @config.retry_policy
1679
+
1680
+ @alloy_db_admin_stub.call_rpc :batch_create_instances, request, options: options do |response, operation|
1681
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1682
+ yield response, operation if block_given?
1683
+ return response
1684
+ end
1685
+ rescue ::GRPC::BadStatus => e
1686
+ raise ::Google::Cloud::Error.from_error(e)
1687
+ end
1688
+
1689
+ ##
1690
+ # Updates the parameters of a single Instance.
1691
+ #
1692
+ # @overload update_instance(request, options = nil)
1693
+ # Pass arguments to `update_instance` via a request object, either of type
1694
+ # {::Google::Cloud::AlloyDB::V1alpha::UpdateInstanceRequest} or an equivalent Hash.
1695
+ #
1696
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::UpdateInstanceRequest, ::Hash]
1697
+ # A request object representing the call parameters. Required. To specify no
1698
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1699
+ # @param options [::Gapic::CallOptions, ::Hash]
1700
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1701
+ #
1702
+ # @overload update_instance(update_mask: nil, instance: nil, request_id: nil, validate_only: nil, allow_missing: nil)
1703
+ # Pass arguments to `update_instance` via keyword arguments. Note that at
1704
+ # least one keyword argument is required. To specify no parameters, or to keep all
1705
+ # the default parameter values, pass an empty Hash as a request object (see above).
1706
+ #
1707
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1708
+ # Optional. Field mask is used to specify the fields to be overwritten in the
1709
+ # Instance resource by the update.
1710
+ # The fields specified in the update_mask are relative to the resource, not
1711
+ # the full request. A field will be overwritten if it is in the mask. If the
1712
+ # user does not provide a mask then all fields will be overwritten.
1713
+ # @param instance [::Google::Cloud::AlloyDB::V1alpha::Instance, ::Hash]
1714
+ # Required. The resource being updated
1715
+ # @param request_id [::String]
1716
+ # Optional. An optional request ID to identify requests. Specify a unique
1717
+ # request ID so that if you must retry your request, the server will know to
1718
+ # ignore the request if it has already been completed. The server will
1719
+ # guarantee that for at least 60 minutes since the first request.
1720
+ #
1721
+ # For example, consider a situation where you make an initial request and
1722
+ # the request times out. If you make the request again with the same request
1723
+ # ID, the server can check if original operation with the same request ID
1724
+ # was received, and if so, will ignore the second request. This prevents
1725
+ # clients from accidentally creating duplicate commitments.
1726
+ #
1727
+ # The request ID must be a valid UUID with the exception that zero UUID is
1728
+ # not supported (00000000-0000-0000-0000-000000000000).
1729
+ # @param validate_only [::Boolean]
1730
+ # Optional. If set, performs request validation (e.g. permission checks and
1731
+ # any other type of validation), but do not actually execute the update
1732
+ # request.
1733
+ # @param allow_missing [::Boolean]
1734
+ # Optional. If set to true, update succeeds even if instance is not found. In
1735
+ # that case, a new instance is created and `update_mask` is ignored.
1736
+ #
1737
+ # @yield [response, operation] Access the result along with the RPC operation
1738
+ # @yieldparam response [::Gapic::Operation]
1739
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1740
+ #
1741
+ # @return [::Gapic::Operation]
1742
+ #
1743
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1744
+ #
1745
+ # @example Basic example
1746
+ # require "google/cloud/alloy_db/v1alpha"
1747
+ #
1748
+ # # Create a client object. The client can be reused for multiple calls.
1749
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
1750
+ #
1751
+ # # Create a request. To set request fields, pass in keyword arguments.
1752
+ # request = Google::Cloud::AlloyDB::V1alpha::UpdateInstanceRequest.new
1753
+ #
1754
+ # # Call the update_instance method.
1755
+ # result = client.update_instance request
1756
+ #
1757
+ # # The returned object is of type Gapic::Operation. You can use it to
1758
+ # # check the status of an operation, cancel it, or wait for results.
1759
+ # # Here is how to wait for a response.
1760
+ # result.wait_until_done! timeout: 60
1761
+ # if result.response?
1762
+ # p result.response
1763
+ # else
1764
+ # puts "No response received."
1765
+ # end
1766
+ #
1767
+ def update_instance request, options = nil
1768
+ raise ::ArgumentError, "request must be provided" if request.nil?
1769
+
1770
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::UpdateInstanceRequest
1771
+
1772
+ # Converts hash and nil to an options object
1773
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1774
+
1775
+ # Customize the options with defaults
1776
+ metadata = @config.rpcs.update_instance.metadata.to_h
1777
+
1778
+ # Set x-goog-api-client and x-goog-user-project headers
1779
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1780
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1781
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
1782
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1783
+
1784
+ header_params = {}
1785
+ if request.instance&.name
1786
+ header_params["instance.name"] = request.instance.name
1787
+ end
1788
+
1789
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1790
+ metadata[:"x-goog-request-params"] ||= request_params_header
1791
+
1792
+ options.apply_defaults timeout: @config.rpcs.update_instance.timeout,
1793
+ metadata: metadata,
1794
+ retry_policy: @config.rpcs.update_instance.retry_policy
1795
+
1796
+ options.apply_defaults timeout: @config.timeout,
1797
+ metadata: @config.metadata,
1798
+ retry_policy: @config.retry_policy
1799
+
1800
+ @alloy_db_admin_stub.call_rpc :update_instance, request, options: options do |response, operation|
1801
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1802
+ yield response, operation if block_given?
1803
+ return response
1804
+ end
1805
+ rescue ::GRPC::BadStatus => e
1806
+ raise ::Google::Cloud::Error.from_error(e)
1807
+ end
1808
+
1809
+ ##
1810
+ # Deletes a single Instance.
1811
+ #
1812
+ # @overload delete_instance(request, options = nil)
1813
+ # Pass arguments to `delete_instance` via a request object, either of type
1814
+ # {::Google::Cloud::AlloyDB::V1alpha::DeleteInstanceRequest} or an equivalent Hash.
1815
+ #
1816
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::DeleteInstanceRequest, ::Hash]
1817
+ # A request object representing the call parameters. Required. To specify no
1818
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1819
+ # @param options [::Gapic::CallOptions, ::Hash]
1820
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1821
+ #
1822
+ # @overload delete_instance(name: nil, request_id: nil, etag: nil, validate_only: nil)
1823
+ # Pass arguments to `delete_instance` via keyword arguments. Note that at
1824
+ # least one keyword argument is required. To specify no parameters, or to keep all
1825
+ # the default parameter values, pass an empty Hash as a request object (see above).
1826
+ #
1827
+ # @param name [::String]
1828
+ # Required. The name of the resource. For the required format, see the
1829
+ # comment on the Instance.name field.
1830
+ # @param request_id [::String]
1831
+ # Optional. An optional request ID to identify requests. Specify a unique
1832
+ # request ID so that if you must retry your request, the server will know to
1833
+ # ignore the request if it has already been completed. The server will
1834
+ # guarantee that for at least 60 minutes after the first request.
1835
+ #
1836
+ # For example, consider a situation where you make an initial request and
1837
+ # the request times out. If you make the request again with the same request
1838
+ # ID, the server can check if original operation with the same request ID
1839
+ # was received, and if so, will ignore the second request. This prevents
1840
+ # clients from accidentally creating duplicate commitments.
1841
+ #
1842
+ # The request ID must be a valid UUID with the exception that zero UUID is
1843
+ # not supported (00000000-0000-0000-0000-000000000000).
1844
+ # @param etag [::String]
1845
+ # Optional. The current etag of the Instance.
1846
+ # If an etag is provided and does not match the current etag of the Instance,
1847
+ # deletion will be blocked and an ABORTED error will be returned.
1848
+ # @param validate_only [::Boolean]
1849
+ # Optional. If set, performs request validation (e.g. permission checks and
1850
+ # any other type of validation), but do not actually execute the delete.
1851
+ #
1852
+ # @yield [response, operation] Access the result along with the RPC operation
1853
+ # @yieldparam response [::Gapic::Operation]
1854
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1855
+ #
1856
+ # @return [::Gapic::Operation]
1857
+ #
1858
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1859
+ #
1860
+ # @example Basic example
1861
+ # require "google/cloud/alloy_db/v1alpha"
1862
+ #
1863
+ # # Create a client object. The client can be reused for multiple calls.
1864
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
1865
+ #
1866
+ # # Create a request. To set request fields, pass in keyword arguments.
1867
+ # request = Google::Cloud::AlloyDB::V1alpha::DeleteInstanceRequest.new
1868
+ #
1869
+ # # Call the delete_instance method.
1870
+ # result = client.delete_instance request
1871
+ #
1872
+ # # The returned object is of type Gapic::Operation. You can use it to
1873
+ # # check the status of an operation, cancel it, or wait for results.
1874
+ # # Here is how to wait for a response.
1875
+ # result.wait_until_done! timeout: 60
1876
+ # if result.response?
1877
+ # p result.response
1878
+ # else
1879
+ # puts "No response received."
1880
+ # end
1881
+ #
1882
+ def delete_instance request, options = nil
1883
+ raise ::ArgumentError, "request must be provided" if request.nil?
1884
+
1885
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::DeleteInstanceRequest
1886
+
1887
+ # Converts hash and nil to an options object
1888
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1889
+
1890
+ # Customize the options with defaults
1891
+ metadata = @config.rpcs.delete_instance.metadata.to_h
1892
+
1893
+ # Set x-goog-api-client and x-goog-user-project headers
1894
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1895
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1896
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
1897
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1898
+
1899
+ header_params = {}
1900
+ if request.name
1901
+ header_params["name"] = request.name
1902
+ end
1903
+
1904
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1905
+ metadata[:"x-goog-request-params"] ||= request_params_header
1906
+
1907
+ options.apply_defaults timeout: @config.rpcs.delete_instance.timeout,
1908
+ metadata: metadata,
1909
+ retry_policy: @config.rpcs.delete_instance.retry_policy
1910
+
1911
+ options.apply_defaults timeout: @config.timeout,
1912
+ metadata: @config.metadata,
1913
+ retry_policy: @config.retry_policy
1914
+
1915
+ @alloy_db_admin_stub.call_rpc :delete_instance, request, options: options do |response, operation|
1916
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1917
+ yield response, operation if block_given?
1918
+ return response
1919
+ end
1920
+ rescue ::GRPC::BadStatus => e
1921
+ raise ::Google::Cloud::Error.from_error(e)
1922
+ end
1923
+
1924
+ ##
1925
+ # Forces a Failover for a highly available instance.
1926
+ # Failover promotes the HA standby instance as the new primary.
1927
+ # Imperative only.
1928
+ #
1929
+ # @overload failover_instance(request, options = nil)
1930
+ # Pass arguments to `failover_instance` via a request object, either of type
1931
+ # {::Google::Cloud::AlloyDB::V1alpha::FailoverInstanceRequest} or an equivalent Hash.
1932
+ #
1933
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::FailoverInstanceRequest, ::Hash]
1934
+ # A request object representing the call parameters. Required. To specify no
1935
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1936
+ # @param options [::Gapic::CallOptions, ::Hash]
1937
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1938
+ #
1939
+ # @overload failover_instance(name: nil, request_id: nil, validate_only: nil)
1940
+ # Pass arguments to `failover_instance` via keyword arguments. Note that at
1941
+ # least one keyword argument is required. To specify no parameters, or to keep all
1942
+ # the default parameter values, pass an empty Hash as a request object (see above).
1943
+ #
1944
+ # @param name [::String]
1945
+ # Required. The name of the resource. For the required format, see the
1946
+ # comment on the Instance.name field.
1947
+ # @param request_id [::String]
1948
+ # Optional. An optional request ID to identify requests. Specify a unique
1949
+ # request ID so that if you must retry your request, the server will know to
1950
+ # ignore the request if it has already been completed. The server will
1951
+ # guarantee that for at least 60 minutes after the first request.
1952
+ #
1953
+ # For example, consider a situation where you make an initial request and
1954
+ # the request times out. If you make the request again with the same request
1955
+ # ID, the server can check if original operation with the same request ID
1956
+ # was received, and if so, will ignore the second request. This prevents
1957
+ # clients from accidentally creating duplicate commitments.
1958
+ #
1959
+ # The request ID must be a valid UUID with the exception that zero UUID is
1960
+ # not supported (00000000-0000-0000-0000-000000000000).
1961
+ # @param validate_only [::Boolean]
1962
+ # Optional. If set, performs request validation (e.g. permission checks and
1963
+ # any other type of validation), but do not actually execute the failover.
1964
+ #
1965
+ # @yield [response, operation] Access the result along with the RPC operation
1966
+ # @yieldparam response [::Gapic::Operation]
1967
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1968
+ #
1969
+ # @return [::Gapic::Operation]
1970
+ #
1971
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1972
+ #
1973
+ # @example Basic example
1974
+ # require "google/cloud/alloy_db/v1alpha"
1975
+ #
1976
+ # # Create a client object. The client can be reused for multiple calls.
1977
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
1978
+ #
1979
+ # # Create a request. To set request fields, pass in keyword arguments.
1980
+ # request = Google::Cloud::AlloyDB::V1alpha::FailoverInstanceRequest.new
1981
+ #
1982
+ # # Call the failover_instance method.
1983
+ # result = client.failover_instance request
1984
+ #
1985
+ # # The returned object is of type Gapic::Operation. You can use it to
1986
+ # # check the status of an operation, cancel it, or wait for results.
1987
+ # # Here is how to wait for a response.
1988
+ # result.wait_until_done! timeout: 60
1989
+ # if result.response?
1990
+ # p result.response
1991
+ # else
1992
+ # puts "No response received."
1993
+ # end
1994
+ #
1995
+ def failover_instance request, options = nil
1996
+ raise ::ArgumentError, "request must be provided" if request.nil?
1997
+
1998
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::FailoverInstanceRequest
1999
+
2000
+ # Converts hash and nil to an options object
2001
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2002
+
2003
+ # Customize the options with defaults
2004
+ metadata = @config.rpcs.failover_instance.metadata.to_h
2005
+
2006
+ # Set x-goog-api-client and x-goog-user-project headers
2007
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2008
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2009
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
2010
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2011
+
2012
+ header_params = {}
2013
+ if request.name
2014
+ header_params["name"] = request.name
2015
+ end
2016
+
2017
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2018
+ metadata[:"x-goog-request-params"] ||= request_params_header
2019
+
2020
+ options.apply_defaults timeout: @config.rpcs.failover_instance.timeout,
2021
+ metadata: metadata,
2022
+ retry_policy: @config.rpcs.failover_instance.retry_policy
2023
+
2024
+ options.apply_defaults timeout: @config.timeout,
2025
+ metadata: @config.metadata,
2026
+ retry_policy: @config.retry_policy
2027
+
2028
+ @alloy_db_admin_stub.call_rpc :failover_instance, request, options: options do |response, operation|
2029
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2030
+ yield response, operation if block_given?
2031
+ return response
2032
+ end
2033
+ rescue ::GRPC::BadStatus => e
2034
+ raise ::Google::Cloud::Error.from_error(e)
2035
+ end
2036
+
2037
+ ##
2038
+ # Injects fault in an instance.
2039
+ # Imperative only.
2040
+ #
2041
+ # @overload inject_fault(request, options = nil)
2042
+ # Pass arguments to `inject_fault` via a request object, either of type
2043
+ # {::Google::Cloud::AlloyDB::V1alpha::InjectFaultRequest} or an equivalent Hash.
2044
+ #
2045
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::InjectFaultRequest, ::Hash]
2046
+ # A request object representing the call parameters. Required. To specify no
2047
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2048
+ # @param options [::Gapic::CallOptions, ::Hash]
2049
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2050
+ #
2051
+ # @overload inject_fault(fault_type: nil, name: nil, request_id: nil, validate_only: nil)
2052
+ # Pass arguments to `inject_fault` via keyword arguments. Note that at
2053
+ # least one keyword argument is required. To specify no parameters, or to keep all
2054
+ # the default parameter values, pass an empty Hash as a request object (see above).
2055
+ #
2056
+ # @param fault_type [::Google::Cloud::AlloyDB::V1alpha::InjectFaultRequest::FaultType]
2057
+ # Required. The type of fault to be injected in an instance.
2058
+ # @param name [::String]
2059
+ # Required. The name of the resource. For the required format, see the
2060
+ # comment on the Instance.name field.
2061
+ # @param request_id [::String]
2062
+ # Optional. An optional request ID to identify requests. Specify a unique
2063
+ # request ID so that if you must retry your request, the server will know to
2064
+ # ignore the request if it has already been completed. The server will
2065
+ # guarantee that for at least 60 minutes after the first request.
2066
+ #
2067
+ # For example, consider a situation where you make an initial request and
2068
+ # the request times out. If you make the request again with the same request
2069
+ # ID, the server can check if original operation with the same request ID
2070
+ # was received, and if so, will ignore the second request. This prevents
2071
+ # clients from accidentally creating duplicate commitments.
2072
+ #
2073
+ # The request ID must be a valid UUID with the exception that zero UUID is
2074
+ # not supported (00000000-0000-0000-0000-000000000000).
2075
+ # @param validate_only [::Boolean]
2076
+ # Optional. If set, performs request validation (e.g. permission checks and
2077
+ # any other type of validation), but do not actually execute the fault
2078
+ # injection.
2079
+ #
2080
+ # @yield [response, operation] Access the result along with the RPC operation
2081
+ # @yieldparam response [::Gapic::Operation]
2082
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2083
+ #
2084
+ # @return [::Gapic::Operation]
2085
+ #
2086
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2087
+ #
2088
+ # @example Basic example
2089
+ # require "google/cloud/alloy_db/v1alpha"
2090
+ #
2091
+ # # Create a client object. The client can be reused for multiple calls.
2092
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
2093
+ #
2094
+ # # Create a request. To set request fields, pass in keyword arguments.
2095
+ # request = Google::Cloud::AlloyDB::V1alpha::InjectFaultRequest.new
2096
+ #
2097
+ # # Call the inject_fault method.
2098
+ # result = client.inject_fault request
2099
+ #
2100
+ # # The returned object is of type Gapic::Operation. You can use it to
2101
+ # # check the status of an operation, cancel it, or wait for results.
2102
+ # # Here is how to wait for a response.
2103
+ # result.wait_until_done! timeout: 60
2104
+ # if result.response?
2105
+ # p result.response
2106
+ # else
2107
+ # puts "No response received."
2108
+ # end
2109
+ #
2110
+ def inject_fault request, options = nil
2111
+ raise ::ArgumentError, "request must be provided" if request.nil?
2112
+
2113
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::InjectFaultRequest
2114
+
2115
+ # Converts hash and nil to an options object
2116
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2117
+
2118
+ # Customize the options with defaults
2119
+ metadata = @config.rpcs.inject_fault.metadata.to_h
2120
+
2121
+ # Set x-goog-api-client and x-goog-user-project headers
2122
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2123
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2124
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
2125
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2126
+
2127
+ header_params = {}
2128
+ if request.name
2129
+ header_params["name"] = request.name
2130
+ end
2131
+
2132
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2133
+ metadata[:"x-goog-request-params"] ||= request_params_header
2134
+
2135
+ options.apply_defaults timeout: @config.rpcs.inject_fault.timeout,
2136
+ metadata: metadata,
2137
+ retry_policy: @config.rpcs.inject_fault.retry_policy
2138
+
2139
+ options.apply_defaults timeout: @config.timeout,
2140
+ metadata: @config.metadata,
2141
+ retry_policy: @config.retry_policy
2142
+
2143
+ @alloy_db_admin_stub.call_rpc :inject_fault, request, options: options do |response, operation|
2144
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2145
+ yield response, operation if block_given?
2146
+ return response
2147
+ end
2148
+ rescue ::GRPC::BadStatus => e
2149
+ raise ::Google::Cloud::Error.from_error(e)
2150
+ end
2151
+
2152
+ ##
2153
+ # Restart an Instance in a cluster.
2154
+ # Imperative only.
2155
+ #
2156
+ # @overload restart_instance(request, options = nil)
2157
+ # Pass arguments to `restart_instance` via a request object, either of type
2158
+ # {::Google::Cloud::AlloyDB::V1alpha::RestartInstanceRequest} or an equivalent Hash.
2159
+ #
2160
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::RestartInstanceRequest, ::Hash]
2161
+ # A request object representing the call parameters. Required. To specify no
2162
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2163
+ # @param options [::Gapic::CallOptions, ::Hash]
2164
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2165
+ #
2166
+ # @overload restart_instance(name: nil, request_id: nil, validate_only: nil)
2167
+ # Pass arguments to `restart_instance` via keyword arguments. Note that at
2168
+ # least one keyword argument is required. To specify no parameters, or to keep all
2169
+ # the default parameter values, pass an empty Hash as a request object (see above).
2170
+ #
2171
+ # @param name [::String]
2172
+ # Required. The name of the resource. For the required format, see the
2173
+ # comment on the Instance.name field.
2174
+ # @param request_id [::String]
2175
+ # Optional. An optional request ID to identify requests. Specify a unique
2176
+ # request ID so that if you must retry your request, the server will know to
2177
+ # ignore the request if it has already been completed. The server will
2178
+ # guarantee that for at least 60 minutes after the first request.
2179
+ #
2180
+ # For example, consider a situation where you make an initial request and
2181
+ # the request times out. If you make the request again with the same request
2182
+ # ID, the server can check if original operation with the same request ID
2183
+ # was received, and if so, will ignore the second request. This prevents
2184
+ # clients from accidentally creating duplicate commitments.
2185
+ #
2186
+ # The request ID must be a valid UUID with the exception that zero UUID is
2187
+ # not supported (00000000-0000-0000-0000-000000000000).
2188
+ # @param validate_only [::Boolean]
2189
+ # Optional. If set, performs request validation (e.g. permission checks and
2190
+ # any other type of validation), but do not actually execute the restart.
2191
+ #
2192
+ # @yield [response, operation] Access the result along with the RPC operation
2193
+ # @yieldparam response [::Gapic::Operation]
2194
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2195
+ #
2196
+ # @return [::Gapic::Operation]
2197
+ #
2198
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2199
+ #
2200
+ # @example Basic example
2201
+ # require "google/cloud/alloy_db/v1alpha"
2202
+ #
2203
+ # # Create a client object. The client can be reused for multiple calls.
2204
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
2205
+ #
2206
+ # # Create a request. To set request fields, pass in keyword arguments.
2207
+ # request = Google::Cloud::AlloyDB::V1alpha::RestartInstanceRequest.new
2208
+ #
2209
+ # # Call the restart_instance method.
2210
+ # result = client.restart_instance request
2211
+ #
2212
+ # # The returned object is of type Gapic::Operation. You can use it to
2213
+ # # check the status of an operation, cancel it, or wait for results.
2214
+ # # Here is how to wait for a response.
2215
+ # result.wait_until_done! timeout: 60
2216
+ # if result.response?
2217
+ # p result.response
2218
+ # else
2219
+ # puts "No response received."
2220
+ # end
2221
+ #
2222
+ def restart_instance request, options = nil
2223
+ raise ::ArgumentError, "request must be provided" if request.nil?
2224
+
2225
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::RestartInstanceRequest
2226
+
2227
+ # Converts hash and nil to an options object
2228
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2229
+
2230
+ # Customize the options with defaults
2231
+ metadata = @config.rpcs.restart_instance.metadata.to_h
2232
+
2233
+ # Set x-goog-api-client and x-goog-user-project headers
2234
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2235
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2236
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
2237
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2238
+
2239
+ header_params = {}
2240
+ if request.name
2241
+ header_params["name"] = request.name
2242
+ end
2243
+
2244
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2245
+ metadata[:"x-goog-request-params"] ||= request_params_header
2246
+
2247
+ options.apply_defaults timeout: @config.rpcs.restart_instance.timeout,
2248
+ metadata: metadata,
2249
+ retry_policy: @config.rpcs.restart_instance.retry_policy
2250
+
2251
+ options.apply_defaults timeout: @config.timeout,
2252
+ metadata: @config.metadata,
2253
+ retry_policy: @config.retry_policy
2254
+
2255
+ @alloy_db_admin_stub.call_rpc :restart_instance, request, options: options do |response, operation|
2256
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2257
+ yield response, operation if block_given?
2258
+ return response
2259
+ end
2260
+ rescue ::GRPC::BadStatus => e
2261
+ raise ::Google::Cloud::Error.from_error(e)
2262
+ end
2263
+
2264
+ ##
2265
+ # Lists Backups in a given project and location.
2266
+ #
2267
+ # @overload list_backups(request, options = nil)
2268
+ # Pass arguments to `list_backups` via a request object, either of type
2269
+ # {::Google::Cloud::AlloyDB::V1alpha::ListBackupsRequest} or an equivalent Hash.
2270
+ #
2271
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::ListBackupsRequest, ::Hash]
2272
+ # A request object representing the call parameters. Required. To specify no
2273
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2274
+ # @param options [::Gapic::CallOptions, ::Hash]
2275
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2276
+ #
2277
+ # @overload list_backups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
2278
+ # Pass arguments to `list_backups` via keyword arguments. Note that at
2279
+ # least one keyword argument is required. To specify no parameters, or to keep all
2280
+ # the default parameter values, pass an empty Hash as a request object (see above).
2281
+ #
2282
+ # @param parent [::String]
2283
+ # Required. Parent value for ListBackupsRequest
2284
+ # @param page_size [::Integer]
2285
+ # Requested page size. Server may return fewer items than requested.
2286
+ # If unspecified, server will pick an appropriate default.
2287
+ # @param page_token [::String]
2288
+ # A token identifying a page of results the server should return.
2289
+ # @param filter [::String]
2290
+ # Filtering results
2291
+ # @param order_by [::String]
2292
+ # Hint for how to order the results
2293
+ #
2294
+ # @yield [response, operation] Access the result along with the RPC operation
2295
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1alpha::Backup>]
2296
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2297
+ #
2298
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1alpha::Backup>]
2299
+ #
2300
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2301
+ #
2302
+ # @example Basic example
2303
+ # require "google/cloud/alloy_db/v1alpha"
2304
+ #
2305
+ # # Create a client object. The client can be reused for multiple calls.
2306
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
2307
+ #
2308
+ # # Create a request. To set request fields, pass in keyword arguments.
2309
+ # request = Google::Cloud::AlloyDB::V1alpha::ListBackupsRequest.new
2310
+ #
2311
+ # # Call the list_backups method.
2312
+ # result = client.list_backups request
2313
+ #
2314
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2315
+ # # over elements, and API calls will be issued to fetch pages as needed.
2316
+ # result.each do |item|
2317
+ # # Each element is of type ::Google::Cloud::AlloyDB::V1alpha::Backup.
2318
+ # p item
2319
+ # end
2320
+ #
2321
+ def list_backups request, options = nil
2322
+ raise ::ArgumentError, "request must be provided" if request.nil?
2323
+
2324
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::ListBackupsRequest
2325
+
2326
+ # Converts hash and nil to an options object
2327
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2328
+
2329
+ # Customize the options with defaults
2330
+ metadata = @config.rpcs.list_backups.metadata.to_h
2331
+
2332
+ # Set x-goog-api-client and x-goog-user-project headers
2333
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2334
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2335
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
2336
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2337
+
2338
+ header_params = {}
2339
+ if request.parent
2340
+ header_params["parent"] = request.parent
2341
+ end
2342
+
2343
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2344
+ metadata[:"x-goog-request-params"] ||= request_params_header
2345
+
2346
+ options.apply_defaults timeout: @config.rpcs.list_backups.timeout,
2347
+ metadata: metadata,
2348
+ retry_policy: @config.rpcs.list_backups.retry_policy
2349
+
2350
+ options.apply_defaults timeout: @config.timeout,
2351
+ metadata: @config.metadata,
2352
+ retry_policy: @config.retry_policy
2353
+
2354
+ @alloy_db_admin_stub.call_rpc :list_backups, request, options: options do |response, operation|
2355
+ response = ::Gapic::PagedEnumerable.new @alloy_db_admin_stub, :list_backups, request, response, operation, options
2356
+ yield response, operation if block_given?
2357
+ return response
2358
+ end
2359
+ rescue ::GRPC::BadStatus => e
2360
+ raise ::Google::Cloud::Error.from_error(e)
2361
+ end
2362
+
2363
+ ##
2364
+ # Gets details of a single Backup.
2365
+ #
2366
+ # @overload get_backup(request, options = nil)
2367
+ # Pass arguments to `get_backup` via a request object, either of type
2368
+ # {::Google::Cloud::AlloyDB::V1alpha::GetBackupRequest} or an equivalent Hash.
2369
+ #
2370
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::GetBackupRequest, ::Hash]
2371
+ # A request object representing the call parameters. Required. To specify no
2372
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2373
+ # @param options [::Gapic::CallOptions, ::Hash]
2374
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2375
+ #
2376
+ # @overload get_backup(name: nil)
2377
+ # Pass arguments to `get_backup` via keyword arguments. Note that at
2378
+ # least one keyword argument is required. To specify no parameters, or to keep all
2379
+ # the default parameter values, pass an empty Hash as a request object (see above).
2380
+ #
2381
+ # @param name [::String]
2382
+ # Required. Name of the resource
2383
+ #
2384
+ # @yield [response, operation] Access the result along with the RPC operation
2385
+ # @yieldparam response [::Google::Cloud::AlloyDB::V1alpha::Backup]
2386
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2387
+ #
2388
+ # @return [::Google::Cloud::AlloyDB::V1alpha::Backup]
2389
+ #
2390
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2391
+ #
2392
+ # @example Basic example
2393
+ # require "google/cloud/alloy_db/v1alpha"
2394
+ #
2395
+ # # Create a client object. The client can be reused for multiple calls.
2396
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
2397
+ #
2398
+ # # Create a request. To set request fields, pass in keyword arguments.
2399
+ # request = Google::Cloud::AlloyDB::V1alpha::GetBackupRequest.new
2400
+ #
2401
+ # # Call the get_backup method.
2402
+ # result = client.get_backup request
2403
+ #
2404
+ # # The returned object is of type Google::Cloud::AlloyDB::V1alpha::Backup.
2405
+ # p result
2406
+ #
2407
+ def get_backup request, options = nil
2408
+ raise ::ArgumentError, "request must be provided" if request.nil?
2409
+
2410
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::GetBackupRequest
2411
+
2412
+ # Converts hash and nil to an options object
2413
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2414
+
2415
+ # Customize the options with defaults
2416
+ metadata = @config.rpcs.get_backup.metadata.to_h
2417
+
2418
+ # Set x-goog-api-client and x-goog-user-project headers
2419
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2420
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2421
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
2422
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2423
+
2424
+ header_params = {}
2425
+ if request.name
2426
+ header_params["name"] = request.name
2427
+ end
2428
+
2429
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2430
+ metadata[:"x-goog-request-params"] ||= request_params_header
2431
+
2432
+ options.apply_defaults timeout: @config.rpcs.get_backup.timeout,
2433
+ metadata: metadata,
2434
+ retry_policy: @config.rpcs.get_backup.retry_policy
2435
+
2436
+ options.apply_defaults timeout: @config.timeout,
2437
+ metadata: @config.metadata,
2438
+ retry_policy: @config.retry_policy
2439
+
2440
+ @alloy_db_admin_stub.call_rpc :get_backup, request, options: options do |response, operation|
2441
+ yield response, operation if block_given?
2442
+ return response
2443
+ end
2444
+ rescue ::GRPC::BadStatus => e
2445
+ raise ::Google::Cloud::Error.from_error(e)
2446
+ end
2447
+
2448
+ ##
2449
+ # Creates a new Backup in a given project and location.
2450
+ #
2451
+ # @overload create_backup(request, options = nil)
2452
+ # Pass arguments to `create_backup` via a request object, either of type
2453
+ # {::Google::Cloud::AlloyDB::V1alpha::CreateBackupRequest} or an equivalent Hash.
2454
+ #
2455
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::CreateBackupRequest, ::Hash]
2456
+ # A request object representing the call parameters. Required. To specify no
2457
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2458
+ # @param options [::Gapic::CallOptions, ::Hash]
2459
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2460
+ #
2461
+ # @overload create_backup(parent: nil, backup_id: nil, backup: nil, request_id: nil, validate_only: nil)
2462
+ # Pass arguments to `create_backup` via keyword arguments. Note that at
2463
+ # least one keyword argument is required. To specify no parameters, or to keep all
2464
+ # the default parameter values, pass an empty Hash as a request object (see above).
2465
+ #
2466
+ # @param parent [::String]
2467
+ # Required. Value for parent.
2468
+ # @param backup_id [::String]
2469
+ # Required. ID of the requesting object.
2470
+ # @param backup [::Google::Cloud::AlloyDB::V1alpha::Backup, ::Hash]
2471
+ # Required. The resource being created
2472
+ # @param request_id [::String]
2473
+ # Optional. An optional request ID to identify requests. Specify a unique
2474
+ # request ID so that if you must retry your request, the server will know to
2475
+ # ignore the request if it has already been completed. The server will
2476
+ # guarantee that for at least 60 minutes since the first request.
2477
+ #
2478
+ # For example, consider a situation where you make an initial request and
2479
+ # the request times out. If you make the request again with the same request
2480
+ # ID, the server can check if original operation with the same request ID
2481
+ # was received, and if so, will ignore the second request. This prevents
2482
+ # clients from accidentally creating duplicate commitments.
2483
+ #
2484
+ # The request ID must be a valid UUID with the exception that zero UUID is
2485
+ # not supported (00000000-0000-0000-0000-000000000000).
2486
+ # @param validate_only [::Boolean]
2487
+ # Optional. If set, the backend validates the request, but doesn't actually
2488
+ # execute it.
2489
+ #
2490
+ # @yield [response, operation] Access the result along with the RPC operation
2491
+ # @yieldparam response [::Gapic::Operation]
2492
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2493
+ #
2494
+ # @return [::Gapic::Operation]
2495
+ #
2496
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2497
+ #
2498
+ # @example Basic example
2499
+ # require "google/cloud/alloy_db/v1alpha"
2500
+ #
2501
+ # # Create a client object. The client can be reused for multiple calls.
2502
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
2503
+ #
2504
+ # # Create a request. To set request fields, pass in keyword arguments.
2505
+ # request = Google::Cloud::AlloyDB::V1alpha::CreateBackupRequest.new
2506
+ #
2507
+ # # Call the create_backup method.
2508
+ # result = client.create_backup request
2509
+ #
2510
+ # # The returned object is of type Gapic::Operation. You can use it to
2511
+ # # check the status of an operation, cancel it, or wait for results.
2512
+ # # Here is how to wait for a response.
2513
+ # result.wait_until_done! timeout: 60
2514
+ # if result.response?
2515
+ # p result.response
2516
+ # else
2517
+ # puts "No response received."
2518
+ # end
2519
+ #
2520
+ def create_backup request, options = nil
2521
+ raise ::ArgumentError, "request must be provided" if request.nil?
2522
+
2523
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::CreateBackupRequest
2524
+
2525
+ # Converts hash and nil to an options object
2526
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2527
+
2528
+ # Customize the options with defaults
2529
+ metadata = @config.rpcs.create_backup.metadata.to_h
2530
+
2531
+ # Set x-goog-api-client and x-goog-user-project headers
2532
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2533
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2534
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
2535
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2536
+
2537
+ header_params = {}
2538
+ if request.parent
2539
+ header_params["parent"] = request.parent
2540
+ end
2541
+
2542
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2543
+ metadata[:"x-goog-request-params"] ||= request_params_header
2544
+
2545
+ options.apply_defaults timeout: @config.rpcs.create_backup.timeout,
2546
+ metadata: metadata,
2547
+ retry_policy: @config.rpcs.create_backup.retry_policy
2548
+
2549
+ options.apply_defaults timeout: @config.timeout,
2550
+ metadata: @config.metadata,
2551
+ retry_policy: @config.retry_policy
2552
+
2553
+ @alloy_db_admin_stub.call_rpc :create_backup, request, options: options do |response, operation|
2554
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2555
+ yield response, operation if block_given?
2556
+ return response
2557
+ end
2558
+ rescue ::GRPC::BadStatus => e
2559
+ raise ::Google::Cloud::Error.from_error(e)
2560
+ end
2561
+
2562
+ ##
2563
+ # Updates the parameters of a single Backup.
2564
+ #
2565
+ # @overload update_backup(request, options = nil)
2566
+ # Pass arguments to `update_backup` via a request object, either of type
2567
+ # {::Google::Cloud::AlloyDB::V1alpha::UpdateBackupRequest} or an equivalent Hash.
2568
+ #
2569
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::UpdateBackupRequest, ::Hash]
2570
+ # A request object representing the call parameters. Required. To specify no
2571
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2572
+ # @param options [::Gapic::CallOptions, ::Hash]
2573
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2574
+ #
2575
+ # @overload update_backup(update_mask: nil, backup: nil, request_id: nil, validate_only: nil, allow_missing: nil)
2576
+ # Pass arguments to `update_backup` via keyword arguments. Note that at
2577
+ # least one keyword argument is required. To specify no parameters, or to keep all
2578
+ # the default parameter values, pass an empty Hash as a request object (see above).
2579
+ #
2580
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2581
+ # Optional. Field mask is used to specify the fields to be overwritten in the
2582
+ # Backup resource by the update.
2583
+ # The fields specified in the update_mask are relative to the resource, not
2584
+ # the full request. A field will be overwritten if it is in the mask. If the
2585
+ # user does not provide a mask then all fields will be overwritten.
2586
+ # @param backup [::Google::Cloud::AlloyDB::V1alpha::Backup, ::Hash]
2587
+ # Required. The resource being updated
2588
+ # @param request_id [::String]
2589
+ # Optional. An optional request ID to identify requests. Specify a unique
2590
+ # request ID so that if you must retry your request, the server will know to
2591
+ # ignore the request if it has already been completed. The server will
2592
+ # guarantee that for at least 60 minutes since the first request.
2593
+ #
2594
+ # For example, consider a situation where you make an initial request and
2595
+ # the request times out. If you make the request again with the same request
2596
+ # ID, the server can check if original operation with the same request ID
2597
+ # was received, and if so, will ignore the second request. This prevents
2598
+ # clients from accidentally creating duplicate commitments.
2599
+ #
2600
+ # The request ID must be a valid UUID with the exception that zero UUID is
2601
+ # not supported (00000000-0000-0000-0000-000000000000).
2602
+ # @param validate_only [::Boolean]
2603
+ # Optional. If set, the backend validates the request, but doesn't actually
2604
+ # execute it.
2605
+ # @param allow_missing [::Boolean]
2606
+ # Optional. If set to true, update succeeds even if instance is not found. In
2607
+ # that case, a new backup is created and `update_mask` is ignored.
2608
+ #
2609
+ # @yield [response, operation] Access the result along with the RPC operation
2610
+ # @yieldparam response [::Gapic::Operation]
2611
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2612
+ #
2613
+ # @return [::Gapic::Operation]
2614
+ #
2615
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2616
+ #
2617
+ # @example Basic example
2618
+ # require "google/cloud/alloy_db/v1alpha"
2619
+ #
2620
+ # # Create a client object. The client can be reused for multiple calls.
2621
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
2622
+ #
2623
+ # # Create a request. To set request fields, pass in keyword arguments.
2624
+ # request = Google::Cloud::AlloyDB::V1alpha::UpdateBackupRequest.new
2625
+ #
2626
+ # # Call the update_backup method.
2627
+ # result = client.update_backup request
2628
+ #
2629
+ # # The returned object is of type Gapic::Operation. You can use it to
2630
+ # # check the status of an operation, cancel it, or wait for results.
2631
+ # # Here is how to wait for a response.
2632
+ # result.wait_until_done! timeout: 60
2633
+ # if result.response?
2634
+ # p result.response
2635
+ # else
2636
+ # puts "No response received."
2637
+ # end
2638
+ #
2639
+ def update_backup request, options = nil
2640
+ raise ::ArgumentError, "request must be provided" if request.nil?
2641
+
2642
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::UpdateBackupRequest
2643
+
2644
+ # Converts hash and nil to an options object
2645
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2646
+
2647
+ # Customize the options with defaults
2648
+ metadata = @config.rpcs.update_backup.metadata.to_h
2649
+
2650
+ # Set x-goog-api-client and x-goog-user-project headers
2651
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2652
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2653
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
2654
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2655
+
2656
+ header_params = {}
2657
+ if request.backup&.name
2658
+ header_params["backup.name"] = request.backup.name
2659
+ end
2660
+
2661
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2662
+ metadata[:"x-goog-request-params"] ||= request_params_header
2663
+
2664
+ options.apply_defaults timeout: @config.rpcs.update_backup.timeout,
2665
+ metadata: metadata,
2666
+ retry_policy: @config.rpcs.update_backup.retry_policy
2667
+
2668
+ options.apply_defaults timeout: @config.timeout,
2669
+ metadata: @config.metadata,
2670
+ retry_policy: @config.retry_policy
2671
+
2672
+ @alloy_db_admin_stub.call_rpc :update_backup, request, options: options do |response, operation|
2673
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2674
+ yield response, operation if block_given?
2675
+ return response
2676
+ end
2677
+ rescue ::GRPC::BadStatus => e
2678
+ raise ::Google::Cloud::Error.from_error(e)
2679
+ end
2680
+
2681
+ ##
2682
+ # Deletes a single Backup.
2683
+ #
2684
+ # @overload delete_backup(request, options = nil)
2685
+ # Pass arguments to `delete_backup` via a request object, either of type
2686
+ # {::Google::Cloud::AlloyDB::V1alpha::DeleteBackupRequest} or an equivalent Hash.
2687
+ #
2688
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::DeleteBackupRequest, ::Hash]
2689
+ # A request object representing the call parameters. Required. To specify no
2690
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2691
+ # @param options [::Gapic::CallOptions, ::Hash]
2692
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2693
+ #
2694
+ # @overload delete_backup(name: nil, request_id: nil, validate_only: nil, etag: nil)
2695
+ # Pass arguments to `delete_backup` via keyword arguments. Note that at
2696
+ # least one keyword argument is required. To specify no parameters, or to keep all
2697
+ # the default parameter values, pass an empty Hash as a request object (see above).
2698
+ #
2699
+ # @param name [::String]
2700
+ # Required. Name of the resource. For the required format, see the comment on
2701
+ # the Backup.name field.
2702
+ # @param request_id [::String]
2703
+ # Optional. An optional request ID to identify requests. Specify a unique
2704
+ # request ID so that if you must retry your request, the server will know to
2705
+ # ignore the request if it has already been completed. The server will
2706
+ # guarantee that for at least 60 minutes after the first request.
2707
+ #
2708
+ # For example, consider a situation where you make an initial request and
2709
+ # the request times out. If you make the request again with the same request
2710
+ # ID, the server can check if original operation with the same request ID
2711
+ # was received, and if so, will ignore the second request. This prevents
2712
+ # clients from accidentally creating duplicate commitments.
2713
+ #
2714
+ # The request ID must be a valid UUID with the exception that zero UUID is
2715
+ # not supported (00000000-0000-0000-0000-000000000000).
2716
+ # @param validate_only [::Boolean]
2717
+ # Optional. If set, the backend validates the request, but doesn't actually
2718
+ # execute it.
2719
+ # @param etag [::String]
2720
+ # Optional. The current etag of the Backup.
2721
+ # If an etag is provided and does not match the current etag of the Backup,
2722
+ # deletion will be blocked and an ABORTED error will be returned.
2723
+ #
2724
+ # @yield [response, operation] Access the result along with the RPC operation
2725
+ # @yieldparam response [::Gapic::Operation]
2726
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2727
+ #
2728
+ # @return [::Gapic::Operation]
2729
+ #
2730
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2731
+ #
2732
+ # @example Basic example
2733
+ # require "google/cloud/alloy_db/v1alpha"
2734
+ #
2735
+ # # Create a client object. The client can be reused for multiple calls.
2736
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
2737
+ #
2738
+ # # Create a request. To set request fields, pass in keyword arguments.
2739
+ # request = Google::Cloud::AlloyDB::V1alpha::DeleteBackupRequest.new
2740
+ #
2741
+ # # Call the delete_backup method.
2742
+ # result = client.delete_backup request
2743
+ #
2744
+ # # The returned object is of type Gapic::Operation. You can use it to
2745
+ # # check the status of an operation, cancel it, or wait for results.
2746
+ # # Here is how to wait for a response.
2747
+ # result.wait_until_done! timeout: 60
2748
+ # if result.response?
2749
+ # p result.response
2750
+ # else
2751
+ # puts "No response received."
2752
+ # end
2753
+ #
2754
+ def delete_backup request, options = nil
2755
+ raise ::ArgumentError, "request must be provided" if request.nil?
2756
+
2757
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::DeleteBackupRequest
2758
+
2759
+ # Converts hash and nil to an options object
2760
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2761
+
2762
+ # Customize the options with defaults
2763
+ metadata = @config.rpcs.delete_backup.metadata.to_h
2764
+
2765
+ # Set x-goog-api-client and x-goog-user-project headers
2766
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2767
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2768
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
2769
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2770
+
2771
+ header_params = {}
2772
+ if request.name
2773
+ header_params["name"] = request.name
2774
+ end
2775
+
2776
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2777
+ metadata[:"x-goog-request-params"] ||= request_params_header
2778
+
2779
+ options.apply_defaults timeout: @config.rpcs.delete_backup.timeout,
2780
+ metadata: metadata,
2781
+ retry_policy: @config.rpcs.delete_backup.retry_policy
2782
+
2783
+ options.apply_defaults timeout: @config.timeout,
2784
+ metadata: @config.metadata,
2785
+ retry_policy: @config.retry_policy
2786
+
2787
+ @alloy_db_admin_stub.call_rpc :delete_backup, request, options: options do |response, operation|
2788
+ response = ::Gapic::Operation.new response, @operations_client, options: options
2789
+ yield response, operation if block_given?
2790
+ return response
2791
+ end
2792
+ rescue ::GRPC::BadStatus => e
2793
+ raise ::Google::Cloud::Error.from_error(e)
2794
+ end
2795
+
2796
+ ##
2797
+ # Lists SupportedDatabaseFlags for a given project and location.
2798
+ #
2799
+ # @overload list_supported_database_flags(request, options = nil)
2800
+ # Pass arguments to `list_supported_database_flags` via a request object, either of type
2801
+ # {::Google::Cloud::AlloyDB::V1alpha::ListSupportedDatabaseFlagsRequest} or an equivalent Hash.
2802
+ #
2803
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::ListSupportedDatabaseFlagsRequest, ::Hash]
2804
+ # A request object representing the call parameters. Required. To specify no
2805
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2806
+ # @param options [::Gapic::CallOptions, ::Hash]
2807
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2808
+ #
2809
+ # @overload list_supported_database_flags(parent: nil, page_size: nil, page_token: nil)
2810
+ # Pass arguments to `list_supported_database_flags` via keyword arguments. Note that at
2811
+ # least one keyword argument is required. To specify no parameters, or to keep all
2812
+ # the default parameter values, pass an empty Hash as a request object (see above).
2813
+ #
2814
+ # @param parent [::String]
2815
+ # Required. The name of the parent resource. The required format is:
2816
+ # * projects/\\{project}/locations/\\{location}
2817
+ #
2818
+ # Regardless of the parent specified here, as long it is contains a valid
2819
+ # project and location, the service will return a static list of supported
2820
+ # flags resources. Note that we do not yet support region-specific
2821
+ # flags.
2822
+ # @param page_size [::Integer]
2823
+ # Requested page size. Server may return fewer items than requested.
2824
+ # If unspecified, server will pick an appropriate default.
2825
+ # @param page_token [::String]
2826
+ # A token identifying a page of results the server should return.
2827
+ #
2828
+ # @yield [response, operation] Access the result along with the RPC operation
2829
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1alpha::SupportedDatabaseFlag>]
2830
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2831
+ #
2832
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1alpha::SupportedDatabaseFlag>]
2833
+ #
2834
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2835
+ #
2836
+ # @example Basic example
2837
+ # require "google/cloud/alloy_db/v1alpha"
2838
+ #
2839
+ # # Create a client object. The client can be reused for multiple calls.
2840
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
2841
+ #
2842
+ # # Create a request. To set request fields, pass in keyword arguments.
2843
+ # request = Google::Cloud::AlloyDB::V1alpha::ListSupportedDatabaseFlagsRequest.new
2844
+ #
2845
+ # # Call the list_supported_database_flags method.
2846
+ # result = client.list_supported_database_flags request
2847
+ #
2848
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
2849
+ # # over elements, and API calls will be issued to fetch pages as needed.
2850
+ # result.each do |item|
2851
+ # # Each element is of type ::Google::Cloud::AlloyDB::V1alpha::SupportedDatabaseFlag.
2852
+ # p item
2853
+ # end
2854
+ #
2855
+ def list_supported_database_flags request, options = nil
2856
+ raise ::ArgumentError, "request must be provided" if request.nil?
2857
+
2858
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::ListSupportedDatabaseFlagsRequest
2859
+
2860
+ # Converts hash and nil to an options object
2861
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2862
+
2863
+ # Customize the options with defaults
2864
+ metadata = @config.rpcs.list_supported_database_flags.metadata.to_h
2865
+
2866
+ # Set x-goog-api-client and x-goog-user-project headers
2867
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2868
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2869
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
2870
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2871
+
2872
+ header_params = {}
2873
+ if request.parent
2874
+ header_params["parent"] = request.parent
2875
+ end
2876
+
2877
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2878
+ metadata[:"x-goog-request-params"] ||= request_params_header
2879
+
2880
+ options.apply_defaults timeout: @config.rpcs.list_supported_database_flags.timeout,
2881
+ metadata: metadata,
2882
+ retry_policy: @config.rpcs.list_supported_database_flags.retry_policy
2883
+
2884
+ options.apply_defaults timeout: @config.timeout,
2885
+ metadata: @config.metadata,
2886
+ retry_policy: @config.retry_policy
2887
+
2888
+ @alloy_db_admin_stub.call_rpc :list_supported_database_flags, request, options: options do |response, operation|
2889
+ response = ::Gapic::PagedEnumerable.new @alloy_db_admin_stub, :list_supported_database_flags, request, response, operation, options
2890
+ yield response, operation if block_given?
2891
+ return response
2892
+ end
2893
+ rescue ::GRPC::BadStatus => e
2894
+ raise ::Google::Cloud::Error.from_error(e)
2895
+ end
2896
+
2897
+ ##
2898
+ # Generate a client certificate signed by a Cluster CA.
2899
+ # The sole purpose of this endpoint is to support AlloyDB connectors and the
2900
+ # Auth Proxy client. The endpoint's behavior is subject to change without
2901
+ # notice, so do not rely on its behavior remaining constant. Future changes
2902
+ # will not break AlloyDB connectors or the Auth Proxy client.
2903
+ #
2904
+ # @overload generate_client_certificate(request, options = nil)
2905
+ # Pass arguments to `generate_client_certificate` via a request object, either of type
2906
+ # {::Google::Cloud::AlloyDB::V1alpha::GenerateClientCertificateRequest} or an equivalent Hash.
2907
+ #
2908
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::GenerateClientCertificateRequest, ::Hash]
2909
+ # A request object representing the call parameters. Required. To specify no
2910
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2911
+ # @param options [::Gapic::CallOptions, ::Hash]
2912
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2913
+ #
2914
+ # @overload generate_client_certificate(parent: nil, request_id: nil, pem_csr: nil, cert_duration: nil, public_key: nil, use_metadata_exchange: nil)
2915
+ # Pass arguments to `generate_client_certificate` via keyword arguments. Note that at
2916
+ # least one keyword argument is required. To specify no parameters, or to keep all
2917
+ # the default parameter values, pass an empty Hash as a request object (see above).
2918
+ #
2919
+ # @param parent [::String]
2920
+ # Required. The name of the parent resource. The required format is:
2921
+ # * projects/\\{project}/locations/\\{location}/clusters/\\{cluster}
2922
+ # @param request_id [::String]
2923
+ # Optional. An optional request ID to identify requests. Specify a unique
2924
+ # request ID so that if you must retry your request, the server will know to
2925
+ # ignore the request if it has already been completed. The server will
2926
+ # guarantee that for at least 60 minutes after the first request.
2927
+ #
2928
+ # For example, consider a situation where you make an initial request and
2929
+ # the request times out. If you make the request again with the same request
2930
+ # ID, the server can check if original operation with the same request ID
2931
+ # was received, and if so, will ignore the second request. This prevents
2932
+ # clients from accidentally creating duplicate commitments.
2933
+ #
2934
+ # The request ID must be a valid UUID with the exception that zero UUID is
2935
+ # not supported (00000000-0000-0000-0000-000000000000).
2936
+ # @param pem_csr [::String]
2937
+ # Optional. A pem-encoded X.509 certificate signing request (CSR).
2938
+ # @param cert_duration [::Google::Protobuf::Duration, ::Hash]
2939
+ # Optional. An optional hint to the endpoint to generate the client
2940
+ # certificate with the requested duration. The duration can be from 1 hour to
2941
+ # 24 hours. The endpoint may or may not honor the hint. If the hint is left
2942
+ # unspecified or is not honored, then the endpoint will pick an appropriate
2943
+ # default duration.
2944
+ # @param public_key [::String]
2945
+ # Optional. The public key from the client.
2946
+ # @param use_metadata_exchange [::Boolean]
2947
+ # Optional. An optional hint to the endpoint to generate a client
2948
+ # ceritificate that can be used by AlloyDB connectors to exchange additional
2949
+ # metadata with the server after TLS handshake.
2950
+ #
2951
+ # @yield [response, operation] Access the result along with the RPC operation
2952
+ # @yieldparam response [::Google::Cloud::AlloyDB::V1alpha::GenerateClientCertificateResponse]
2953
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2954
+ #
2955
+ # @return [::Google::Cloud::AlloyDB::V1alpha::GenerateClientCertificateResponse]
2956
+ #
2957
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2958
+ #
2959
+ # @example Basic example
2960
+ # require "google/cloud/alloy_db/v1alpha"
2961
+ #
2962
+ # # Create a client object. The client can be reused for multiple calls.
2963
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
2964
+ #
2965
+ # # Create a request. To set request fields, pass in keyword arguments.
2966
+ # request = Google::Cloud::AlloyDB::V1alpha::GenerateClientCertificateRequest.new
2967
+ #
2968
+ # # Call the generate_client_certificate method.
2969
+ # result = client.generate_client_certificate request
2970
+ #
2971
+ # # The returned object is of type Google::Cloud::AlloyDB::V1alpha::GenerateClientCertificateResponse.
2972
+ # p result
2973
+ #
2974
+ def generate_client_certificate request, options = nil
2975
+ raise ::ArgumentError, "request must be provided" if request.nil?
2976
+
2977
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::GenerateClientCertificateRequest
2978
+
2979
+ # Converts hash and nil to an options object
2980
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2981
+
2982
+ # Customize the options with defaults
2983
+ metadata = @config.rpcs.generate_client_certificate.metadata.to_h
2984
+
2985
+ # Set x-goog-api-client and x-goog-user-project headers
2986
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2987
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2988
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
2989
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2990
+
2991
+ header_params = {}
2992
+ if request.parent
2993
+ header_params["parent"] = request.parent
2994
+ end
2995
+
2996
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2997
+ metadata[:"x-goog-request-params"] ||= request_params_header
2998
+
2999
+ options.apply_defaults timeout: @config.rpcs.generate_client_certificate.timeout,
3000
+ metadata: metadata,
3001
+ retry_policy: @config.rpcs.generate_client_certificate.retry_policy
3002
+
3003
+ options.apply_defaults timeout: @config.timeout,
3004
+ metadata: @config.metadata,
3005
+ retry_policy: @config.retry_policy
3006
+
3007
+ @alloy_db_admin_stub.call_rpc :generate_client_certificate, request, options: options do |response, operation|
3008
+ yield response, operation if block_given?
3009
+ return response
3010
+ end
3011
+ rescue ::GRPC::BadStatus => e
3012
+ raise ::Google::Cloud::Error.from_error(e)
3013
+ end
3014
+
3015
+ ##
3016
+ # Get instance metadata used for a connection.
3017
+ #
3018
+ # @overload get_connection_info(request, options = nil)
3019
+ # Pass arguments to `get_connection_info` via a request object, either of type
3020
+ # {::Google::Cloud::AlloyDB::V1alpha::GetConnectionInfoRequest} or an equivalent Hash.
3021
+ #
3022
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::GetConnectionInfoRequest, ::Hash]
3023
+ # A request object representing the call parameters. Required. To specify no
3024
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3025
+ # @param options [::Gapic::CallOptions, ::Hash]
3026
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3027
+ #
3028
+ # @overload get_connection_info(parent: nil, request_id: nil)
3029
+ # Pass arguments to `get_connection_info` via keyword arguments. Note that at
3030
+ # least one keyword argument is required. To specify no parameters, or to keep all
3031
+ # the default parameter values, pass an empty Hash as a request object (see above).
3032
+ #
3033
+ # @param parent [::String]
3034
+ # Required. The name of the parent resource. The required format is:
3035
+ # projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/instances/\\{instance}
3036
+ # @param request_id [::String]
3037
+ # Optional. An optional request ID to identify requests. Specify a unique
3038
+ # request ID so that if you must retry your request, the server will know to
3039
+ # ignore the request if it has already been completed. The server will
3040
+ # guarantee that for at least 60 minutes after the first request.
3041
+ #
3042
+ # For example, consider a situation where you make an initial request and
3043
+ # the request times out. If you make the request again with the same request
3044
+ # ID, the server can check if original operation with the same request ID
3045
+ # was received, and if so, will ignore the second request. This prevents
3046
+ # clients from accidentally creating duplicate commitments.
3047
+ #
3048
+ # The request ID must be a valid UUID with the exception that zero UUID is
3049
+ # not supported (00000000-0000-0000-0000-000000000000).
3050
+ #
3051
+ # @yield [response, operation] Access the result along with the RPC operation
3052
+ # @yieldparam response [::Google::Cloud::AlloyDB::V1alpha::ConnectionInfo]
3053
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3054
+ #
3055
+ # @return [::Google::Cloud::AlloyDB::V1alpha::ConnectionInfo]
3056
+ #
3057
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3058
+ #
3059
+ # @example Basic example
3060
+ # require "google/cloud/alloy_db/v1alpha"
3061
+ #
3062
+ # # Create a client object. The client can be reused for multiple calls.
3063
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
3064
+ #
3065
+ # # Create a request. To set request fields, pass in keyword arguments.
3066
+ # request = Google::Cloud::AlloyDB::V1alpha::GetConnectionInfoRequest.new
3067
+ #
3068
+ # # Call the get_connection_info method.
3069
+ # result = client.get_connection_info request
3070
+ #
3071
+ # # The returned object is of type Google::Cloud::AlloyDB::V1alpha::ConnectionInfo.
3072
+ # p result
3073
+ #
3074
+ def get_connection_info request, options = nil
3075
+ raise ::ArgumentError, "request must be provided" if request.nil?
3076
+
3077
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::GetConnectionInfoRequest
3078
+
3079
+ # Converts hash and nil to an options object
3080
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3081
+
3082
+ # Customize the options with defaults
3083
+ metadata = @config.rpcs.get_connection_info.metadata.to_h
3084
+
3085
+ # Set x-goog-api-client and x-goog-user-project headers
3086
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3087
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3088
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
3089
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3090
+
3091
+ header_params = {}
3092
+ if request.parent
3093
+ header_params["parent"] = request.parent
3094
+ end
3095
+
3096
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3097
+ metadata[:"x-goog-request-params"] ||= request_params_header
3098
+
3099
+ options.apply_defaults timeout: @config.rpcs.get_connection_info.timeout,
3100
+ metadata: metadata,
3101
+ retry_policy: @config.rpcs.get_connection_info.retry_policy
3102
+
3103
+ options.apply_defaults timeout: @config.timeout,
3104
+ metadata: @config.metadata,
3105
+ retry_policy: @config.retry_policy
3106
+
3107
+ @alloy_db_admin_stub.call_rpc :get_connection_info, request, options: options do |response, operation|
3108
+ yield response, operation if block_given?
3109
+ return response
3110
+ end
3111
+ rescue ::GRPC::BadStatus => e
3112
+ raise ::Google::Cloud::Error.from_error(e)
3113
+ end
3114
+
3115
+ ##
3116
+ # Lists Users in a given project and location.
3117
+ #
3118
+ # @overload list_users(request, options = nil)
3119
+ # Pass arguments to `list_users` via a request object, either of type
3120
+ # {::Google::Cloud::AlloyDB::V1alpha::ListUsersRequest} or an equivalent Hash.
3121
+ #
3122
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::ListUsersRequest, ::Hash]
3123
+ # A request object representing the call parameters. Required. To specify no
3124
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3125
+ # @param options [::Gapic::CallOptions, ::Hash]
3126
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3127
+ #
3128
+ # @overload list_users(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
3129
+ # Pass arguments to `list_users` via keyword arguments. Note that at
3130
+ # least one keyword argument is required. To specify no parameters, or to keep all
3131
+ # the default parameter values, pass an empty Hash as a request object (see above).
3132
+ #
3133
+ # @param parent [::String]
3134
+ # Required. Parent value for ListUsersRequest
3135
+ # @param page_size [::Integer]
3136
+ # Optional. Requested page size. Server may return fewer items than
3137
+ # requested. If unspecified, server will pick an appropriate default.
3138
+ # @param page_token [::String]
3139
+ # Optional. A token identifying a page of results the server should return.
3140
+ # @param filter [::String]
3141
+ # Optional. Filtering results
3142
+ # @param order_by [::String]
3143
+ # Optional. Hint for how to order the results
3144
+ #
3145
+ # @yield [response, operation] Access the result along with the RPC operation
3146
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1alpha::User>]
3147
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3148
+ #
3149
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::AlloyDB::V1alpha::User>]
3150
+ #
3151
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3152
+ #
3153
+ # @example Basic example
3154
+ # require "google/cloud/alloy_db/v1alpha"
3155
+ #
3156
+ # # Create a client object. The client can be reused for multiple calls.
3157
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
3158
+ #
3159
+ # # Create a request. To set request fields, pass in keyword arguments.
3160
+ # request = Google::Cloud::AlloyDB::V1alpha::ListUsersRequest.new
3161
+ #
3162
+ # # Call the list_users method.
3163
+ # result = client.list_users request
3164
+ #
3165
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
3166
+ # # over elements, and API calls will be issued to fetch pages as needed.
3167
+ # result.each do |item|
3168
+ # # Each element is of type ::Google::Cloud::AlloyDB::V1alpha::User.
3169
+ # p item
3170
+ # end
3171
+ #
3172
+ def list_users request, options = nil
3173
+ raise ::ArgumentError, "request must be provided" if request.nil?
3174
+
3175
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::ListUsersRequest
3176
+
3177
+ # Converts hash and nil to an options object
3178
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3179
+
3180
+ # Customize the options with defaults
3181
+ metadata = @config.rpcs.list_users.metadata.to_h
3182
+
3183
+ # Set x-goog-api-client and x-goog-user-project headers
3184
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3185
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3186
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
3187
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3188
+
3189
+ header_params = {}
3190
+ if request.parent
3191
+ header_params["parent"] = request.parent
3192
+ end
3193
+
3194
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3195
+ metadata[:"x-goog-request-params"] ||= request_params_header
3196
+
3197
+ options.apply_defaults timeout: @config.rpcs.list_users.timeout,
3198
+ metadata: metadata,
3199
+ retry_policy: @config.rpcs.list_users.retry_policy
3200
+
3201
+ options.apply_defaults timeout: @config.timeout,
3202
+ metadata: @config.metadata,
3203
+ retry_policy: @config.retry_policy
3204
+
3205
+ @alloy_db_admin_stub.call_rpc :list_users, request, options: options do |response, operation|
3206
+ response = ::Gapic::PagedEnumerable.new @alloy_db_admin_stub, :list_users, request, response, operation, options
3207
+ yield response, operation if block_given?
3208
+ return response
3209
+ end
3210
+ rescue ::GRPC::BadStatus => e
3211
+ raise ::Google::Cloud::Error.from_error(e)
3212
+ end
3213
+
3214
+ ##
3215
+ # Gets details of a single User.
3216
+ #
3217
+ # @overload get_user(request, options = nil)
3218
+ # Pass arguments to `get_user` via a request object, either of type
3219
+ # {::Google::Cloud::AlloyDB::V1alpha::GetUserRequest} or an equivalent Hash.
3220
+ #
3221
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::GetUserRequest, ::Hash]
3222
+ # A request object representing the call parameters. Required. To specify no
3223
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3224
+ # @param options [::Gapic::CallOptions, ::Hash]
3225
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3226
+ #
3227
+ # @overload get_user(name: nil)
3228
+ # Pass arguments to `get_user` via keyword arguments. Note that at
3229
+ # least one keyword argument is required. To specify no parameters, or to keep all
3230
+ # the default parameter values, pass an empty Hash as a request object (see above).
3231
+ #
3232
+ # @param name [::String]
3233
+ # Required. The name of the resource. For the required format, see the
3234
+ # comment on the User.name field.
3235
+ #
3236
+ # @yield [response, operation] Access the result along with the RPC operation
3237
+ # @yieldparam response [::Google::Cloud::AlloyDB::V1alpha::User]
3238
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3239
+ #
3240
+ # @return [::Google::Cloud::AlloyDB::V1alpha::User]
3241
+ #
3242
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3243
+ #
3244
+ # @example Basic example
3245
+ # require "google/cloud/alloy_db/v1alpha"
3246
+ #
3247
+ # # Create a client object. The client can be reused for multiple calls.
3248
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
3249
+ #
3250
+ # # Create a request. To set request fields, pass in keyword arguments.
3251
+ # request = Google::Cloud::AlloyDB::V1alpha::GetUserRequest.new
3252
+ #
3253
+ # # Call the get_user method.
3254
+ # result = client.get_user request
3255
+ #
3256
+ # # The returned object is of type Google::Cloud::AlloyDB::V1alpha::User.
3257
+ # p result
3258
+ #
3259
+ def get_user request, options = nil
3260
+ raise ::ArgumentError, "request must be provided" if request.nil?
3261
+
3262
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::GetUserRequest
3263
+
3264
+ # Converts hash and nil to an options object
3265
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3266
+
3267
+ # Customize the options with defaults
3268
+ metadata = @config.rpcs.get_user.metadata.to_h
3269
+
3270
+ # Set x-goog-api-client and x-goog-user-project headers
3271
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3272
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3273
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
3274
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3275
+
3276
+ header_params = {}
3277
+ if request.name
3278
+ header_params["name"] = request.name
3279
+ end
3280
+
3281
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3282
+ metadata[:"x-goog-request-params"] ||= request_params_header
3283
+
3284
+ options.apply_defaults timeout: @config.rpcs.get_user.timeout,
3285
+ metadata: metadata,
3286
+ retry_policy: @config.rpcs.get_user.retry_policy
3287
+
3288
+ options.apply_defaults timeout: @config.timeout,
3289
+ metadata: @config.metadata,
3290
+ retry_policy: @config.retry_policy
3291
+
3292
+ @alloy_db_admin_stub.call_rpc :get_user, request, options: options do |response, operation|
3293
+ yield response, operation if block_given?
3294
+ return response
3295
+ end
3296
+ rescue ::GRPC::BadStatus => e
3297
+ raise ::Google::Cloud::Error.from_error(e)
3298
+ end
3299
+
3300
+ ##
3301
+ # Creates a new User in a given project, location, and cluster.
3302
+ #
3303
+ # @overload create_user(request, options = nil)
3304
+ # Pass arguments to `create_user` via a request object, either of type
3305
+ # {::Google::Cloud::AlloyDB::V1alpha::CreateUserRequest} or an equivalent Hash.
3306
+ #
3307
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::CreateUserRequest, ::Hash]
3308
+ # A request object representing the call parameters. Required. To specify no
3309
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3310
+ # @param options [::Gapic::CallOptions, ::Hash]
3311
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3312
+ #
3313
+ # @overload create_user(parent: nil, user_id: nil, user: nil, request_id: nil, validate_only: nil)
3314
+ # Pass arguments to `create_user` via keyword arguments. Note that at
3315
+ # least one keyword argument is required. To specify no parameters, or to keep all
3316
+ # the default parameter values, pass an empty Hash as a request object (see above).
3317
+ #
3318
+ # @param parent [::String]
3319
+ # Required. Value for parent.
3320
+ # @param user_id [::String]
3321
+ # Required. ID of the requesting object.
3322
+ # @param user [::Google::Cloud::AlloyDB::V1alpha::User, ::Hash]
3323
+ # Required. The resource being created
3324
+ # @param request_id [::String]
3325
+ # Optional. An optional request ID to identify requests. Specify a unique
3326
+ # request ID so that if you must retry your request, the server will know to
3327
+ # ignore the request if it has already been completed. The server will
3328
+ # guarantee that for at least 60 minutes since the first request.
3329
+ #
3330
+ # For example, consider a situation where you make an initial request and
3331
+ # the request times out. If you make the request again with the same request
3332
+ # ID, the server can check if original operation with the same request ID
3333
+ # was received, and if so, will ignore the second request. This prevents
3334
+ # clients from accidentally creating duplicate commitments.
3335
+ #
3336
+ # The request ID must be a valid UUID with the exception that zero UUID is
3337
+ # not supported (00000000-0000-0000-0000-000000000000).
3338
+ # @param validate_only [::Boolean]
3339
+ # Optional. If set, the backend validates the request, but doesn't actually
3340
+ # execute it.
3341
+ #
3342
+ # @yield [response, operation] Access the result along with the RPC operation
3343
+ # @yieldparam response [::Google::Cloud::AlloyDB::V1alpha::User]
3344
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3345
+ #
3346
+ # @return [::Google::Cloud::AlloyDB::V1alpha::User]
3347
+ #
3348
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3349
+ #
3350
+ # @example Basic example
3351
+ # require "google/cloud/alloy_db/v1alpha"
3352
+ #
3353
+ # # Create a client object. The client can be reused for multiple calls.
3354
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
3355
+ #
3356
+ # # Create a request. To set request fields, pass in keyword arguments.
3357
+ # request = Google::Cloud::AlloyDB::V1alpha::CreateUserRequest.new
3358
+ #
3359
+ # # Call the create_user method.
3360
+ # result = client.create_user request
3361
+ #
3362
+ # # The returned object is of type Google::Cloud::AlloyDB::V1alpha::User.
3363
+ # p result
3364
+ #
3365
+ def create_user request, options = nil
3366
+ raise ::ArgumentError, "request must be provided" if request.nil?
3367
+
3368
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::CreateUserRequest
3369
+
3370
+ # Converts hash and nil to an options object
3371
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3372
+
3373
+ # Customize the options with defaults
3374
+ metadata = @config.rpcs.create_user.metadata.to_h
3375
+
3376
+ # Set x-goog-api-client and x-goog-user-project headers
3377
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3378
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3379
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
3380
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3381
+
3382
+ header_params = {}
3383
+ if request.parent
3384
+ header_params["parent"] = request.parent
3385
+ end
3386
+
3387
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3388
+ metadata[:"x-goog-request-params"] ||= request_params_header
3389
+
3390
+ options.apply_defaults timeout: @config.rpcs.create_user.timeout,
3391
+ metadata: metadata,
3392
+ retry_policy: @config.rpcs.create_user.retry_policy
3393
+
3394
+ options.apply_defaults timeout: @config.timeout,
3395
+ metadata: @config.metadata,
3396
+ retry_policy: @config.retry_policy
3397
+
3398
+ @alloy_db_admin_stub.call_rpc :create_user, request, options: options do |response, operation|
3399
+ yield response, operation if block_given?
3400
+ return response
3401
+ end
3402
+ rescue ::GRPC::BadStatus => e
3403
+ raise ::Google::Cloud::Error.from_error(e)
3404
+ end
3405
+
3406
+ ##
3407
+ # Updates the parameters of a single User.
3408
+ #
3409
+ # @overload update_user(request, options = nil)
3410
+ # Pass arguments to `update_user` via a request object, either of type
3411
+ # {::Google::Cloud::AlloyDB::V1alpha::UpdateUserRequest} or an equivalent Hash.
3412
+ #
3413
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::UpdateUserRequest, ::Hash]
3414
+ # A request object representing the call parameters. Required. To specify no
3415
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3416
+ # @param options [::Gapic::CallOptions, ::Hash]
3417
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3418
+ #
3419
+ # @overload update_user(update_mask: nil, user: nil, request_id: nil, validate_only: nil, allow_missing: nil)
3420
+ # Pass arguments to `update_user` via keyword arguments. Note that at
3421
+ # least one keyword argument is required. To specify no parameters, or to keep all
3422
+ # the default parameter values, pass an empty Hash as a request object (see above).
3423
+ #
3424
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3425
+ # Optional. Field mask is used to specify the fields to be overwritten in the
3426
+ # User resource by the update.
3427
+ # The fields specified in the update_mask are relative to the resource, not
3428
+ # the full request. A field will be overwritten if it is in the mask. If the
3429
+ # user does not provide a mask then all fields will be overwritten.
3430
+ # @param user [::Google::Cloud::AlloyDB::V1alpha::User, ::Hash]
3431
+ # Required. The resource being updated
3432
+ # @param request_id [::String]
3433
+ # Optional. An optional request ID to identify requests. Specify a unique
3434
+ # request ID so that if you must retry your request, the server will know to
3435
+ # ignore the request if it has already been completed. The server will
3436
+ # guarantee that for at least 60 minutes since the first request.
3437
+ #
3438
+ # For example, consider a situation where you make an initial request and
3439
+ # the request times out. If you make the request again with the same request
3440
+ # ID, the server can check if original operation with the same request ID
3441
+ # was received, and if so, will ignore the second request. This prevents
3442
+ # clients from accidentally creating duplicate commitments.
3443
+ #
3444
+ # The request ID must be a valid UUID with the exception that zero UUID is
3445
+ # not supported (00000000-0000-0000-0000-000000000000).
3446
+ # @param validate_only [::Boolean]
3447
+ # Optional. If set, the backend validates the request, but doesn't actually
3448
+ # execute it.
3449
+ # @param allow_missing [::Boolean]
3450
+ # Optional. Allow missing fields in the update mask.
3451
+ #
3452
+ # @yield [response, operation] Access the result along with the RPC operation
3453
+ # @yieldparam response [::Google::Cloud::AlloyDB::V1alpha::User]
3454
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3455
+ #
3456
+ # @return [::Google::Cloud::AlloyDB::V1alpha::User]
3457
+ #
3458
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3459
+ #
3460
+ # @example Basic example
3461
+ # require "google/cloud/alloy_db/v1alpha"
3462
+ #
3463
+ # # Create a client object. The client can be reused for multiple calls.
3464
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
3465
+ #
3466
+ # # Create a request. To set request fields, pass in keyword arguments.
3467
+ # request = Google::Cloud::AlloyDB::V1alpha::UpdateUserRequest.new
3468
+ #
3469
+ # # Call the update_user method.
3470
+ # result = client.update_user request
3471
+ #
3472
+ # # The returned object is of type Google::Cloud::AlloyDB::V1alpha::User.
3473
+ # p result
3474
+ #
3475
+ def update_user request, options = nil
3476
+ raise ::ArgumentError, "request must be provided" if request.nil?
3477
+
3478
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::UpdateUserRequest
3479
+
3480
+ # Converts hash and nil to an options object
3481
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3482
+
3483
+ # Customize the options with defaults
3484
+ metadata = @config.rpcs.update_user.metadata.to_h
3485
+
3486
+ # Set x-goog-api-client and x-goog-user-project headers
3487
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3488
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3489
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
3490
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3491
+
3492
+ header_params = {}
3493
+ if request.user&.name
3494
+ header_params["user.name"] = request.user.name
3495
+ end
3496
+
3497
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3498
+ metadata[:"x-goog-request-params"] ||= request_params_header
3499
+
3500
+ options.apply_defaults timeout: @config.rpcs.update_user.timeout,
3501
+ metadata: metadata,
3502
+ retry_policy: @config.rpcs.update_user.retry_policy
3503
+
3504
+ options.apply_defaults timeout: @config.timeout,
3505
+ metadata: @config.metadata,
3506
+ retry_policy: @config.retry_policy
3507
+
3508
+ @alloy_db_admin_stub.call_rpc :update_user, request, options: options do |response, operation|
3509
+ yield response, operation if block_given?
3510
+ return response
3511
+ end
3512
+ rescue ::GRPC::BadStatus => e
3513
+ raise ::Google::Cloud::Error.from_error(e)
3514
+ end
3515
+
3516
+ ##
3517
+ # Deletes a single User.
3518
+ #
3519
+ # @overload delete_user(request, options = nil)
3520
+ # Pass arguments to `delete_user` via a request object, either of type
3521
+ # {::Google::Cloud::AlloyDB::V1alpha::DeleteUserRequest} or an equivalent Hash.
3522
+ #
3523
+ # @param request [::Google::Cloud::AlloyDB::V1alpha::DeleteUserRequest, ::Hash]
3524
+ # A request object representing the call parameters. Required. To specify no
3525
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3526
+ # @param options [::Gapic::CallOptions, ::Hash]
3527
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3528
+ #
3529
+ # @overload delete_user(name: nil, request_id: nil, validate_only: nil)
3530
+ # Pass arguments to `delete_user` via keyword arguments. Note that at
3531
+ # least one keyword argument is required. To specify no parameters, or to keep all
3532
+ # the default parameter values, pass an empty Hash as a request object (see above).
3533
+ #
3534
+ # @param name [::String]
3535
+ # Required. The name of the resource. For the required format, see the
3536
+ # comment on the User.name field.
3537
+ # @param request_id [::String]
3538
+ # Optional. An optional request ID to identify requests. Specify a unique
3539
+ # request ID so that if you must retry your request, the server will know to
3540
+ # ignore the request if it has already been completed. The server will
3541
+ # guarantee that for at least 60 minutes after the first request.
3542
+ #
3543
+ # For example, consider a situation where you make an initial request and
3544
+ # the request times out. If you make the request again with the same request
3545
+ # ID, the server can check if original operation with the same request ID
3546
+ # was received, and if so, will ignore the second request. This prevents
3547
+ # clients from accidentally creating duplicate commitments.
3548
+ #
3549
+ # The request ID must be a valid UUID with the exception that zero UUID is
3550
+ # not supported (00000000-0000-0000-0000-000000000000).
3551
+ # @param validate_only [::Boolean]
3552
+ # Optional. If set, the backend validates the request, but doesn't actually
3553
+ # execute it.
3554
+ #
3555
+ # @yield [response, operation] Access the result along with the RPC operation
3556
+ # @yieldparam response [::Google::Protobuf::Empty]
3557
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3558
+ #
3559
+ # @return [::Google::Protobuf::Empty]
3560
+ #
3561
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3562
+ #
3563
+ # @example Basic example
3564
+ # require "google/cloud/alloy_db/v1alpha"
3565
+ #
3566
+ # # Create a client object. The client can be reused for multiple calls.
3567
+ # client = Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new
3568
+ #
3569
+ # # Create a request. To set request fields, pass in keyword arguments.
3570
+ # request = Google::Cloud::AlloyDB::V1alpha::DeleteUserRequest.new
3571
+ #
3572
+ # # Call the delete_user method.
3573
+ # result = client.delete_user request
3574
+ #
3575
+ # # The returned object is of type Google::Protobuf::Empty.
3576
+ # p result
3577
+ #
3578
+ def delete_user request, options = nil
3579
+ raise ::ArgumentError, "request must be provided" if request.nil?
3580
+
3581
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AlloyDB::V1alpha::DeleteUserRequest
3582
+
3583
+ # Converts hash and nil to an options object
3584
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3585
+
3586
+ # Customize the options with defaults
3587
+ metadata = @config.rpcs.delete_user.metadata.to_h
3588
+
3589
+ # Set x-goog-api-client and x-goog-user-project headers
3590
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3591
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3592
+ gapic_version: ::Google::Cloud::AlloyDB::V1alpha::VERSION
3593
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3594
+
3595
+ header_params = {}
3596
+ if request.name
3597
+ header_params["name"] = request.name
3598
+ end
3599
+
3600
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3601
+ metadata[:"x-goog-request-params"] ||= request_params_header
3602
+
3603
+ options.apply_defaults timeout: @config.rpcs.delete_user.timeout,
3604
+ metadata: metadata,
3605
+ retry_policy: @config.rpcs.delete_user.retry_policy
3606
+
3607
+ options.apply_defaults timeout: @config.timeout,
3608
+ metadata: @config.metadata,
3609
+ retry_policy: @config.retry_policy
3610
+
3611
+ @alloy_db_admin_stub.call_rpc :delete_user, request, options: options do |response, operation|
3612
+ yield response, operation if block_given?
3613
+ return response
3614
+ end
3615
+ rescue ::GRPC::BadStatus => e
3616
+ raise ::Google::Cloud::Error.from_error(e)
3617
+ end
3618
+
3619
+ ##
3620
+ # Configuration class for the AlloyDBAdmin API.
3621
+ #
3622
+ # This class represents the configuration for AlloyDBAdmin,
3623
+ # providing control over timeouts, retry behavior, logging, transport
3624
+ # parameters, and other low-level controls. Certain parameters can also be
3625
+ # applied individually to specific RPCs. See
3626
+ # {::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client::Configuration::Rpcs}
3627
+ # for a list of RPCs that can be configured independently.
3628
+ #
3629
+ # Configuration can be applied globally to all clients, or to a single client
3630
+ # on construction.
3631
+ #
3632
+ # @example
3633
+ #
3634
+ # # Modify the global config, setting the timeout for
3635
+ # # list_clusters to 20 seconds,
3636
+ # # and all remaining timeouts to 10 seconds.
3637
+ # ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.configure do |config|
3638
+ # config.timeout = 10.0
3639
+ # config.rpcs.list_clusters.timeout = 20.0
3640
+ # end
3641
+ #
3642
+ # # Apply the above configuration only to a new client.
3643
+ # client = ::Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Client.new do |config|
3644
+ # config.timeout = 10.0
3645
+ # config.rpcs.list_clusters.timeout = 20.0
3646
+ # end
3647
+ #
3648
+ # @!attribute [rw] endpoint
3649
+ # The hostname or hostname:port of the service endpoint.
3650
+ # Defaults to `"alloydb.googleapis.com"`.
3651
+ # @return [::String]
3652
+ # @!attribute [rw] credentials
3653
+ # Credentials to send with calls. You may provide any of the following types:
3654
+ # * (`String`) The path to a service account key file in JSON format
3655
+ # * (`Hash`) A service account key as a Hash
3656
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
3657
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
3658
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
3659
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
3660
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
3661
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
3662
+ # * (`nil`) indicating no credentials
3663
+ # @return [::Object]
3664
+ # @!attribute [rw] scope
3665
+ # The OAuth scopes
3666
+ # @return [::Array<::String>]
3667
+ # @!attribute [rw] lib_name
3668
+ # The library name as recorded in instrumentation and logging
3669
+ # @return [::String]
3670
+ # @!attribute [rw] lib_version
3671
+ # The library version as recorded in instrumentation and logging
3672
+ # @return [::String]
3673
+ # @!attribute [rw] channel_args
3674
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
3675
+ # `GRPC::Core::Channel` object is provided as the credential.
3676
+ # @return [::Hash]
3677
+ # @!attribute [rw] interceptors
3678
+ # An array of interceptors that are run before calls are executed.
3679
+ # @return [::Array<::GRPC::ClientInterceptor>]
3680
+ # @!attribute [rw] timeout
3681
+ # The call timeout in seconds.
3682
+ # @return [::Numeric]
3683
+ # @!attribute [rw] metadata
3684
+ # Additional gRPC headers to be sent with the call.
3685
+ # @return [::Hash{::Symbol=>::String}]
3686
+ # @!attribute [rw] retry_policy
3687
+ # The retry policy. The value is a hash with the following keys:
3688
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3689
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3690
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3691
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3692
+ # trigger a retry.
3693
+ # @return [::Hash]
3694
+ # @!attribute [rw] quota_project
3695
+ # A separate project against which to charge quota.
3696
+ # @return [::String]
3697
+ #
3698
+ class Configuration
3699
+ extend ::Gapic::Config
3700
+
3701
+ DEFAULT_ENDPOINT = "alloydb.googleapis.com"
3702
+
3703
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
3704
+ config_attr :credentials, nil do |value|
3705
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
3706
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
3707
+ allowed.any? { |klass| klass === value }
3708
+ end
3709
+ config_attr :scope, nil, ::String, ::Array, nil
3710
+ config_attr :lib_name, nil, ::String, nil
3711
+ config_attr :lib_version, nil, ::String, nil
3712
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
3713
+ config_attr :interceptors, nil, ::Array, nil
3714
+ config_attr :timeout, nil, ::Numeric, nil
3715
+ config_attr :metadata, nil, ::Hash, nil
3716
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
3717
+ config_attr :quota_project, nil, ::String, nil
3718
+
3719
+ # @private
3720
+ def initialize parent_config = nil
3721
+ @parent_config = parent_config unless parent_config.nil?
3722
+
3723
+ yield self if block_given?
3724
+ end
3725
+
3726
+ ##
3727
+ # Configurations for individual RPCs
3728
+ # @return [Rpcs]
3729
+ #
3730
+ def rpcs
3731
+ @rpcs ||= begin
3732
+ parent_rpcs = nil
3733
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
3734
+ Rpcs.new parent_rpcs
3735
+ end
3736
+ end
3737
+
3738
+ ##
3739
+ # Configuration RPC class for the AlloyDBAdmin API.
3740
+ #
3741
+ # Includes fields providing the configuration for each RPC in this service.
3742
+ # Each configuration object is of type `Gapic::Config::Method` and includes
3743
+ # the following configuration fields:
3744
+ #
3745
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
3746
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
3747
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
3748
+ # include the following keys:
3749
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3750
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3751
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3752
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3753
+ # trigger a retry.
3754
+ #
3755
+ class Rpcs
3756
+ ##
3757
+ # RPC-specific configuration for `list_clusters`
3758
+ # @return [::Gapic::Config::Method]
3759
+ #
3760
+ attr_reader :list_clusters
3761
+ ##
3762
+ # RPC-specific configuration for `get_cluster`
3763
+ # @return [::Gapic::Config::Method]
3764
+ #
3765
+ attr_reader :get_cluster
3766
+ ##
3767
+ # RPC-specific configuration for `create_cluster`
3768
+ # @return [::Gapic::Config::Method]
3769
+ #
3770
+ attr_reader :create_cluster
3771
+ ##
3772
+ # RPC-specific configuration for `update_cluster`
3773
+ # @return [::Gapic::Config::Method]
3774
+ #
3775
+ attr_reader :update_cluster
3776
+ ##
3777
+ # RPC-specific configuration for `delete_cluster`
3778
+ # @return [::Gapic::Config::Method]
3779
+ #
3780
+ attr_reader :delete_cluster
3781
+ ##
3782
+ # RPC-specific configuration for `promote_cluster`
3783
+ # @return [::Gapic::Config::Method]
3784
+ #
3785
+ attr_reader :promote_cluster
3786
+ ##
3787
+ # RPC-specific configuration for `restore_cluster`
3788
+ # @return [::Gapic::Config::Method]
3789
+ #
3790
+ attr_reader :restore_cluster
3791
+ ##
3792
+ # RPC-specific configuration for `create_secondary_cluster`
3793
+ # @return [::Gapic::Config::Method]
3794
+ #
3795
+ attr_reader :create_secondary_cluster
3796
+ ##
3797
+ # RPC-specific configuration for `list_instances`
3798
+ # @return [::Gapic::Config::Method]
3799
+ #
3800
+ attr_reader :list_instances
3801
+ ##
3802
+ # RPC-specific configuration for `get_instance`
3803
+ # @return [::Gapic::Config::Method]
3804
+ #
3805
+ attr_reader :get_instance
3806
+ ##
3807
+ # RPC-specific configuration for `create_instance`
3808
+ # @return [::Gapic::Config::Method]
3809
+ #
3810
+ attr_reader :create_instance
3811
+ ##
3812
+ # RPC-specific configuration for `create_secondary_instance`
3813
+ # @return [::Gapic::Config::Method]
3814
+ #
3815
+ attr_reader :create_secondary_instance
3816
+ ##
3817
+ # RPC-specific configuration for `batch_create_instances`
3818
+ # @return [::Gapic::Config::Method]
3819
+ #
3820
+ attr_reader :batch_create_instances
3821
+ ##
3822
+ # RPC-specific configuration for `update_instance`
3823
+ # @return [::Gapic::Config::Method]
3824
+ #
3825
+ attr_reader :update_instance
3826
+ ##
3827
+ # RPC-specific configuration for `delete_instance`
3828
+ # @return [::Gapic::Config::Method]
3829
+ #
3830
+ attr_reader :delete_instance
3831
+ ##
3832
+ # RPC-specific configuration for `failover_instance`
3833
+ # @return [::Gapic::Config::Method]
3834
+ #
3835
+ attr_reader :failover_instance
3836
+ ##
3837
+ # RPC-specific configuration for `inject_fault`
3838
+ # @return [::Gapic::Config::Method]
3839
+ #
3840
+ attr_reader :inject_fault
3841
+ ##
3842
+ # RPC-specific configuration for `restart_instance`
3843
+ # @return [::Gapic::Config::Method]
3844
+ #
3845
+ attr_reader :restart_instance
3846
+ ##
3847
+ # RPC-specific configuration for `list_backups`
3848
+ # @return [::Gapic::Config::Method]
3849
+ #
3850
+ attr_reader :list_backups
3851
+ ##
3852
+ # RPC-specific configuration for `get_backup`
3853
+ # @return [::Gapic::Config::Method]
3854
+ #
3855
+ attr_reader :get_backup
3856
+ ##
3857
+ # RPC-specific configuration for `create_backup`
3858
+ # @return [::Gapic::Config::Method]
3859
+ #
3860
+ attr_reader :create_backup
3861
+ ##
3862
+ # RPC-specific configuration for `update_backup`
3863
+ # @return [::Gapic::Config::Method]
3864
+ #
3865
+ attr_reader :update_backup
3866
+ ##
3867
+ # RPC-specific configuration for `delete_backup`
3868
+ # @return [::Gapic::Config::Method]
3869
+ #
3870
+ attr_reader :delete_backup
3871
+ ##
3872
+ # RPC-specific configuration for `list_supported_database_flags`
3873
+ # @return [::Gapic::Config::Method]
3874
+ #
3875
+ attr_reader :list_supported_database_flags
3876
+ ##
3877
+ # RPC-specific configuration for `generate_client_certificate`
3878
+ # @return [::Gapic::Config::Method]
3879
+ #
3880
+ attr_reader :generate_client_certificate
3881
+ ##
3882
+ # RPC-specific configuration for `get_connection_info`
3883
+ # @return [::Gapic::Config::Method]
3884
+ #
3885
+ attr_reader :get_connection_info
3886
+ ##
3887
+ # RPC-specific configuration for `list_users`
3888
+ # @return [::Gapic::Config::Method]
3889
+ #
3890
+ attr_reader :list_users
3891
+ ##
3892
+ # RPC-specific configuration for `get_user`
3893
+ # @return [::Gapic::Config::Method]
3894
+ #
3895
+ attr_reader :get_user
3896
+ ##
3897
+ # RPC-specific configuration for `create_user`
3898
+ # @return [::Gapic::Config::Method]
3899
+ #
3900
+ attr_reader :create_user
3901
+ ##
3902
+ # RPC-specific configuration for `update_user`
3903
+ # @return [::Gapic::Config::Method]
3904
+ #
3905
+ attr_reader :update_user
3906
+ ##
3907
+ # RPC-specific configuration for `delete_user`
3908
+ # @return [::Gapic::Config::Method]
3909
+ #
3910
+ attr_reader :delete_user
3911
+
3912
+ # @private
3913
+ def initialize parent_rpcs = nil
3914
+ list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters
3915
+ @list_clusters = ::Gapic::Config::Method.new list_clusters_config
3916
+ get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster
3917
+ @get_cluster = ::Gapic::Config::Method.new get_cluster_config
3918
+ create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster
3919
+ @create_cluster = ::Gapic::Config::Method.new create_cluster_config
3920
+ update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster
3921
+ @update_cluster = ::Gapic::Config::Method.new update_cluster_config
3922
+ delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster
3923
+ @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config
3924
+ promote_cluster_config = parent_rpcs.promote_cluster if parent_rpcs.respond_to? :promote_cluster
3925
+ @promote_cluster = ::Gapic::Config::Method.new promote_cluster_config
3926
+ restore_cluster_config = parent_rpcs.restore_cluster if parent_rpcs.respond_to? :restore_cluster
3927
+ @restore_cluster = ::Gapic::Config::Method.new restore_cluster_config
3928
+ create_secondary_cluster_config = parent_rpcs.create_secondary_cluster if parent_rpcs.respond_to? :create_secondary_cluster
3929
+ @create_secondary_cluster = ::Gapic::Config::Method.new create_secondary_cluster_config
3930
+ list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
3931
+ @list_instances = ::Gapic::Config::Method.new list_instances_config
3932
+ get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
3933
+ @get_instance = ::Gapic::Config::Method.new get_instance_config
3934
+ create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
3935
+ @create_instance = ::Gapic::Config::Method.new create_instance_config
3936
+ create_secondary_instance_config = parent_rpcs.create_secondary_instance if parent_rpcs.respond_to? :create_secondary_instance
3937
+ @create_secondary_instance = ::Gapic::Config::Method.new create_secondary_instance_config
3938
+ batch_create_instances_config = parent_rpcs.batch_create_instances if parent_rpcs.respond_to? :batch_create_instances
3939
+ @batch_create_instances = ::Gapic::Config::Method.new batch_create_instances_config
3940
+ update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance
3941
+ @update_instance = ::Gapic::Config::Method.new update_instance_config
3942
+ delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
3943
+ @delete_instance = ::Gapic::Config::Method.new delete_instance_config
3944
+ failover_instance_config = parent_rpcs.failover_instance if parent_rpcs.respond_to? :failover_instance
3945
+ @failover_instance = ::Gapic::Config::Method.new failover_instance_config
3946
+ inject_fault_config = parent_rpcs.inject_fault if parent_rpcs.respond_to? :inject_fault
3947
+ @inject_fault = ::Gapic::Config::Method.new inject_fault_config
3948
+ restart_instance_config = parent_rpcs.restart_instance if parent_rpcs.respond_to? :restart_instance
3949
+ @restart_instance = ::Gapic::Config::Method.new restart_instance_config
3950
+ list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
3951
+ @list_backups = ::Gapic::Config::Method.new list_backups_config
3952
+ get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
3953
+ @get_backup = ::Gapic::Config::Method.new get_backup_config
3954
+ create_backup_config = parent_rpcs.create_backup if parent_rpcs.respond_to? :create_backup
3955
+ @create_backup = ::Gapic::Config::Method.new create_backup_config
3956
+ update_backup_config = parent_rpcs.update_backup if parent_rpcs.respond_to? :update_backup
3957
+ @update_backup = ::Gapic::Config::Method.new update_backup_config
3958
+ delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup
3959
+ @delete_backup = ::Gapic::Config::Method.new delete_backup_config
3960
+ list_supported_database_flags_config = parent_rpcs.list_supported_database_flags if parent_rpcs.respond_to? :list_supported_database_flags
3961
+ @list_supported_database_flags = ::Gapic::Config::Method.new list_supported_database_flags_config
3962
+ generate_client_certificate_config = parent_rpcs.generate_client_certificate if parent_rpcs.respond_to? :generate_client_certificate
3963
+ @generate_client_certificate = ::Gapic::Config::Method.new generate_client_certificate_config
3964
+ get_connection_info_config = parent_rpcs.get_connection_info if parent_rpcs.respond_to? :get_connection_info
3965
+ @get_connection_info = ::Gapic::Config::Method.new get_connection_info_config
3966
+ list_users_config = parent_rpcs.list_users if parent_rpcs.respond_to? :list_users
3967
+ @list_users = ::Gapic::Config::Method.new list_users_config
3968
+ get_user_config = parent_rpcs.get_user if parent_rpcs.respond_to? :get_user
3969
+ @get_user = ::Gapic::Config::Method.new get_user_config
3970
+ create_user_config = parent_rpcs.create_user if parent_rpcs.respond_to? :create_user
3971
+ @create_user = ::Gapic::Config::Method.new create_user_config
3972
+ update_user_config = parent_rpcs.update_user if parent_rpcs.respond_to? :update_user
3973
+ @update_user = ::Gapic::Config::Method.new update_user_config
3974
+ delete_user_config = parent_rpcs.delete_user if parent_rpcs.respond_to? :delete_user
3975
+ @delete_user = ::Gapic::Config::Method.new delete_user_config
3976
+
3977
+ yield self if block_given?
3978
+ end
3979
+ end
3980
+ end
3981
+ end
3982
+ end
3983
+ end
3984
+ end
3985
+ end
3986
+ end