google-cloud-redis-v1beta1 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,7 +40,7 @@ module Google
40
40
  # * As such, Redis instances are resources of the form:
41
41
  # `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
42
42
  #
43
- # Note that location_id must be refering to a GCP `region`; for example:
43
+ # Note that location_id must be referring to a GCP `region`; for example:
44
44
  # * `projects/redpepper-1290/locations/us-central1/instances/my-redis`
45
45
  #
46
46
  class Client
@@ -55,13 +55,12 @@ module Google
55
55
  # See {::Google::Cloud::Redis::V1beta1::CloudRedis::Client::Configuration}
56
56
  # for a description of the configuration fields.
57
57
  #
58
- # ## Example
58
+ # @example
59
59
  #
60
- # To modify the configuration for all CloudRedis clients:
61
- #
62
- # ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.configure do |config|
63
- # config.timeout = 10.0
64
- # end
60
+ # # Modify the configuration for all CloudRedis clients
61
+ # ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.configure do |config|
62
+ # config.timeout = 10.0
63
+ # end
65
64
  #
66
65
  # @yield [config] Configure the Client client.
67
66
  # @yieldparam config [Client::Configuration]
@@ -126,19 +125,15 @@ module Google
126
125
  ##
127
126
  # Create a new CloudRedis client object.
128
127
  #
129
- # ## Examples
130
- #
131
- # To create a new CloudRedis client with the default
132
- # configuration:
133
- #
134
- # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
128
+ # @example
135
129
  #
136
- # To create a new CloudRedis client with a custom
137
- # configuration:
130
+ # # Create a client using the default configuration
131
+ # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
138
132
  #
139
- # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config|
140
- # config.timeout = 10.0
141
- # end
133
+ # # Create a client using a custom configuration
134
+ # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config|
135
+ # config.timeout = 10.0
136
+ # end
142
137
  #
143
138
  # @yield [config] Configure the CloudRedis client.
144
139
  # @yieldparam config [Client::Configuration]
@@ -158,14 +153,13 @@ module Google
158
153
 
159
154
  # Create credentials
160
155
  credentials = @config.credentials
161
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
156
+ # Use self-signed JWT if the endpoint is unchanged from default,
162
157
  # but only if the default endpoint does not have a region prefix.
163
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
164
- @config.endpoint == Client.configure.endpoint &&
158
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
165
159
  !@config.endpoint.split(".").first.include?("-")
166
160
  credentials ||= Credentials.default scope: @config.scope,
167
161
  enable_self_signed_jwt: enable_self_signed_jwt
168
- if credentials.is_a?(String) || credentials.is_a?(Hash)
162
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
169
163
  credentials = Credentials.new credentials, scope: @config.scope
170
164
  end
171
165
  @quota_project_id = @config.quota_project
@@ -234,7 +228,8 @@ module Google
234
228
  # to determine if there are more instances left to be queried.
235
229
  # @param page_token [::String]
236
230
  # The `next_page_token` value returned from a previous
237
- # {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances ListInstances} request, if any.
231
+ # {::Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances ListInstances}
232
+ # request, if any.
238
233
  #
239
234
  # @yield [response, operation] Access the result along with the RPC operation
240
235
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Redis::V1beta1::Instance>]
@@ -244,6 +239,27 @@ module Google
244
239
  #
245
240
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
246
241
  #
242
+ # @example Basic example
243
+ # require "google/cloud/redis/v1beta1"
244
+ #
245
+ # # Create a client object. The client can be reused for multiple calls.
246
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
247
+ #
248
+ # # Create a request. To set request fields, pass in keyword arguments.
249
+ # request = Google::Cloud::Redis::V1beta1::ListInstancesRequest.new
250
+ #
251
+ # # Call the list_instances method.
252
+ # result = client.list_instances request
253
+ #
254
+ # # The returned object is of type Gapic::PagedEnumerable. You can
255
+ # # iterate over all elements by calling #each, and the enumerable
256
+ # # will lazily make API calls to fetch subsequent pages. Other
257
+ # # methods are also available for managing paging directly.
258
+ # result.each do |response|
259
+ # # Each element is of type ::Google::Cloud::Redis::V1beta1::Instance.
260
+ # p response
261
+ # end
262
+ #
247
263
  def list_instances request, options = nil
248
264
  raise ::ArgumentError, "request must be provided" if request.nil?
249
265
 
@@ -261,16 +277,20 @@ module Google
261
277
  gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
262
278
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
263
279
 
264
- header_params = {
265
- "parent" => request.parent
266
- }
280
+ header_params = {}
281
+ if request.parent
282
+ header_params["parent"] = request.parent
283
+ end
284
+
267
285
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
268
286
  metadata[:"x-goog-request-params"] ||= request_params_header
269
287
 
270
288
  options.apply_defaults timeout: @config.rpcs.list_instances.timeout,
271
289
  metadata: metadata,
272
290
  retry_policy: @config.rpcs.list_instances.retry_policy
273
- options.apply_defaults metadata: @config.metadata,
291
+
292
+ options.apply_defaults timeout: @config.timeout,
293
+ metadata: @config.metadata,
274
294
  retry_policy: @config.retry_policy
275
295
 
276
296
  @cloud_redis_stub.call_rpc :list_instances, request, options: options do |response, operation|
@@ -313,6 +333,21 @@ module Google
313
333
  #
314
334
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
315
335
  #
336
+ # @example Basic example
337
+ # require "google/cloud/redis/v1beta1"
338
+ #
339
+ # # Create a client object. The client can be reused for multiple calls.
340
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
341
+ #
342
+ # # Create a request. To set request fields, pass in keyword arguments.
343
+ # request = Google::Cloud::Redis::V1beta1::GetInstanceRequest.new
344
+ #
345
+ # # Call the get_instance method.
346
+ # result = client.get_instance request
347
+ #
348
+ # # The returned object is of type Google::Cloud::Redis::V1beta1::Instance.
349
+ # p result
350
+ #
316
351
  def get_instance request, options = nil
317
352
  raise ::ArgumentError, "request must be provided" if request.nil?
318
353
 
@@ -330,16 +365,20 @@ module Google
330
365
  gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
331
366
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
332
367
 
333
- header_params = {
334
- "name" => request.name
335
- }
368
+ header_params = {}
369
+ if request.name
370
+ header_params["name"] = request.name
371
+ end
372
+
336
373
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
337
374
  metadata[:"x-goog-request-params"] ||= request_params_header
338
375
 
339
376
  options.apply_defaults timeout: @config.rpcs.get_instance.timeout,
340
377
  metadata: metadata,
341
378
  retry_policy: @config.rpcs.get_instance.retry_policy
342
- options.apply_defaults metadata: @config.metadata,
379
+
380
+ options.apply_defaults timeout: @config.timeout,
381
+ metadata: @config.metadata,
343
382
  retry_policy: @config.retry_policy
344
383
 
345
384
  @cloud_redis_stub.call_rpc :get_instance, request, options: options do |response, operation|
@@ -358,7 +397,7 @@ module Google
358
397
  #
359
398
  # The creation is executed asynchronously and callers may check the returned
360
399
  # operation to track its progress. Once the operation is completed the Redis
361
- # instance will be fully functional. Completed longrunning.Operation will
400
+ # instance will be fully functional. The completed longrunning.Operation will
362
401
  # contain the new instance object in the response field.
363
402
  #
364
403
  # The returned operation is automatically deleted after a few hours, so there
@@ -403,6 +442,28 @@ module Google
403
442
  #
404
443
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
405
444
  #
445
+ # @example Basic example
446
+ # require "google/cloud/redis/v1beta1"
447
+ #
448
+ # # Create a client object. The client can be reused for multiple calls.
449
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
450
+ #
451
+ # # Create a request. To set request fields, pass in keyword arguments.
452
+ # request = Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new
453
+ #
454
+ # # Call the create_instance method.
455
+ # result = client.create_instance request
456
+ #
457
+ # # The returned object is of type Gapic::Operation. You can use this
458
+ # # object to check the status of an operation, cancel it, or wait
459
+ # # for results. Here is how to block until completion:
460
+ # result.wait_until_done! timeout: 60
461
+ # if result.response?
462
+ # p result.response
463
+ # else
464
+ # puts "Error!"
465
+ # end
466
+ #
406
467
  def create_instance request, options = nil
407
468
  raise ::ArgumentError, "request must be provided" if request.nil?
408
469
 
@@ -420,16 +481,20 @@ module Google
420
481
  gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
421
482
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
422
483
 
423
- header_params = {
424
- "parent" => request.parent
425
- }
484
+ header_params = {}
485
+ if request.parent
486
+ header_params["parent"] = request.parent
487
+ end
488
+
426
489
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
427
490
  metadata[:"x-goog-request-params"] ||= request_params_header
428
491
 
429
492
  options.apply_defaults timeout: @config.rpcs.create_instance.timeout,
430
493
  metadata: metadata,
431
494
  retry_policy: @config.rpcs.create_instance.retry_policy
432
- options.apply_defaults metadata: @config.metadata,
495
+
496
+ options.apply_defaults timeout: @config.timeout,
497
+ metadata: @config.metadata,
433
498
  retry_policy: @config.retry_policy
434
499
 
435
500
  @cloud_redis_stub.call_rpc :create_instance, request, options: options do |response, operation|
@@ -472,6 +537,7 @@ module Google
472
537
  # * `labels`
473
538
  # * `memorySizeGb`
474
539
  # * `redisConfig`
540
+ # * `replica_count`
475
541
  # @param instance [::Google::Cloud::Redis::V1beta1::Instance, ::Hash]
476
542
  # Required. Update description.
477
543
  # Only fields specified in update_mask are updated.
@@ -484,6 +550,28 @@ module Google
484
550
  #
485
551
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
486
552
  #
553
+ # @example Basic example
554
+ # require "google/cloud/redis/v1beta1"
555
+ #
556
+ # # Create a client object. The client can be reused for multiple calls.
557
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
558
+ #
559
+ # # Create a request. To set request fields, pass in keyword arguments.
560
+ # request = Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new
561
+ #
562
+ # # Call the update_instance method.
563
+ # result = client.update_instance request
564
+ #
565
+ # # The returned object is of type Gapic::Operation. You can use this
566
+ # # object to check the status of an operation, cancel it, or wait
567
+ # # for results. Here is how to block until completion:
568
+ # result.wait_until_done! timeout: 60
569
+ # if result.response?
570
+ # p result.response
571
+ # else
572
+ # puts "Error!"
573
+ # end
574
+ #
487
575
  def update_instance request, options = nil
488
576
  raise ::ArgumentError, "request must be provided" if request.nil?
489
577
 
@@ -501,16 +589,20 @@ module Google
501
589
  gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
502
590
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
503
591
 
504
- header_params = {
505
- "instance.name" => request.instance.name
506
- }
592
+ header_params = {}
593
+ if request.instance&.name
594
+ header_params["instance.name"] = request.instance.name
595
+ end
596
+
507
597
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
508
598
  metadata[:"x-goog-request-params"] ||= request_params_header
509
599
 
510
600
  options.apply_defaults timeout: @config.rpcs.update_instance.timeout,
511
601
  metadata: metadata,
512
602
  retry_policy: @config.rpcs.update_instance.retry_policy
513
- options.apply_defaults metadata: @config.metadata,
603
+
604
+ options.apply_defaults timeout: @config.timeout,
605
+ metadata: @config.metadata,
514
606
  retry_policy: @config.retry_policy
515
607
 
516
608
  @cloud_redis_stub.call_rpc :update_instance, request, options: options do |response, operation|
@@ -556,6 +648,28 @@ module Google
556
648
  #
557
649
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
558
650
  #
651
+ # @example Basic example
652
+ # require "google/cloud/redis/v1beta1"
653
+ #
654
+ # # Create a client object. The client can be reused for multiple calls.
655
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
656
+ #
657
+ # # Create a request. To set request fields, pass in keyword arguments.
658
+ # request = Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new
659
+ #
660
+ # # Call the upgrade_instance method.
661
+ # result = client.upgrade_instance request
662
+ #
663
+ # # The returned object is of type Gapic::Operation. You can use this
664
+ # # object to check the status of an operation, cancel it, or wait
665
+ # # for results. Here is how to block until completion:
666
+ # result.wait_until_done! timeout: 60
667
+ # if result.response?
668
+ # p result.response
669
+ # else
670
+ # puts "Error!"
671
+ # end
672
+ #
559
673
  def upgrade_instance request, options = nil
560
674
  raise ::ArgumentError, "request must be provided" if request.nil?
561
675
 
@@ -573,16 +687,20 @@ module Google
573
687
  gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
574
688
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
575
689
 
576
- header_params = {
577
- "name" => request.name
578
- }
690
+ header_params = {}
691
+ if request.name
692
+ header_params["name"] = request.name
693
+ end
694
+
579
695
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
580
696
  metadata[:"x-goog-request-params"] ||= request_params_header
581
697
 
582
698
  options.apply_defaults timeout: @config.rpcs.upgrade_instance.timeout,
583
699
  metadata: metadata,
584
700
  retry_policy: @config.rpcs.upgrade_instance.retry_policy
585
- options.apply_defaults metadata: @config.metadata,
701
+
702
+ options.apply_defaults timeout: @config.timeout,
703
+ metadata: @config.metadata,
586
704
  retry_policy: @config.retry_policy
587
705
 
588
706
  @cloud_redis_stub.call_rpc :upgrade_instance, request, options: options do |response, operation|
@@ -634,6 +752,28 @@ module Google
634
752
  #
635
753
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
636
754
  #
755
+ # @example Basic example
756
+ # require "google/cloud/redis/v1beta1"
757
+ #
758
+ # # Create a client object. The client can be reused for multiple calls.
759
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
760
+ #
761
+ # # Create a request. To set request fields, pass in keyword arguments.
762
+ # request = Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new
763
+ #
764
+ # # Call the import_instance method.
765
+ # result = client.import_instance request
766
+ #
767
+ # # The returned object is of type Gapic::Operation. You can use this
768
+ # # object to check the status of an operation, cancel it, or wait
769
+ # # for results. Here is how to block until completion:
770
+ # result.wait_until_done! timeout: 60
771
+ # if result.response?
772
+ # p result.response
773
+ # else
774
+ # puts "Error!"
775
+ # end
776
+ #
637
777
  def import_instance request, options = nil
638
778
  raise ::ArgumentError, "request must be provided" if request.nil?
639
779
 
@@ -651,16 +791,20 @@ module Google
651
791
  gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
652
792
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
653
793
 
654
- header_params = {
655
- "name" => request.name
656
- }
794
+ header_params = {}
795
+ if request.name
796
+ header_params["name"] = request.name
797
+ end
798
+
657
799
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
658
800
  metadata[:"x-goog-request-params"] ||= request_params_header
659
801
 
660
802
  options.apply_defaults timeout: @config.rpcs.import_instance.timeout,
661
803
  metadata: metadata,
662
804
  retry_policy: @config.rpcs.import_instance.retry_policy
663
- options.apply_defaults metadata: @config.metadata,
805
+
806
+ options.apply_defaults timeout: @config.timeout,
807
+ metadata: @config.metadata,
664
808
  retry_policy: @config.retry_policy
665
809
 
666
810
  @cloud_redis_stub.call_rpc :import_instance, request, options: options do |response, operation|
@@ -710,6 +854,28 @@ module Google
710
854
  #
711
855
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
712
856
  #
857
+ # @example Basic example
858
+ # require "google/cloud/redis/v1beta1"
859
+ #
860
+ # # Create a client object. The client can be reused for multiple calls.
861
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
862
+ #
863
+ # # Create a request. To set request fields, pass in keyword arguments.
864
+ # request = Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new
865
+ #
866
+ # # Call the export_instance method.
867
+ # result = client.export_instance request
868
+ #
869
+ # # The returned object is of type Gapic::Operation. You can use this
870
+ # # object to check the status of an operation, cancel it, or wait
871
+ # # for results. Here is how to block until completion:
872
+ # result.wait_until_done! timeout: 60
873
+ # if result.response?
874
+ # p result.response
875
+ # else
876
+ # puts "Error!"
877
+ # end
878
+ #
713
879
  def export_instance request, options = nil
714
880
  raise ::ArgumentError, "request must be provided" if request.nil?
715
881
 
@@ -727,16 +893,20 @@ module Google
727
893
  gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
728
894
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
729
895
 
730
- header_params = {
731
- "name" => request.name
732
- }
896
+ header_params = {}
897
+ if request.name
898
+ header_params["name"] = request.name
899
+ end
900
+
733
901
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
734
902
  metadata[:"x-goog-request-params"] ||= request_params_header
735
903
 
736
904
  options.apply_defaults timeout: @config.rpcs.export_instance.timeout,
737
905
  metadata: metadata,
738
906
  retry_policy: @config.rpcs.export_instance.retry_policy
739
- options.apply_defaults metadata: @config.metadata,
907
+
908
+ options.apply_defaults timeout: @config.timeout,
909
+ metadata: @config.metadata,
740
910
  retry_policy: @config.retry_policy
741
911
 
742
912
  @cloud_redis_stub.call_rpc :export_instance, request, options: options do |response, operation|
@@ -749,7 +919,7 @@ module Google
749
919
  end
750
920
 
751
921
  ##
752
- # Initiates a failover of the master node to current replica node for a
922
+ # Initiates a failover of the primary node to current replica node for a
753
923
  # specific STANDARD tier Cloud Memorystore for Redis instance.
754
924
  #
755
925
  # @overload failover_instance(request, options = nil)
@@ -783,6 +953,28 @@ module Google
783
953
  #
784
954
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
785
955
  #
956
+ # @example Basic example
957
+ # require "google/cloud/redis/v1beta1"
958
+ #
959
+ # # Create a client object. The client can be reused for multiple calls.
960
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
961
+ #
962
+ # # Create a request. To set request fields, pass in keyword arguments.
963
+ # request = Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new
964
+ #
965
+ # # Call the failover_instance method.
966
+ # result = client.failover_instance request
967
+ #
968
+ # # The returned object is of type Gapic::Operation. You can use this
969
+ # # object to check the status of an operation, cancel it, or wait
970
+ # # for results. Here is how to block until completion:
971
+ # result.wait_until_done! timeout: 60
972
+ # if result.response?
973
+ # p result.response
974
+ # else
975
+ # puts "Error!"
976
+ # end
977
+ #
786
978
  def failover_instance request, options = nil
787
979
  raise ::ArgumentError, "request must be provided" if request.nil?
788
980
 
@@ -800,16 +992,20 @@ module Google
800
992
  gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
801
993
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
802
994
 
803
- header_params = {
804
- "name" => request.name
805
- }
995
+ header_params = {}
996
+ if request.name
997
+ header_params["name"] = request.name
998
+ end
999
+
806
1000
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
807
1001
  metadata[:"x-goog-request-params"] ||= request_params_header
808
1002
 
809
1003
  options.apply_defaults timeout: @config.rpcs.failover_instance.timeout,
810
1004
  metadata: metadata,
811
1005
  retry_policy: @config.rpcs.failover_instance.retry_policy
812
- options.apply_defaults metadata: @config.metadata,
1006
+
1007
+ options.apply_defaults timeout: @config.timeout,
1008
+ metadata: @config.metadata,
813
1009
  retry_policy: @config.retry_policy
814
1010
 
815
1011
  @cloud_redis_stub.call_rpc :failover_instance, request, options: options do |response, operation|
@@ -853,6 +1049,28 @@ module Google
853
1049
  #
854
1050
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
855
1051
  #
1052
+ # @example Basic example
1053
+ # require "google/cloud/redis/v1beta1"
1054
+ #
1055
+ # # Create a client object. The client can be reused for multiple calls.
1056
+ # client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new
1057
+ #
1058
+ # # Create a request. To set request fields, pass in keyword arguments.
1059
+ # request = Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.new
1060
+ #
1061
+ # # Call the delete_instance method.
1062
+ # result = client.delete_instance request
1063
+ #
1064
+ # # The returned object is of type Gapic::Operation. You can use this
1065
+ # # object to check the status of an operation, cancel it, or wait
1066
+ # # for results. Here is how to block until completion:
1067
+ # result.wait_until_done! timeout: 60
1068
+ # if result.response?
1069
+ # p result.response
1070
+ # else
1071
+ # puts "Error!"
1072
+ # end
1073
+ #
856
1074
  def delete_instance request, options = nil
857
1075
  raise ::ArgumentError, "request must be provided" if request.nil?
858
1076
 
@@ -870,16 +1088,20 @@ module Google
870
1088
  gapic_version: ::Google::Cloud::Redis::V1beta1::VERSION
871
1089
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
872
1090
 
873
- header_params = {
874
- "name" => request.name
875
- }
1091
+ header_params = {}
1092
+ if request.name
1093
+ header_params["name"] = request.name
1094
+ end
1095
+
876
1096
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
877
1097
  metadata[:"x-goog-request-params"] ||= request_params_header
878
1098
 
879
1099
  options.apply_defaults timeout: @config.rpcs.delete_instance.timeout,
880
1100
  metadata: metadata,
881
1101
  retry_policy: @config.rpcs.delete_instance.retry_policy
882
- options.apply_defaults metadata: @config.metadata,
1102
+
1103
+ options.apply_defaults timeout: @config.timeout,
1104
+ metadata: @config.metadata,
883
1105
  retry_policy: @config.retry_policy
884
1106
 
885
1107
  @cloud_redis_stub.call_rpc :delete_instance, request, options: options do |response, operation|
@@ -904,22 +1126,21 @@ module Google
904
1126
  # Configuration can be applied globally to all clients, or to a single client
905
1127
  # on construction.
906
1128
  #
907
- # # Examples
908
- #
909
- # To modify the global config, setting the timeout for list_instances
910
- # to 20 seconds, and all remaining timeouts to 10 seconds:
911
- #
912
- # ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.configure do |config|
913
- # config.timeout = 10.0
914
- # config.rpcs.list_instances.timeout = 20.0
915
- # end
916
- #
917
- # To apply the above configuration only to a new client:
918
- #
919
- # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config|
920
- # config.timeout = 10.0
921
- # config.rpcs.list_instances.timeout = 20.0
922
- # end
1129
+ # @example
1130
+ #
1131
+ # # Modify the global config, setting the timeout for
1132
+ # # list_instances to 20 seconds,
1133
+ # # and all remaining timeouts to 10 seconds.
1134
+ # ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.configure do |config|
1135
+ # config.timeout = 10.0
1136
+ # config.rpcs.list_instances.timeout = 20.0
1137
+ # end
1138
+ #
1139
+ # # Apply the above configuration only to a new client.
1140
+ # client = ::Google::Cloud::Redis::V1beta1::CloudRedis::Client.new do |config|
1141
+ # config.timeout = 10.0
1142
+ # config.rpcs.list_instances.timeout = 20.0
1143
+ # end
923
1144
  #
924
1145
  # @!attribute [rw] endpoint
925
1146
  # The hostname or hostname:port of the service endpoint.