google-cloud-memorystore-v1beta 0.10.0 → 0.12.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.
@@ -0,0 +1,1187 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/memorystore/v1beta/memorystore_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Memorystore
26
+ module V1beta
27
+ module Memorystore
28
+ ##
29
+ # Client for the Memorystore service.
30
+ #
31
+ # Service describing handlers for resources
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "memorystore.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :memorystore_stub
44
+
45
+ ##
46
+ # Configure the Memorystore Client class.
47
+ #
48
+ # See {::Google::Cloud::Memorystore::V1beta::Memorystore::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all Memorystore clients
54
+ # ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "Memorystore", "V1beta"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.rpcs.list_instances.timeout = 60.0
75
+ default_config.rpcs.list_instances.retry_policy = {
76
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
77
+ }
78
+
79
+ default_config.rpcs.get_instance.timeout = 60.0
80
+ default_config.rpcs.get_instance.retry_policy = {
81
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
82
+ }
83
+
84
+ default_config.rpcs.create_instance.timeout = 600.0
85
+
86
+ default_config.rpcs.update_instance.timeout = 600.0
87
+
88
+ default_config.rpcs.delete_instance.timeout = 600.0
89
+
90
+ default_config.rpcs.get_certificate_authority.timeout = 60.0
91
+ default_config.rpcs.get_certificate_authority.retry_policy = {
92
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
93
+ }
94
+
95
+ default_config
96
+ end
97
+ yield @configure if block_given?
98
+ @configure
99
+ end
100
+
101
+ ##
102
+ # Configure the Memorystore Client instance.
103
+ #
104
+ # The configuration is set to the derived mode, meaning that values can be changed,
105
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
106
+ # should be made on {Client.configure}.
107
+ #
108
+ # See {::Google::Cloud::Memorystore::V1beta::Memorystore::Client::Configuration}
109
+ # for a description of the configuration fields.
110
+ #
111
+ # @yield [config] Configure the Client client.
112
+ # @yieldparam config [Client::Configuration]
113
+ #
114
+ # @return [Client::Configuration]
115
+ #
116
+ def configure
117
+ yield @config if block_given?
118
+ @config
119
+ end
120
+
121
+ ##
122
+ # The effective universe domain
123
+ #
124
+ # @return [String]
125
+ #
126
+ def universe_domain
127
+ @memorystore_stub.universe_domain
128
+ end
129
+
130
+ ##
131
+ # Create a new Memorystore client object.
132
+ #
133
+ # @example
134
+ #
135
+ # # Create a client using the default configuration
136
+ # client = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new
137
+ #
138
+ # # Create a client using a custom configuration
139
+ # client = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config|
140
+ # config.timeout = 10.0
141
+ # end
142
+ #
143
+ # @yield [config] Configure the Memorystore client.
144
+ # @yieldparam config [Client::Configuration]
145
+ #
146
+ def initialize
147
+ # These require statements are intentionally placed here to initialize
148
+ # the gRPC module only when it's required.
149
+ # See https://github.com/googleapis/toolkit/issues/446
150
+ require "gapic/grpc"
151
+ require "google/cloud/memorystore/v1beta/memorystore_services_pb"
152
+
153
+ # Create the configuration object
154
+ @config = Configuration.new Client.configure
155
+
156
+ # Yield the configuration if needed
157
+ yield @config if block_given?
158
+
159
+ # Create credentials
160
+ credentials = @config.credentials
161
+ # Use self-signed JWT if the endpoint is unchanged from default,
162
+ # but only if the default endpoint does not have a region prefix.
163
+ enable_self_signed_jwt = @config.endpoint.nil? ||
164
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
165
+ !@config.endpoint.split(".").first.include?("-"))
166
+ credentials ||= Credentials.default scope: @config.scope,
167
+ enable_self_signed_jwt: enable_self_signed_jwt
168
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
169
+ credentials = Credentials.new credentials, scope: @config.scope
170
+ end
171
+ @quota_project_id = @config.quota_project
172
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
173
+
174
+ @operations_client = Operations.new do |config|
175
+ config.credentials = credentials
176
+ config.quota_project = @quota_project_id
177
+ config.endpoint = @config.endpoint
178
+ config.universe_domain = @config.universe_domain
179
+ end
180
+
181
+ @memorystore_stub = ::Gapic::ServiceStub.new(
182
+ ::Google::Cloud::Memorystore::V1beta::Memorystore::Stub,
183
+ credentials: credentials,
184
+ endpoint: @config.endpoint,
185
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
186
+ universe_domain: @config.universe_domain,
187
+ channel_args: @config.channel_args,
188
+ interceptors: @config.interceptors,
189
+ channel_pool_config: @config.channel_pool,
190
+ logger: @config.logger
191
+ )
192
+
193
+ @memorystore_stub.stub_logger&.info do |entry|
194
+ entry.set_system_name
195
+ entry.set_service
196
+ entry.message = "Created client for #{entry.service}"
197
+ entry.set_credentials_fields credentials
198
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
199
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
200
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
201
+ end
202
+
203
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
204
+ config.credentials = credentials
205
+ config.quota_project = @quota_project_id
206
+ config.endpoint = @memorystore_stub.endpoint
207
+ config.universe_domain = @memorystore_stub.universe_domain
208
+ config.logger = @memorystore_stub.logger if config.respond_to? :logger=
209
+ end
210
+ end
211
+
212
+ ##
213
+ # Get the associated client for long-running operations.
214
+ #
215
+ # @return [::Google::Cloud::Memorystore::V1beta::Memorystore::Operations]
216
+ #
217
+ attr_reader :operations_client
218
+
219
+ ##
220
+ # Get the associated client for mix-in of the Locations.
221
+ #
222
+ # @return [Google::Cloud::Location::Locations::Client]
223
+ #
224
+ attr_reader :location_client
225
+
226
+ ##
227
+ # The logger used for request/response debug logging.
228
+ #
229
+ # @return [Logger]
230
+ #
231
+ def logger
232
+ @memorystore_stub.logger
233
+ end
234
+
235
+ # Service calls
236
+
237
+ ##
238
+ # Lists Instances in a given project and location.
239
+ #
240
+ # @overload list_instances(request, options = nil)
241
+ # Pass arguments to `list_instances` via a request object, either of type
242
+ # {::Google::Cloud::Memorystore::V1beta::ListInstancesRequest} or an equivalent Hash.
243
+ #
244
+ # @param request [::Google::Cloud::Memorystore::V1beta::ListInstancesRequest, ::Hash]
245
+ # A request object representing the call parameters. Required. To specify no
246
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
247
+ # @param options [::Gapic::CallOptions, ::Hash]
248
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
249
+ #
250
+ # @overload list_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
251
+ # Pass arguments to `list_instances` via keyword arguments. Note that at
252
+ # least one keyword argument is required. To specify no parameters, or to keep all
253
+ # the default parameter values, pass an empty Hash as a request object (see above).
254
+ #
255
+ # @param parent [::String]
256
+ # Required. The parent to list instances from.
257
+ # Format: projects/\\{project}/locations/\\{location}
258
+ # @param page_size [::Integer]
259
+ # Optional. Requested page size. Server may return fewer items than
260
+ # requested. If unspecified, server will pick an appropriate default.
261
+ # @param page_token [::String]
262
+ # Optional. A token identifying a page of results the server should return.
263
+ # @param filter [::String]
264
+ # Optional. Expression for filtering results.
265
+ # @param order_by [::String]
266
+ # Optional. Sort results by a defined order. Supported values: "name",
267
+ # "create_time".
268
+ #
269
+ # @yield [response, operation] Access the result along with the RPC operation
270
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1beta::Instance>]
271
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
272
+ #
273
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Memorystore::V1beta::Instance>]
274
+ #
275
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
276
+ #
277
+ # @example Basic example
278
+ # require "google/cloud/memorystore/v1beta"
279
+ #
280
+ # # Create a client object. The client can be reused for multiple calls.
281
+ # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new
282
+ #
283
+ # # Create a request. To set request fields, pass in keyword arguments.
284
+ # request = Google::Cloud::Memorystore::V1beta::ListInstancesRequest.new
285
+ #
286
+ # # Call the list_instances method.
287
+ # result = client.list_instances request
288
+ #
289
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
290
+ # # over elements, and API calls will be issued to fetch pages as needed.
291
+ # result.each do |item|
292
+ # # Each element is of type ::Google::Cloud::Memorystore::V1beta::Instance.
293
+ # p item
294
+ # end
295
+ #
296
+ def list_instances request, options = nil
297
+ raise ::ArgumentError, "request must be provided" if request.nil?
298
+
299
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::ListInstancesRequest
300
+
301
+ # Converts hash and nil to an options object
302
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
303
+
304
+ # Customize the options with defaults
305
+ metadata = @config.rpcs.list_instances.metadata.to_h
306
+
307
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
308
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
309
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
310
+ gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION
311
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
312
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
313
+
314
+ header_params = {}
315
+ if request.parent
316
+ header_params["parent"] = request.parent
317
+ end
318
+
319
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
320
+ metadata[:"x-goog-request-params"] ||= request_params_header
321
+
322
+ options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
323
+ metadata: metadata,
324
+ retry_policy: @config.rpcs.list_instances.retry_policy
325
+
326
+ options.apply_defaults timeout: @config.timeout,
327
+ metadata: @config.metadata,
328
+ retry_policy: @config.retry_policy
329
+
330
+ @memorystore_stub.call_rpc :list_instances, request, options: options do |response, operation|
331
+ response = ::Gapic::PagedEnumerable.new @memorystore_stub, :list_instances, request, response, operation, options
332
+ yield response, operation if block_given?
333
+ throw :response, response
334
+ end
335
+ rescue ::GRPC::BadStatus => e
336
+ raise ::Google::Cloud::Error.from_error(e)
337
+ end
338
+
339
+ ##
340
+ # Gets details of a single Instance.
341
+ #
342
+ # @overload get_instance(request, options = nil)
343
+ # Pass arguments to `get_instance` via a request object, either of type
344
+ # {::Google::Cloud::Memorystore::V1beta::GetInstanceRequest} or an equivalent Hash.
345
+ #
346
+ # @param request [::Google::Cloud::Memorystore::V1beta::GetInstanceRequest, ::Hash]
347
+ # A request object representing the call parameters. Required. To specify no
348
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
349
+ # @param options [::Gapic::CallOptions, ::Hash]
350
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
351
+ #
352
+ # @overload get_instance(name: nil)
353
+ # Pass arguments to `get_instance` via keyword arguments. Note that at
354
+ # least one keyword argument is required. To specify no parameters, or to keep all
355
+ # the default parameter values, pass an empty Hash as a request object (see above).
356
+ #
357
+ # @param name [::String]
358
+ # Required. The name of the instance to retrieve.
359
+ # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance}
360
+ #
361
+ # @yield [response, operation] Access the result along with the RPC operation
362
+ # @yieldparam response [::Google::Cloud::Memorystore::V1beta::Instance]
363
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
364
+ #
365
+ # @return [::Google::Cloud::Memorystore::V1beta::Instance]
366
+ #
367
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
368
+ #
369
+ # @example Basic example
370
+ # require "google/cloud/memorystore/v1beta"
371
+ #
372
+ # # Create a client object. The client can be reused for multiple calls.
373
+ # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new
374
+ #
375
+ # # Create a request. To set request fields, pass in keyword arguments.
376
+ # request = Google::Cloud::Memorystore::V1beta::GetInstanceRequest.new
377
+ #
378
+ # # Call the get_instance method.
379
+ # result = client.get_instance request
380
+ #
381
+ # # The returned object is of type Google::Cloud::Memorystore::V1beta::Instance.
382
+ # p result
383
+ #
384
+ def get_instance request, options = nil
385
+ raise ::ArgumentError, "request must be provided" if request.nil?
386
+
387
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::GetInstanceRequest
388
+
389
+ # Converts hash and nil to an options object
390
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
391
+
392
+ # Customize the options with defaults
393
+ metadata = @config.rpcs.get_instance.metadata.to_h
394
+
395
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
396
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
397
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
398
+ gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION
399
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
400
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
401
+
402
+ header_params = {}
403
+ if request.name
404
+ header_params["name"] = request.name
405
+ end
406
+
407
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
408
+ metadata[:"x-goog-request-params"] ||= request_params_header
409
+
410
+ options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
411
+ metadata: metadata,
412
+ retry_policy: @config.rpcs.get_instance.retry_policy
413
+
414
+ options.apply_defaults timeout: @config.timeout,
415
+ metadata: @config.metadata,
416
+ retry_policy: @config.retry_policy
417
+
418
+ @memorystore_stub.call_rpc :get_instance, request, options: options do |response, operation|
419
+ yield response, operation if block_given?
420
+ end
421
+ rescue ::GRPC::BadStatus => e
422
+ raise ::Google::Cloud::Error.from_error(e)
423
+ end
424
+
425
+ ##
426
+ # Creates a new Instance in a given project and location.
427
+ #
428
+ # @overload create_instance(request, options = nil)
429
+ # Pass arguments to `create_instance` via a request object, either of type
430
+ # {::Google::Cloud::Memorystore::V1beta::CreateInstanceRequest} or an equivalent Hash.
431
+ #
432
+ # @param request [::Google::Cloud::Memorystore::V1beta::CreateInstanceRequest, ::Hash]
433
+ # A request object representing the call parameters. Required. To specify no
434
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
435
+ # @param options [::Gapic::CallOptions, ::Hash]
436
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
437
+ #
438
+ # @overload create_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil)
439
+ # Pass arguments to `create_instance` via keyword arguments. Note that at
440
+ # least one keyword argument is required. To specify no parameters, or to keep all
441
+ # the default parameter values, pass an empty Hash as a request object (see above).
442
+ #
443
+ # @param parent [::String]
444
+ # Required. The parent resource where this instance will be created.
445
+ # Format: projects/\\{project}/locations/\\{location}
446
+ # @param instance_id [::String]
447
+ # Required. The ID to use for the instance, which will become the final
448
+ # component of the instance's resource name.
449
+ #
450
+ # This value is subject to the following restrictions:
451
+ #
452
+ # * Must be 4-63 characters in length
453
+ # * Must begin with a letter or digit
454
+ # * Must contain only lowercase letters, digits, and hyphens
455
+ # * Must not end with a hyphen
456
+ # * Must be unique within a location
457
+ # @param instance [::Google::Cloud::Memorystore::V1beta::Instance, ::Hash]
458
+ # Required. The instance to create.
459
+ # @param request_id [::String]
460
+ # Optional. An optional request ID to identify requests. Specify a unique
461
+ # request ID so that if you must retry your request, the server will know to
462
+ # ignore the request if it has already been completed. The server will
463
+ # guarantee that for at least 60 minutes since the first request.
464
+ #
465
+ # For example, consider a situation where you make an initial request and the
466
+ # request times out. If you make the request again with the same request
467
+ # ID, the server can check if original operation with the same request ID
468
+ # was received, and if so, will ignore the second request. This prevents
469
+ # clients from accidentally creating duplicate commitments.
470
+ #
471
+ # The request ID must be a valid UUID with the exception that zero UUID is
472
+ # not supported (00000000-0000-0000-0000-000000000000).
473
+ #
474
+ # @yield [response, operation] Access the result along with the RPC operation
475
+ # @yieldparam response [::Gapic::Operation]
476
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
477
+ #
478
+ # @return [::Gapic::Operation]
479
+ #
480
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
481
+ #
482
+ # @example Basic example
483
+ # require "google/cloud/memorystore/v1beta"
484
+ #
485
+ # # Create a client object. The client can be reused for multiple calls.
486
+ # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new
487
+ #
488
+ # # Create a request. To set request fields, pass in keyword arguments.
489
+ # request = Google::Cloud::Memorystore::V1beta::CreateInstanceRequest.new
490
+ #
491
+ # # Call the create_instance method.
492
+ # result = client.create_instance request
493
+ #
494
+ # # The returned object is of type Gapic::Operation. You can use it to
495
+ # # check the status of an operation, cancel it, or wait for results.
496
+ # # Here is how to wait for a response.
497
+ # result.wait_until_done! timeout: 60
498
+ # if result.response?
499
+ # p result.response
500
+ # else
501
+ # puts "No response received."
502
+ # end
503
+ #
504
+ def create_instance request, options = nil
505
+ raise ::ArgumentError, "request must be provided" if request.nil?
506
+
507
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::CreateInstanceRequest
508
+
509
+ # Converts hash and nil to an options object
510
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
511
+
512
+ # Customize the options with defaults
513
+ metadata = @config.rpcs.create_instance.metadata.to_h
514
+
515
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
516
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
517
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
518
+ gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION
519
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
520
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
521
+
522
+ header_params = {}
523
+ if request.parent
524
+ header_params["parent"] = request.parent
525
+ end
526
+
527
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
528
+ metadata[:"x-goog-request-params"] ||= request_params_header
529
+
530
+ options.apply_defaults timeout: @config.rpcs.create_instance.timeout,
531
+ metadata: metadata,
532
+ retry_policy: @config.rpcs.create_instance.retry_policy
533
+
534
+ options.apply_defaults timeout: @config.timeout,
535
+ metadata: @config.metadata,
536
+ retry_policy: @config.retry_policy
537
+
538
+ @memorystore_stub.call_rpc :create_instance, request, options: options do |response, operation|
539
+ response = ::Gapic::Operation.new response, @operations_client, options: options
540
+ yield response, operation if block_given?
541
+ throw :response, response
542
+ end
543
+ rescue ::GRPC::BadStatus => e
544
+ raise ::Google::Cloud::Error.from_error(e)
545
+ end
546
+
547
+ ##
548
+ # Updates the parameters of a single Instance.
549
+ #
550
+ # @overload update_instance(request, options = nil)
551
+ # Pass arguments to `update_instance` via a request object, either of type
552
+ # {::Google::Cloud::Memorystore::V1beta::UpdateInstanceRequest} or an equivalent Hash.
553
+ #
554
+ # @param request [::Google::Cloud::Memorystore::V1beta::UpdateInstanceRequest, ::Hash]
555
+ # A request object representing the call parameters. Required. To specify no
556
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
557
+ # @param options [::Gapic::CallOptions, ::Hash]
558
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
559
+ #
560
+ # @overload update_instance(update_mask: nil, instance: nil, request_id: nil)
561
+ # Pass arguments to `update_instance` via keyword arguments. Note that at
562
+ # least one keyword argument is required. To specify no parameters, or to keep all
563
+ # the default parameter values, pass an empty Hash as a request object (see above).
564
+ #
565
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
566
+ # Optional. The list of fields to be updated on the instance. At least one
567
+ # field must be specified.
568
+ # @param instance [::Google::Cloud::Memorystore::V1beta::Instance, ::Hash]
569
+ # Required. The instance to update.
570
+ # @param request_id [::String]
571
+ # Optional. An optional request ID to identify requests. Specify a unique
572
+ # request ID so that if you must retry your request, the server will know to
573
+ # ignore the request if it has already been completed. The server will
574
+ # guarantee that for at least 60 minutes since the first request.
575
+ #
576
+ # For example, consider a situation where you make an initial request and the
577
+ # request times out. If you make the request again with the same request
578
+ # ID, the server can check if original operation with the same request ID
579
+ # was received, and if so, will ignore the second request. This prevents
580
+ # clients from accidentally creating duplicate commitments.
581
+ #
582
+ # The request ID must be a valid UUID with the exception that zero UUID is
583
+ # not supported (00000000-0000-0000-0000-000000000000).
584
+ #
585
+ # @yield [response, operation] Access the result along with the RPC operation
586
+ # @yieldparam response [::Gapic::Operation]
587
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
588
+ #
589
+ # @return [::Gapic::Operation]
590
+ #
591
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
592
+ #
593
+ # @example Basic example
594
+ # require "google/cloud/memorystore/v1beta"
595
+ #
596
+ # # Create a client object. The client can be reused for multiple calls.
597
+ # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new
598
+ #
599
+ # # Create a request. To set request fields, pass in keyword arguments.
600
+ # request = Google::Cloud::Memorystore::V1beta::UpdateInstanceRequest.new
601
+ #
602
+ # # Call the update_instance method.
603
+ # result = client.update_instance request
604
+ #
605
+ # # The returned object is of type Gapic::Operation. You can use it to
606
+ # # check the status of an operation, cancel it, or wait for results.
607
+ # # Here is how to wait for a response.
608
+ # result.wait_until_done! timeout: 60
609
+ # if result.response?
610
+ # p result.response
611
+ # else
612
+ # puts "No response received."
613
+ # end
614
+ #
615
+ def update_instance request, options = nil
616
+ raise ::ArgumentError, "request must be provided" if request.nil?
617
+
618
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::UpdateInstanceRequest
619
+
620
+ # Converts hash and nil to an options object
621
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
622
+
623
+ # Customize the options with defaults
624
+ metadata = @config.rpcs.update_instance.metadata.to_h
625
+
626
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
627
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
628
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
629
+ gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION
630
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
631
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
632
+
633
+ header_params = {}
634
+ if request.instance&.name
635
+ header_params["instance.name"] = request.instance.name
636
+ end
637
+
638
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
639
+ metadata[:"x-goog-request-params"] ||= request_params_header
640
+
641
+ options.apply_defaults timeout: @config.rpcs.update_instance.timeout,
642
+ metadata: metadata,
643
+ retry_policy: @config.rpcs.update_instance.retry_policy
644
+
645
+ options.apply_defaults timeout: @config.timeout,
646
+ metadata: @config.metadata,
647
+ retry_policy: @config.retry_policy
648
+
649
+ @memorystore_stub.call_rpc :update_instance, request, options: options do |response, operation|
650
+ response = ::Gapic::Operation.new response, @operations_client, options: options
651
+ yield response, operation if block_given?
652
+ throw :response, response
653
+ end
654
+ rescue ::GRPC::BadStatus => e
655
+ raise ::Google::Cloud::Error.from_error(e)
656
+ end
657
+
658
+ ##
659
+ # Deletes a single Instance.
660
+ #
661
+ # @overload delete_instance(request, options = nil)
662
+ # Pass arguments to `delete_instance` via a request object, either of type
663
+ # {::Google::Cloud::Memorystore::V1beta::DeleteInstanceRequest} or an equivalent Hash.
664
+ #
665
+ # @param request [::Google::Cloud::Memorystore::V1beta::DeleteInstanceRequest, ::Hash]
666
+ # A request object representing the call parameters. Required. To specify no
667
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
668
+ # @param options [::Gapic::CallOptions, ::Hash]
669
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
670
+ #
671
+ # @overload delete_instance(name: nil, request_id: nil)
672
+ # Pass arguments to `delete_instance` via keyword arguments. Note that at
673
+ # least one keyword argument is required. To specify no parameters, or to keep all
674
+ # the default parameter values, pass an empty Hash as a request object (see above).
675
+ #
676
+ # @param name [::String]
677
+ # Required. The name of the instance to delete.
678
+ # Format: projects/\\{project}/locations/\\{location}/instances/\\{instance}
679
+ # @param request_id [::String]
680
+ # Optional. An optional request ID to identify requests. Specify a unique
681
+ # request ID so that if you must retry your request, the server will know to
682
+ # ignore the request if it has already been completed. The server will
683
+ # guarantee that for at least 60 minutes after the first request.
684
+ #
685
+ # For example, consider a situation where you make an initial request and the
686
+ # request times out. If you make the request again with the same request
687
+ # ID, the server can check if original operation with the same request ID
688
+ # was received, and if so, will ignore the second request. This prevents
689
+ # clients from accidentally creating duplicate commitments.
690
+ #
691
+ # The request ID must be a valid UUID with the exception that zero UUID is
692
+ # not supported (00000000-0000-0000-0000-000000000000).
693
+ #
694
+ # @yield [response, operation] Access the result along with the RPC operation
695
+ # @yieldparam response [::Gapic::Operation]
696
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
697
+ #
698
+ # @return [::Gapic::Operation]
699
+ #
700
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
701
+ #
702
+ # @example Basic example
703
+ # require "google/cloud/memorystore/v1beta"
704
+ #
705
+ # # Create a client object. The client can be reused for multiple calls.
706
+ # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new
707
+ #
708
+ # # Create a request. To set request fields, pass in keyword arguments.
709
+ # request = Google::Cloud::Memorystore::V1beta::DeleteInstanceRequest.new
710
+ #
711
+ # # Call the delete_instance method.
712
+ # result = client.delete_instance request
713
+ #
714
+ # # The returned object is of type Gapic::Operation. You can use it to
715
+ # # check the status of an operation, cancel it, or wait for results.
716
+ # # Here is how to wait for a response.
717
+ # result.wait_until_done! timeout: 60
718
+ # if result.response?
719
+ # p result.response
720
+ # else
721
+ # puts "No response received."
722
+ # end
723
+ #
724
+ def delete_instance request, options = nil
725
+ raise ::ArgumentError, "request must be provided" if request.nil?
726
+
727
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::DeleteInstanceRequest
728
+
729
+ # Converts hash and nil to an options object
730
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
731
+
732
+ # Customize the options with defaults
733
+ metadata = @config.rpcs.delete_instance.metadata.to_h
734
+
735
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
736
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
737
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
738
+ gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION
739
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
740
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
741
+
742
+ header_params = {}
743
+ if request.name
744
+ header_params["name"] = request.name
745
+ end
746
+
747
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
748
+ metadata[:"x-goog-request-params"] ||= request_params_header
749
+
750
+ options.apply_defaults timeout: @config.rpcs.delete_instance.timeout,
751
+ metadata: metadata,
752
+ retry_policy: @config.rpcs.delete_instance.retry_policy
753
+
754
+ options.apply_defaults timeout: @config.timeout,
755
+ metadata: @config.metadata,
756
+ retry_policy: @config.retry_policy
757
+
758
+ @memorystore_stub.call_rpc :delete_instance, request, options: options do |response, operation|
759
+ response = ::Gapic::Operation.new response, @operations_client, options: options
760
+ yield response, operation if block_given?
761
+ throw :response, response
762
+ end
763
+ rescue ::GRPC::BadStatus => e
764
+ raise ::Google::Cloud::Error.from_error(e)
765
+ end
766
+
767
+ ##
768
+ # Gets details about the certificate authority for an Instance.
769
+ #
770
+ # @overload get_certificate_authority(request, options = nil)
771
+ # Pass arguments to `get_certificate_authority` via a request object, either of type
772
+ # {::Google::Cloud::Memorystore::V1beta::GetCertificateAuthorityRequest} or an equivalent Hash.
773
+ #
774
+ # @param request [::Google::Cloud::Memorystore::V1beta::GetCertificateAuthorityRequest, ::Hash]
775
+ # A request object representing the call parameters. Required. To specify no
776
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
777
+ # @param options [::Gapic::CallOptions, ::Hash]
778
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
779
+ #
780
+ # @overload get_certificate_authority(name: nil)
781
+ # Pass arguments to `get_certificate_authority` via keyword arguments. Note that at
782
+ # least one keyword argument is required. To specify no parameters, or to keep all
783
+ # the default parameter values, pass an empty Hash as a request object (see above).
784
+ #
785
+ # @param name [::String]
786
+ # Required. The name of the certificate authority.
787
+ # Format:
788
+ # projects/\\{project}/locations/\\{location}/instances/\\{instance}/certificateAuthority
789
+ #
790
+ # @yield [response, operation] Access the result along with the RPC operation
791
+ # @yieldparam response [::Google::Cloud::Memorystore::V1beta::CertificateAuthority]
792
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
793
+ #
794
+ # @return [::Google::Cloud::Memorystore::V1beta::CertificateAuthority]
795
+ #
796
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
797
+ #
798
+ # @example Basic example
799
+ # require "google/cloud/memorystore/v1beta"
800
+ #
801
+ # # Create a client object. The client can be reused for multiple calls.
802
+ # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new
803
+ #
804
+ # # Create a request. To set request fields, pass in keyword arguments.
805
+ # request = Google::Cloud::Memorystore::V1beta::GetCertificateAuthorityRequest.new
806
+ #
807
+ # # Call the get_certificate_authority method.
808
+ # result = client.get_certificate_authority request
809
+ #
810
+ # # The returned object is of type Google::Cloud::Memorystore::V1beta::CertificateAuthority.
811
+ # p result
812
+ #
813
+ def get_certificate_authority request, options = nil
814
+ raise ::ArgumentError, "request must be provided" if request.nil?
815
+
816
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::GetCertificateAuthorityRequest
817
+
818
+ # Converts hash and nil to an options object
819
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
820
+
821
+ # Customize the options with defaults
822
+ metadata = @config.rpcs.get_certificate_authority.metadata.to_h
823
+
824
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
825
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
826
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
827
+ gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION
828
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
829
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
830
+
831
+ header_params = {}
832
+ if request.name
833
+ header_params["name"] = request.name
834
+ end
835
+
836
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
837
+ metadata[:"x-goog-request-params"] ||= request_params_header
838
+
839
+ options.apply_defaults timeout: @config.rpcs.get_certificate_authority.timeout,
840
+ metadata: metadata,
841
+ retry_policy: @config.rpcs.get_certificate_authority.retry_policy
842
+
843
+ options.apply_defaults timeout: @config.timeout,
844
+ metadata: @config.metadata,
845
+ retry_policy: @config.retry_policy
846
+
847
+ @memorystore_stub.call_rpc :get_certificate_authority, request, options: options do |response, operation|
848
+ yield response, operation if block_given?
849
+ end
850
+ rescue ::GRPC::BadStatus => e
851
+ raise ::Google::Cloud::Error.from_error(e)
852
+ end
853
+
854
+ ##
855
+ # Gets the details of shared regional certificate authority information for
856
+ # Memorystore instance.
857
+ #
858
+ # @overload get_shared_regional_certificate_authority(request, options = nil)
859
+ # Pass arguments to `get_shared_regional_certificate_authority` via a request object, either of type
860
+ # {::Google::Cloud::Memorystore::V1beta::GetSharedRegionalCertificateAuthorityRequest} or an equivalent Hash.
861
+ #
862
+ # @param request [::Google::Cloud::Memorystore::V1beta::GetSharedRegionalCertificateAuthorityRequest, ::Hash]
863
+ # A request object representing the call parameters. Required. To specify no
864
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
865
+ # @param options [::Gapic::CallOptions, ::Hash]
866
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
867
+ #
868
+ # @overload get_shared_regional_certificate_authority(name: nil)
869
+ # Pass arguments to `get_shared_regional_certificate_authority` via keyword arguments. Note that at
870
+ # least one keyword argument is required. To specify no parameters, or to keep all
871
+ # the default parameter values, pass an empty Hash as a request object (see above).
872
+ #
873
+ # @param name [::String]
874
+ # Required. Regional certificate authority resource name using the form:
875
+ # `projects/{project}/locations/{location}/sharedRegionalCertificateAuthority`
876
+ # where `location_id` refers to a Google Cloud region.
877
+ #
878
+ # @yield [response, operation] Access the result along with the RPC operation
879
+ # @yieldparam response [::Google::Cloud::Memorystore::V1beta::SharedRegionalCertificateAuthority]
880
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
881
+ #
882
+ # @return [::Google::Cloud::Memorystore::V1beta::SharedRegionalCertificateAuthority]
883
+ #
884
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
885
+ #
886
+ # @example Basic example
887
+ # require "google/cloud/memorystore/v1beta"
888
+ #
889
+ # # Create a client object. The client can be reused for multiple calls.
890
+ # client = Google::Cloud::Memorystore::V1beta::Memorystore::Client.new
891
+ #
892
+ # # Create a request. To set request fields, pass in keyword arguments.
893
+ # request = Google::Cloud::Memorystore::V1beta::GetSharedRegionalCertificateAuthorityRequest.new
894
+ #
895
+ # # Call the get_shared_regional_certificate_authority method.
896
+ # result = client.get_shared_regional_certificate_authority request
897
+ #
898
+ # # The returned object is of type Google::Cloud::Memorystore::V1beta::SharedRegionalCertificateAuthority.
899
+ # p result
900
+ #
901
+ def get_shared_regional_certificate_authority request, options = nil
902
+ raise ::ArgumentError, "request must be provided" if request.nil?
903
+
904
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memorystore::V1beta::GetSharedRegionalCertificateAuthorityRequest
905
+
906
+ # Converts hash and nil to an options object
907
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
908
+
909
+ # Customize the options with defaults
910
+ metadata = @config.rpcs.get_shared_regional_certificate_authority.metadata.to_h
911
+
912
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
913
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
914
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
915
+ gapic_version: ::Google::Cloud::Memorystore::V1beta::VERSION
916
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
917
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
918
+
919
+ header_params = {}
920
+ if request.name
921
+ header_params["name"] = request.name
922
+ end
923
+
924
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
925
+ metadata[:"x-goog-request-params"] ||= request_params_header
926
+
927
+ options.apply_defaults timeout: @config.rpcs.get_shared_regional_certificate_authority.timeout,
928
+ metadata: metadata,
929
+ retry_policy: @config.rpcs.get_shared_regional_certificate_authority.retry_policy
930
+
931
+ options.apply_defaults timeout: @config.timeout,
932
+ metadata: @config.metadata,
933
+ retry_policy: @config.retry_policy
934
+
935
+ @memorystore_stub.call_rpc :get_shared_regional_certificate_authority, request, options: options do |response, operation|
936
+ yield response, operation if block_given?
937
+ end
938
+ rescue ::GRPC::BadStatus => e
939
+ raise ::Google::Cloud::Error.from_error(e)
940
+ end
941
+
942
+ ##
943
+ # Configuration class for the Memorystore API.
944
+ #
945
+ # This class represents the configuration for Memorystore,
946
+ # providing control over timeouts, retry behavior, logging, transport
947
+ # parameters, and other low-level controls. Certain parameters can also be
948
+ # applied individually to specific RPCs. See
949
+ # {::Google::Cloud::Memorystore::V1beta::Memorystore::Client::Configuration::Rpcs}
950
+ # for a list of RPCs that can be configured independently.
951
+ #
952
+ # Configuration can be applied globally to all clients, or to a single client
953
+ # on construction.
954
+ #
955
+ # @example
956
+ #
957
+ # # Modify the global config, setting the timeout for
958
+ # # list_instances to 20 seconds,
959
+ # # and all remaining timeouts to 10 seconds.
960
+ # ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.configure do |config|
961
+ # config.timeout = 10.0
962
+ # config.rpcs.list_instances.timeout = 20.0
963
+ # end
964
+ #
965
+ # # Apply the above configuration only to a new client.
966
+ # client = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config|
967
+ # config.timeout = 10.0
968
+ # config.rpcs.list_instances.timeout = 20.0
969
+ # end
970
+ #
971
+ # @!attribute [rw] endpoint
972
+ # A custom service endpoint, as a hostname or hostname:port. The default is
973
+ # nil, indicating to use the default endpoint in the current universe domain.
974
+ # @return [::String,nil]
975
+ # @!attribute [rw] credentials
976
+ # Credentials to send with calls. You may provide any of the following types:
977
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
978
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
979
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
980
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
981
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
982
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
983
+ # * (`nil`) indicating no credentials
984
+ #
985
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
986
+ # is deprecated. Providing an unvalidated credential configuration to
987
+ # Google APIs can compromise the security of your systems and data.
988
+ #
989
+ # @example
990
+ #
991
+ # # The recommended way to provide credentials is to use the `make_creds` method
992
+ # # on the appropriate credentials class for your environment.
993
+ #
994
+ # require "googleauth"
995
+ #
996
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
997
+ # json_key_io: ::File.open("/path/to/keyfile.json")
998
+ # )
999
+ #
1000
+ # client = ::Google::Cloud::Memorystore::V1beta::Memorystore::Client.new do |config|
1001
+ # config.credentials = credentials
1002
+ # end
1003
+ #
1004
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
1005
+ # external source for authentication to Google Cloud, you must validate it before
1006
+ # providing it to a Google API client library. Providing an unvalidated credential
1007
+ # configuration to Google APIs can compromise the security of your systems and data.
1008
+ # For more information, refer to [Validate credential configurations from external
1009
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1010
+ # @return [::Object]
1011
+ # @!attribute [rw] scope
1012
+ # The OAuth scopes
1013
+ # @return [::Array<::String>]
1014
+ # @!attribute [rw] lib_name
1015
+ # The library name as recorded in instrumentation and logging
1016
+ # @return [::String]
1017
+ # @!attribute [rw] lib_version
1018
+ # The library version as recorded in instrumentation and logging
1019
+ # @return [::String]
1020
+ # @!attribute [rw] channel_args
1021
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1022
+ # `GRPC::Core::Channel` object is provided as the credential.
1023
+ # @return [::Hash]
1024
+ # @!attribute [rw] interceptors
1025
+ # An array of interceptors that are run before calls are executed.
1026
+ # @return [::Array<::GRPC::ClientInterceptor>]
1027
+ # @!attribute [rw] timeout
1028
+ # The call timeout in seconds.
1029
+ # @return [::Numeric]
1030
+ # @!attribute [rw] metadata
1031
+ # Additional gRPC headers to be sent with the call.
1032
+ # @return [::Hash{::Symbol=>::String}]
1033
+ # @!attribute [rw] retry_policy
1034
+ # The retry policy. The value is a hash with the following keys:
1035
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1036
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1037
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1038
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1039
+ # trigger a retry.
1040
+ # @return [::Hash]
1041
+ # @!attribute [rw] quota_project
1042
+ # A separate project against which to charge quota.
1043
+ # @return [::String]
1044
+ # @!attribute [rw] universe_domain
1045
+ # The universe domain within which to make requests. This determines the
1046
+ # default endpoint URL. The default value of nil uses the environment
1047
+ # universe (usually the default "googleapis.com" universe).
1048
+ # @return [::String,nil]
1049
+ # @!attribute [rw] logger
1050
+ # A custom logger to use for request/response debug logging, or the value
1051
+ # `:default` (the default) to construct a default logger, or `nil` to
1052
+ # explicitly disable logging.
1053
+ # @return [::Logger,:default,nil]
1054
+ #
1055
+ class Configuration
1056
+ extend ::Gapic::Config
1057
+
1058
+ # @private
1059
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1060
+ DEFAULT_ENDPOINT = "memorystore.googleapis.com"
1061
+
1062
+ config_attr :endpoint, nil, ::String, nil
1063
+ config_attr :credentials, nil do |value|
1064
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1065
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
1066
+ allowed.any? { |klass| klass === value }
1067
+ end
1068
+ config_attr :scope, nil, ::String, ::Array, nil
1069
+ config_attr :lib_name, nil, ::String, nil
1070
+ config_attr :lib_version, nil, ::String, nil
1071
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1072
+ config_attr :interceptors, nil, ::Array, nil
1073
+ config_attr :timeout, nil, ::Numeric, nil
1074
+ config_attr :metadata, nil, ::Hash, nil
1075
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1076
+ config_attr :quota_project, nil, ::String, nil
1077
+ config_attr :universe_domain, nil, ::String, nil
1078
+ config_attr :logger, :default, ::Logger, nil, :default
1079
+
1080
+ # @private
1081
+ def initialize parent_config = nil
1082
+ @parent_config = parent_config unless parent_config.nil?
1083
+
1084
+ yield self if block_given?
1085
+ end
1086
+
1087
+ ##
1088
+ # Configurations for individual RPCs
1089
+ # @return [Rpcs]
1090
+ #
1091
+ def rpcs
1092
+ @rpcs ||= begin
1093
+ parent_rpcs = nil
1094
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1095
+ Rpcs.new parent_rpcs
1096
+ end
1097
+ end
1098
+
1099
+ ##
1100
+ # Configuration for the channel pool
1101
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1102
+ #
1103
+ def channel_pool
1104
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1105
+ end
1106
+
1107
+ ##
1108
+ # Configuration RPC class for the Memorystore API.
1109
+ #
1110
+ # Includes fields providing the configuration for each RPC in this service.
1111
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1112
+ # the following configuration fields:
1113
+ #
1114
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1115
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1116
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1117
+ # include the following keys:
1118
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1119
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1120
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1121
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1122
+ # trigger a retry.
1123
+ #
1124
+ class Rpcs
1125
+ ##
1126
+ # RPC-specific configuration for `list_instances`
1127
+ # @return [::Gapic::Config::Method]
1128
+ #
1129
+ attr_reader :list_instances
1130
+ ##
1131
+ # RPC-specific configuration for `get_instance`
1132
+ # @return [::Gapic::Config::Method]
1133
+ #
1134
+ attr_reader :get_instance
1135
+ ##
1136
+ # RPC-specific configuration for `create_instance`
1137
+ # @return [::Gapic::Config::Method]
1138
+ #
1139
+ attr_reader :create_instance
1140
+ ##
1141
+ # RPC-specific configuration for `update_instance`
1142
+ # @return [::Gapic::Config::Method]
1143
+ #
1144
+ attr_reader :update_instance
1145
+ ##
1146
+ # RPC-specific configuration for `delete_instance`
1147
+ # @return [::Gapic::Config::Method]
1148
+ #
1149
+ attr_reader :delete_instance
1150
+ ##
1151
+ # RPC-specific configuration for `get_certificate_authority`
1152
+ # @return [::Gapic::Config::Method]
1153
+ #
1154
+ attr_reader :get_certificate_authority
1155
+ ##
1156
+ # RPC-specific configuration for `get_shared_regional_certificate_authority`
1157
+ # @return [::Gapic::Config::Method]
1158
+ #
1159
+ attr_reader :get_shared_regional_certificate_authority
1160
+
1161
+ # @private
1162
+ def initialize parent_rpcs = nil
1163
+ list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
1164
+ @list_instances = ::Gapic::Config::Method.new list_instances_config
1165
+ get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
1166
+ @get_instance = ::Gapic::Config::Method.new get_instance_config
1167
+ create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
1168
+ @create_instance = ::Gapic::Config::Method.new create_instance_config
1169
+ update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance
1170
+ @update_instance = ::Gapic::Config::Method.new update_instance_config
1171
+ delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
1172
+ @delete_instance = ::Gapic::Config::Method.new delete_instance_config
1173
+ get_certificate_authority_config = parent_rpcs.get_certificate_authority if parent_rpcs.respond_to? :get_certificate_authority
1174
+ @get_certificate_authority = ::Gapic::Config::Method.new get_certificate_authority_config
1175
+ get_shared_regional_certificate_authority_config = parent_rpcs.get_shared_regional_certificate_authority if parent_rpcs.respond_to? :get_shared_regional_certificate_authority
1176
+ @get_shared_regional_certificate_authority = ::Gapic::Config::Method.new get_shared_regional_certificate_authority_config
1177
+
1178
+ yield self if block_given?
1179
+ end
1180
+ end
1181
+ end
1182
+ end
1183
+ end
1184
+ end
1185
+ end
1186
+ end
1187
+ end