google-cloud-redis-v1 0.5.3 → 0.7.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.
@@ -82,6 +82,8 @@ module Google
82
82
 
83
83
  default_config.rpcs.get_instance.timeout = 600.0
84
84
 
85
+ default_config.rpcs.get_instance_auth_string.timeout = 600.0
86
+
85
87
  default_config.rpcs.create_instance.timeout = 600.0
86
88
 
87
89
  default_config.rpcs.update_instance.timeout = 600.0
@@ -96,6 +98,8 @@ module Google
96
98
 
97
99
  default_config.rpcs.delete_instance.timeout = 600.0
98
100
 
101
+ default_config.rpcs.reschedule_maintenance.timeout = 600.0
102
+
99
103
  default_config
100
104
  end
101
105
  yield @configure if block_given?
@@ -167,6 +171,7 @@ module Google
167
171
 
168
172
  @operations_client = Operations.new do |config|
169
173
  config.credentials = credentials
174
+ config.quota_project = @quota_project_id
170
175
  config.endpoint = @config.endpoint
171
176
  end
172
177
 
@@ -238,6 +243,27 @@ module Google
238
243
  #
239
244
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
240
245
  #
246
+ # @example Basic example
247
+ # require "google/cloud/redis/v1"
248
+ #
249
+ # # Create a client object. The client can be reused for multiple calls.
250
+ # client = Google::Cloud::Redis::V1::CloudRedis::Client.new
251
+ #
252
+ # # Create a request. To set request fields, pass in keyword arguments.
253
+ # request = Google::Cloud::Redis::V1::ListInstancesRequest.new
254
+ #
255
+ # # Call the list_instances method.
256
+ # result = client.list_instances request
257
+ #
258
+ # # The returned object is of type Gapic::PagedEnumerable. You can
259
+ # # iterate over all elements by calling #each, and the enumerable
260
+ # # will lazily make API calls to fetch subsequent pages. Other
261
+ # # methods are also available for managing paging directly.
262
+ # result.each do |response|
263
+ # # Each element is of type ::Google::Cloud::Redis::V1::Instance.
264
+ # p response
265
+ # end
266
+ #
241
267
  def list_instances request, options = nil
242
268
  raise ::ArgumentError, "request must be provided" if request.nil?
243
269
 
@@ -255,9 +281,11 @@ module Google
255
281
  gapic_version: ::Google::Cloud::Redis::V1::VERSION
256
282
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
257
283
 
258
- header_params = {
259
- "parent" => request.parent
260
- }
284
+ header_params = {}
285
+ if request.parent
286
+ header_params["parent"] = request.parent
287
+ end
288
+
261
289
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
262
290
  metadata[:"x-goog-request-params"] ||= request_params_header
263
291
 
@@ -309,6 +337,21 @@ module Google
309
337
  #
310
338
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
311
339
  #
340
+ # @example Basic example
341
+ # require "google/cloud/redis/v1"
342
+ #
343
+ # # Create a client object. The client can be reused for multiple calls.
344
+ # client = Google::Cloud::Redis::V1::CloudRedis::Client.new
345
+ #
346
+ # # Create a request. To set request fields, pass in keyword arguments.
347
+ # request = Google::Cloud::Redis::V1::GetInstanceRequest.new
348
+ #
349
+ # # Call the get_instance method.
350
+ # result = client.get_instance request
351
+ #
352
+ # # The returned object is of type Google::Cloud::Redis::V1::Instance.
353
+ # p result
354
+ #
312
355
  def get_instance request, options = nil
313
356
  raise ::ArgumentError, "request must be provided" if request.nil?
314
357
 
@@ -326,9 +369,11 @@ module Google
326
369
  gapic_version: ::Google::Cloud::Redis::V1::VERSION
327
370
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
328
371
 
329
- header_params = {
330
- "name" => request.name
331
- }
372
+ header_params = {}
373
+ if request.name
374
+ header_params["name"] = request.name
375
+ end
376
+
332
377
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
333
378
  metadata[:"x-goog-request-params"] ||= request_params_header
334
379
 
@@ -348,6 +393,95 @@ module Google
348
393
  raise ::Google::Cloud::Error.from_error(e)
349
394
  end
350
395
 
396
+ ##
397
+ # Gets the AUTH string for a Redis instance. If AUTH is not enabled for the
398
+ # instance the response will be empty. This information is not included in
399
+ # the details returned to GetInstance.
400
+ #
401
+ # @overload get_instance_auth_string(request, options = nil)
402
+ # Pass arguments to `get_instance_auth_string` via a request object, either of type
403
+ # {::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest} or an equivalent Hash.
404
+ #
405
+ # @param request [::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest, ::Hash]
406
+ # A request object representing the call parameters. Required. To specify no
407
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
408
+ # @param options [::Gapic::CallOptions, ::Hash]
409
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
410
+ #
411
+ # @overload get_instance_auth_string(name: nil)
412
+ # Pass arguments to `get_instance_auth_string` via keyword arguments. Note that at
413
+ # least one keyword argument is required. To specify no parameters, or to keep all
414
+ # the default parameter values, pass an empty Hash as a request object (see above).
415
+ #
416
+ # @param name [::String]
417
+ # Required. Redis instance resource name using the form:
418
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
419
+ # where `location_id` refers to a GCP region.
420
+ #
421
+ # @yield [response, operation] Access the result along with the RPC operation
422
+ # @yieldparam response [::Google::Cloud::Redis::V1::InstanceAuthString]
423
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
424
+ #
425
+ # @return [::Google::Cloud::Redis::V1::InstanceAuthString]
426
+ #
427
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
428
+ #
429
+ # @example Basic example
430
+ # require "google/cloud/redis/v1"
431
+ #
432
+ # # Create a client object. The client can be reused for multiple calls.
433
+ # client = Google::Cloud::Redis::V1::CloudRedis::Client.new
434
+ #
435
+ # # Create a request. To set request fields, pass in keyword arguments.
436
+ # request = Google::Cloud::Redis::V1::GetInstanceAuthStringRequest.new
437
+ #
438
+ # # Call the get_instance_auth_string method.
439
+ # result = client.get_instance_auth_string request
440
+ #
441
+ # # The returned object is of type Google::Cloud::Redis::V1::InstanceAuthString.
442
+ # p result
443
+ #
444
+ def get_instance_auth_string request, options = nil
445
+ raise ::ArgumentError, "request must be provided" if request.nil?
446
+
447
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::GetInstanceAuthStringRequest
448
+
449
+ # Converts hash and nil to an options object
450
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
451
+
452
+ # Customize the options with defaults
453
+ metadata = @config.rpcs.get_instance_auth_string.metadata.to_h
454
+
455
+ # Set x-goog-api-client and x-goog-user-project headers
456
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
457
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
458
+ gapic_version: ::Google::Cloud::Redis::V1::VERSION
459
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
460
+
461
+ header_params = {}
462
+ if request.name
463
+ header_params["name"] = request.name
464
+ end
465
+
466
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
467
+ metadata[:"x-goog-request-params"] ||= request_params_header
468
+
469
+ options.apply_defaults timeout: @config.rpcs.get_instance_auth_string.timeout,
470
+ metadata: metadata,
471
+ retry_policy: @config.rpcs.get_instance_auth_string.retry_policy
472
+
473
+ options.apply_defaults timeout: @config.timeout,
474
+ metadata: @config.metadata,
475
+ retry_policy: @config.retry_policy
476
+
477
+ @cloud_redis_stub.call_rpc :get_instance_auth_string, request, options: options do |response, operation|
478
+ yield response, operation if block_given?
479
+ return response
480
+ end
481
+ rescue ::GRPC::BadStatus => e
482
+ raise ::Google::Cloud::Error.from_error(e)
483
+ end
484
+
351
485
  ##
352
486
  # Creates a Redis instance based on the specified tier and memory size.
353
487
  #
@@ -401,6 +535,28 @@ module Google
401
535
  #
402
536
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
403
537
  #
538
+ # @example Basic example
539
+ # require "google/cloud/redis/v1"
540
+ #
541
+ # # Create a client object. The client can be reused for multiple calls.
542
+ # client = Google::Cloud::Redis::V1::CloudRedis::Client.new
543
+ #
544
+ # # Create a request. To set request fields, pass in keyword arguments.
545
+ # request = Google::Cloud::Redis::V1::CreateInstanceRequest.new
546
+ #
547
+ # # Call the create_instance method.
548
+ # result = client.create_instance request
549
+ #
550
+ # # The returned object is of type Gapic::Operation. You can use this
551
+ # # object to check the status of an operation, cancel it, or wait
552
+ # # for results. Here is how to block until completion:
553
+ # result.wait_until_done! timeout: 60
554
+ # if result.response?
555
+ # p result.response
556
+ # else
557
+ # puts "Error!"
558
+ # end
559
+ #
404
560
  def create_instance request, options = nil
405
561
  raise ::ArgumentError, "request must be provided" if request.nil?
406
562
 
@@ -418,9 +574,11 @@ module Google
418
574
  gapic_version: ::Google::Cloud::Redis::V1::VERSION
419
575
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
420
576
 
421
- header_params = {
422
- "parent" => request.parent
423
- }
577
+ header_params = {}
578
+ if request.parent
579
+ header_params["parent"] = request.parent
580
+ end
581
+
424
582
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
425
583
  metadata[:"x-goog-request-params"] ||= request_params_header
426
584
 
@@ -472,6 +630,7 @@ module Google
472
630
  # * `labels`
473
631
  # * `memorySizeGb`
474
632
  # * `redisConfig`
633
+ # * `replica_count`
475
634
  # @param instance [::Google::Cloud::Redis::V1::Instance, ::Hash]
476
635
  # Required. Update description.
477
636
  # Only fields specified in update_mask are updated.
@@ -484,6 +643,28 @@ module Google
484
643
  #
485
644
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
486
645
  #
646
+ # @example Basic example
647
+ # require "google/cloud/redis/v1"
648
+ #
649
+ # # Create a client object. The client can be reused for multiple calls.
650
+ # client = Google::Cloud::Redis::V1::CloudRedis::Client.new
651
+ #
652
+ # # Create a request. To set request fields, pass in keyword arguments.
653
+ # request = Google::Cloud::Redis::V1::UpdateInstanceRequest.new
654
+ #
655
+ # # Call the update_instance method.
656
+ # result = client.update_instance request
657
+ #
658
+ # # The returned object is of type Gapic::Operation. You can use this
659
+ # # object to check the status of an operation, cancel it, or wait
660
+ # # for results. Here is how to block until completion:
661
+ # result.wait_until_done! timeout: 60
662
+ # if result.response?
663
+ # p result.response
664
+ # else
665
+ # puts "Error!"
666
+ # end
667
+ #
487
668
  def update_instance request, options = nil
488
669
  raise ::ArgumentError, "request must be provided" if request.nil?
489
670
 
@@ -501,9 +682,11 @@ module Google
501
682
  gapic_version: ::Google::Cloud::Redis::V1::VERSION
502
683
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
503
684
 
504
- header_params = {
505
- "instance.name" => request.instance.name
506
- }
685
+ header_params = {}
686
+ if request.instance&.name
687
+ header_params["instance.name"] = request.instance.name
688
+ end
689
+
507
690
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
508
691
  metadata[:"x-goog-request-params"] ||= request_params_header
509
692
 
@@ -558,6 +741,28 @@ module Google
558
741
  #
559
742
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
560
743
  #
744
+ # @example Basic example
745
+ # require "google/cloud/redis/v1"
746
+ #
747
+ # # Create a client object. The client can be reused for multiple calls.
748
+ # client = Google::Cloud::Redis::V1::CloudRedis::Client.new
749
+ #
750
+ # # Create a request. To set request fields, pass in keyword arguments.
751
+ # request = Google::Cloud::Redis::V1::UpgradeInstanceRequest.new
752
+ #
753
+ # # Call the upgrade_instance method.
754
+ # result = client.upgrade_instance request
755
+ #
756
+ # # The returned object is of type Gapic::Operation. You can use this
757
+ # # object to check the status of an operation, cancel it, or wait
758
+ # # for results. Here is how to block until completion:
759
+ # result.wait_until_done! timeout: 60
760
+ # if result.response?
761
+ # p result.response
762
+ # else
763
+ # puts "Error!"
764
+ # end
765
+ #
561
766
  def upgrade_instance request, options = nil
562
767
  raise ::ArgumentError, "request must be provided" if request.nil?
563
768
 
@@ -575,9 +780,11 @@ module Google
575
780
  gapic_version: ::Google::Cloud::Redis::V1::VERSION
576
781
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
577
782
 
578
- header_params = {
579
- "name" => request.name
580
- }
783
+ header_params = {}
784
+ if request.name
785
+ header_params["name"] = request.name
786
+ end
787
+
581
788
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
582
789
  metadata[:"x-goog-request-params"] ||= request_params_header
583
790
 
@@ -638,6 +845,28 @@ module Google
638
845
  #
639
846
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
640
847
  #
848
+ # @example Basic example
849
+ # require "google/cloud/redis/v1"
850
+ #
851
+ # # Create a client object. The client can be reused for multiple calls.
852
+ # client = Google::Cloud::Redis::V1::CloudRedis::Client.new
853
+ #
854
+ # # Create a request. To set request fields, pass in keyword arguments.
855
+ # request = Google::Cloud::Redis::V1::ImportInstanceRequest.new
856
+ #
857
+ # # Call the import_instance method.
858
+ # result = client.import_instance request
859
+ #
860
+ # # The returned object is of type Gapic::Operation. You can use this
861
+ # # object to check the status of an operation, cancel it, or wait
862
+ # # for results. Here is how to block until completion:
863
+ # result.wait_until_done! timeout: 60
864
+ # if result.response?
865
+ # p result.response
866
+ # else
867
+ # puts "Error!"
868
+ # end
869
+ #
641
870
  def import_instance request, options = nil
642
871
  raise ::ArgumentError, "request must be provided" if request.nil?
643
872
 
@@ -655,9 +884,11 @@ module Google
655
884
  gapic_version: ::Google::Cloud::Redis::V1::VERSION
656
885
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
657
886
 
658
- header_params = {
659
- "name" => request.name
660
- }
887
+ header_params = {}
888
+ if request.name
889
+ header_params["name"] = request.name
890
+ end
891
+
661
892
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
662
893
  metadata[:"x-goog-request-params"] ||= request_params_header
663
894
 
@@ -716,6 +947,28 @@ module Google
716
947
  #
717
948
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
718
949
  #
950
+ # @example Basic example
951
+ # require "google/cloud/redis/v1"
952
+ #
953
+ # # Create a client object. The client can be reused for multiple calls.
954
+ # client = Google::Cloud::Redis::V1::CloudRedis::Client.new
955
+ #
956
+ # # Create a request. To set request fields, pass in keyword arguments.
957
+ # request = Google::Cloud::Redis::V1::ExportInstanceRequest.new
958
+ #
959
+ # # Call the export_instance method.
960
+ # result = client.export_instance request
961
+ #
962
+ # # The returned object is of type Gapic::Operation. You can use this
963
+ # # object to check the status of an operation, cancel it, or wait
964
+ # # for results. Here is how to block until completion:
965
+ # result.wait_until_done! timeout: 60
966
+ # if result.response?
967
+ # p result.response
968
+ # else
969
+ # puts "Error!"
970
+ # end
971
+ #
719
972
  def export_instance request, options = nil
720
973
  raise ::ArgumentError, "request must be provided" if request.nil?
721
974
 
@@ -733,9 +986,11 @@ module Google
733
986
  gapic_version: ::Google::Cloud::Redis::V1::VERSION
734
987
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
735
988
 
736
- header_params = {
737
- "name" => request.name
738
- }
989
+ header_params = {}
990
+ if request.name
991
+ header_params["name"] = request.name
992
+ end
993
+
739
994
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
740
995
  metadata[:"x-goog-request-params"] ||= request_params_header
741
996
 
@@ -757,7 +1012,7 @@ module Google
757
1012
  end
758
1013
 
759
1014
  ##
760
- # Initiates a failover of the master node to current replica node for a
1015
+ # Initiates a failover of the primary node to current replica node for a
761
1016
  # specific STANDARD tier Cloud Memorystore for Redis instance.
762
1017
  #
763
1018
  # @overload failover_instance(request, options = nil)
@@ -791,6 +1046,28 @@ module Google
791
1046
  #
792
1047
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
793
1048
  #
1049
+ # @example Basic example
1050
+ # require "google/cloud/redis/v1"
1051
+ #
1052
+ # # Create a client object. The client can be reused for multiple calls.
1053
+ # client = Google::Cloud::Redis::V1::CloudRedis::Client.new
1054
+ #
1055
+ # # Create a request. To set request fields, pass in keyword arguments.
1056
+ # request = Google::Cloud::Redis::V1::FailoverInstanceRequest.new
1057
+ #
1058
+ # # Call the failover_instance method.
1059
+ # result = client.failover_instance request
1060
+ #
1061
+ # # The returned object is of type Gapic::Operation. You can use this
1062
+ # # object to check the status of an operation, cancel it, or wait
1063
+ # # for results. Here is how to block until completion:
1064
+ # result.wait_until_done! timeout: 60
1065
+ # if result.response?
1066
+ # p result.response
1067
+ # else
1068
+ # puts "Error!"
1069
+ # end
1070
+ #
794
1071
  def failover_instance request, options = nil
795
1072
  raise ::ArgumentError, "request must be provided" if request.nil?
796
1073
 
@@ -808,9 +1085,11 @@ module Google
808
1085
  gapic_version: ::Google::Cloud::Redis::V1::VERSION
809
1086
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
810
1087
 
811
- header_params = {
812
- "name" => request.name
813
- }
1088
+ header_params = {}
1089
+ if request.name
1090
+ header_params["name"] = request.name
1091
+ end
1092
+
814
1093
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
815
1094
  metadata[:"x-goog-request-params"] ||= request_params_header
816
1095
 
@@ -863,6 +1142,28 @@ module Google
863
1142
  #
864
1143
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
865
1144
  #
1145
+ # @example Basic example
1146
+ # require "google/cloud/redis/v1"
1147
+ #
1148
+ # # Create a client object. The client can be reused for multiple calls.
1149
+ # client = Google::Cloud::Redis::V1::CloudRedis::Client.new
1150
+ #
1151
+ # # Create a request. To set request fields, pass in keyword arguments.
1152
+ # request = Google::Cloud::Redis::V1::DeleteInstanceRequest.new
1153
+ #
1154
+ # # Call the delete_instance method.
1155
+ # result = client.delete_instance request
1156
+ #
1157
+ # # The returned object is of type Gapic::Operation. You can use this
1158
+ # # object to check the status of an operation, cancel it, or wait
1159
+ # # for results. Here is how to block until completion:
1160
+ # result.wait_until_done! timeout: 60
1161
+ # if result.response?
1162
+ # p result.response
1163
+ # else
1164
+ # puts "Error!"
1165
+ # end
1166
+ #
866
1167
  def delete_instance request, options = nil
867
1168
  raise ::ArgumentError, "request must be provided" if request.nil?
868
1169
 
@@ -880,9 +1181,11 @@ module Google
880
1181
  gapic_version: ::Google::Cloud::Redis::V1::VERSION
881
1182
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
882
1183
 
883
- header_params = {
884
- "name" => request.name
885
- }
1184
+ header_params = {}
1185
+ if request.name
1186
+ header_params["name"] = request.name
1187
+ end
1188
+
886
1189
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
887
1190
  metadata[:"x-goog-request-params"] ||= request_params_header
888
1191
 
@@ -903,6 +1206,108 @@ module Google
903
1206
  raise ::Google::Cloud::Error.from_error(e)
904
1207
  end
905
1208
 
1209
+ ##
1210
+ # Reschedule maintenance for a given instance in a given project and
1211
+ # location.
1212
+ #
1213
+ # @overload reschedule_maintenance(request, options = nil)
1214
+ # Pass arguments to `reschedule_maintenance` via a request object, either of type
1215
+ # {::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest} or an equivalent Hash.
1216
+ #
1217
+ # @param request [::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest, ::Hash]
1218
+ # A request object representing the call parameters. Required. To specify no
1219
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1220
+ # @param options [::Gapic::CallOptions, ::Hash]
1221
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1222
+ #
1223
+ # @overload reschedule_maintenance(name: nil, reschedule_type: nil, schedule_time: nil)
1224
+ # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at
1225
+ # least one keyword argument is required. To specify no parameters, or to keep all
1226
+ # the default parameter values, pass an empty Hash as a request object (see above).
1227
+ #
1228
+ # @param name [::String]
1229
+ # Required. Redis instance resource name using the form:
1230
+ # `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
1231
+ # where `location_id` refers to a GCP region.
1232
+ # @param reschedule_type [::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest::RescheduleType]
1233
+ # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well.
1234
+ # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash]
1235
+ # Optional. Timestamp when the maintenance shall be rescheduled to if
1236
+ # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for
1237
+ # example `2012-11-15T16:19:00.094Z`.
1238
+ #
1239
+ # @yield [response, operation] Access the result along with the RPC operation
1240
+ # @yieldparam response [::Gapic::Operation]
1241
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1242
+ #
1243
+ # @return [::Gapic::Operation]
1244
+ #
1245
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1246
+ #
1247
+ # @example Basic example
1248
+ # require "google/cloud/redis/v1"
1249
+ #
1250
+ # # Create a client object. The client can be reused for multiple calls.
1251
+ # client = Google::Cloud::Redis::V1::CloudRedis::Client.new
1252
+ #
1253
+ # # Create a request. To set request fields, pass in keyword arguments.
1254
+ # request = Google::Cloud::Redis::V1::RescheduleMaintenanceRequest.new
1255
+ #
1256
+ # # Call the reschedule_maintenance method.
1257
+ # result = client.reschedule_maintenance request
1258
+ #
1259
+ # # The returned object is of type Gapic::Operation. You can use this
1260
+ # # object to check the status of an operation, cancel it, or wait
1261
+ # # for results. Here is how to block until completion:
1262
+ # result.wait_until_done! timeout: 60
1263
+ # if result.response?
1264
+ # p result.response
1265
+ # else
1266
+ # puts "Error!"
1267
+ # end
1268
+ #
1269
+ def reschedule_maintenance request, options = nil
1270
+ raise ::ArgumentError, "request must be provided" if request.nil?
1271
+
1272
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::V1::RescheduleMaintenanceRequest
1273
+
1274
+ # Converts hash and nil to an options object
1275
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1276
+
1277
+ # Customize the options with defaults
1278
+ metadata = @config.rpcs.reschedule_maintenance.metadata.to_h
1279
+
1280
+ # Set x-goog-api-client and x-goog-user-project headers
1281
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1282
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1283
+ gapic_version: ::Google::Cloud::Redis::V1::VERSION
1284
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1285
+
1286
+ header_params = {}
1287
+ if request.name
1288
+ header_params["name"] = request.name
1289
+ end
1290
+
1291
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1292
+ metadata[:"x-goog-request-params"] ||= request_params_header
1293
+
1294
+ options.apply_defaults timeout: @config.rpcs.reschedule_maintenance.timeout,
1295
+ metadata: metadata,
1296
+ retry_policy: @config.rpcs.reschedule_maintenance.retry_policy
1297
+
1298
+ options.apply_defaults timeout: @config.timeout,
1299
+ metadata: @config.metadata,
1300
+ retry_policy: @config.retry_policy
1301
+
1302
+ @cloud_redis_stub.call_rpc :reschedule_maintenance, request, options: options do |response, operation|
1303
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1304
+ yield response, operation if block_given?
1305
+ return response
1306
+ end
1307
+ rescue ::GRPC::BadStatus => e
1308
+ raise ::Google::Cloud::Error.from_error(e)
1309
+ end
1310
+
906
1311
  ##
907
1312
  # Configuration class for the CloudRedis API.
908
1313
  #
@@ -1049,6 +1454,11 @@ module Google
1049
1454
  #
1050
1455
  attr_reader :get_instance
1051
1456
  ##
1457
+ # RPC-specific configuration for `get_instance_auth_string`
1458
+ # @return [::Gapic::Config::Method]
1459
+ #
1460
+ attr_reader :get_instance_auth_string
1461
+ ##
1052
1462
  # RPC-specific configuration for `create_instance`
1053
1463
  # @return [::Gapic::Config::Method]
1054
1464
  #
@@ -1083,6 +1493,11 @@ module Google
1083
1493
  # @return [::Gapic::Config::Method]
1084
1494
  #
1085
1495
  attr_reader :delete_instance
1496
+ ##
1497
+ # RPC-specific configuration for `reschedule_maintenance`
1498
+ # @return [::Gapic::Config::Method]
1499
+ #
1500
+ attr_reader :reschedule_maintenance
1086
1501
 
1087
1502
  # @private
1088
1503
  def initialize parent_rpcs = nil
@@ -1090,6 +1505,8 @@ module Google
1090
1505
  @list_instances = ::Gapic::Config::Method.new list_instances_config
1091
1506
  get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
1092
1507
  @get_instance = ::Gapic::Config::Method.new get_instance_config
1508
+ get_instance_auth_string_config = parent_rpcs.get_instance_auth_string if parent_rpcs.respond_to? :get_instance_auth_string
1509
+ @get_instance_auth_string = ::Gapic::Config::Method.new get_instance_auth_string_config
1093
1510
  create_instance_config = parent_rpcs.create_instance if parent_rpcs.respond_to? :create_instance
1094
1511
  @create_instance = ::Gapic::Config::Method.new create_instance_config
1095
1512
  update_instance_config = parent_rpcs.update_instance if parent_rpcs.respond_to? :update_instance
@@ -1104,6 +1521,8 @@ module Google
1104
1521
  @failover_instance = ::Gapic::Config::Method.new failover_instance_config
1105
1522
  delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
1106
1523
  @delete_instance = ::Gapic::Config::Method.new delete_instance_config
1524
+ reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance
1525
+ @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config
1107
1526
 
1108
1527
  yield self if block_given?
1109
1528
  end