google-cloud-security-private_ca-v1beta1 0.3.1 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -43,13 +43,12 @@ module Google
43
43
  # See {::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client::Configuration}
44
44
  # for a description of the configuration fields.
45
45
  #
46
- # ## Example
46
+ # @example
47
47
  #
48
- # To modify the configuration for all CertificateAuthorityService clients:
49
- #
50
- # ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.configure do |config|
51
- # config.timeout = 10.0
52
- # end
48
+ # # Modify the configuration for all CertificateAuthorityService clients
49
+ # ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
53
52
  #
54
53
  # @yield [config] Configure the Client client.
55
54
  # @yieldparam config [Client::Configuration]
@@ -69,10 +68,7 @@ module Google
69
68
 
70
69
  default_config.timeout = 60.0
71
70
  default_config.retry_policy = {
72
- initial_delay: 0.1,
73
- max_delay: 60.0,
74
- multiplier: 1.3,
75
- retry_codes: [2, 14, 4]
71
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [2, 14, 4]
76
72
  }
77
73
 
78
74
  default_config
@@ -104,19 +100,15 @@ module Google
104
100
  ##
105
101
  # Create a new CertificateAuthorityService client object.
106
102
  #
107
- # ## Examples
108
- #
109
- # To create a new CertificateAuthorityService client with the default
110
- # configuration:
111
- #
112
- # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
103
+ # @example
113
104
  #
114
- # To create a new CertificateAuthorityService client with a custom
115
- # configuration:
105
+ # # Create a client using the default configuration
106
+ # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
116
107
  #
117
- # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config|
118
- # config.timeout = 10.0
119
- # end
108
+ # # Create a client using a custom configuration
109
+ # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config|
110
+ # config.timeout = 10.0
111
+ # end
120
112
  #
121
113
  # @yield [config] Configure the CertificateAuthorityService client.
122
114
  # @yieldparam config [Client::Configuration]
@@ -136,14 +128,13 @@ module Google
136
128
 
137
129
  # Create credentials
138
130
  credentials = @config.credentials
139
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
131
+ # Use self-signed JWT if the endpoint is unchanged from default,
140
132
  # but only if the default endpoint does not have a region prefix.
141
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
142
- @config.endpoint == Client.configure.endpoint &&
133
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
143
134
  !@config.endpoint.split(".").first.include?("-")
144
135
  credentials ||= Credentials.default scope: @config.scope,
145
136
  enable_self_signed_jwt: enable_self_signed_jwt
146
- if credentials.is_a?(String) || credentials.is_a?(Hash)
137
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
147
138
  credentials = Credentials.new credentials, scope: @config.scope
148
139
  end
149
140
  @quota_project_id = @config.quota_project
@@ -225,6 +216,21 @@ module Google
225
216
  #
226
217
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
227
218
  #
219
+ # @example Basic example
220
+ # require "google/cloud/security/private_ca/v1beta1"
221
+ #
222
+ # # Create a client object. The client can be reused for multiple calls.
223
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
224
+ #
225
+ # # Create a request. To set request fields, pass in keyword arguments.
226
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new
227
+ #
228
+ # # Call the create_certificate method.
229
+ # result = client.create_certificate request
230
+ #
231
+ # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate.
232
+ # p result
233
+ #
228
234
  def create_certificate request, options = nil
229
235
  raise ::ArgumentError, "request must be provided" if request.nil?
230
236
 
@@ -242,16 +248,20 @@ module Google
242
248
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
243
249
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
244
250
 
245
- header_params = {
246
- "parent" => request.parent
247
- }
251
+ header_params = {}
252
+ if request.parent
253
+ header_params["parent"] = request.parent
254
+ end
255
+
248
256
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
249
257
  metadata[:"x-goog-request-params"] ||= request_params_header
250
258
 
251
259
  options.apply_defaults timeout: @config.rpcs.create_certificate.timeout,
252
260
  metadata: metadata,
253
261
  retry_policy: @config.rpcs.create_certificate.retry_policy
254
- options.apply_defaults metadata: @config.metadata,
262
+
263
+ options.apply_defaults timeout: @config.timeout,
264
+ metadata: @config.metadata,
255
265
  retry_policy: @config.retry_policy
256
266
 
257
267
  @certificate_authority_service_stub.call_rpc :create_certificate, request, options: options do |response, operation|
@@ -291,6 +301,21 @@ module Google
291
301
  #
292
302
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
293
303
  #
304
+ # @example Basic example
305
+ # require "google/cloud/security/private_ca/v1beta1"
306
+ #
307
+ # # Create a client object. The client can be reused for multiple calls.
308
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
309
+ #
310
+ # # Create a request. To set request fields, pass in keyword arguments.
311
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest.new
312
+ #
313
+ # # Call the get_certificate method.
314
+ # result = client.get_certificate request
315
+ #
316
+ # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate.
317
+ # p result
318
+ #
294
319
  def get_certificate request, options = nil
295
320
  raise ::ArgumentError, "request must be provided" if request.nil?
296
321
 
@@ -308,16 +333,20 @@ module Google
308
333
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
309
334
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
310
335
 
311
- header_params = {
312
- "name" => request.name
313
- }
336
+ header_params = {}
337
+ if request.name
338
+ header_params["name"] = request.name
339
+ end
340
+
314
341
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
315
342
  metadata[:"x-goog-request-params"] ||= request_params_header
316
343
 
317
344
  options.apply_defaults timeout: @config.rpcs.get_certificate.timeout,
318
345
  metadata: metadata,
319
346
  retry_policy: @config.rpcs.get_certificate.retry_policy
320
- options.apply_defaults metadata: @config.metadata,
347
+
348
+ options.apply_defaults timeout: @config.timeout,
349
+ metadata: @config.metadata,
321
350
  retry_policy: @config.retry_policy
322
351
 
323
352
  @certificate_authority_service_stub.call_rpc :get_certificate, request, options: options do |response, operation|
@@ -377,6 +406,27 @@ module Google
377
406
  #
378
407
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
379
408
  #
409
+ # @example Basic example
410
+ # require "google/cloud/security/private_ca/v1beta1"
411
+ #
412
+ # # Create a client object. The client can be reused for multiple calls.
413
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
414
+ #
415
+ # # Create a request. To set request fields, pass in keyword arguments.
416
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest.new
417
+ #
418
+ # # Call the list_certificates method.
419
+ # result = client.list_certificates request
420
+ #
421
+ # # The returned object is of type Gapic::PagedEnumerable. You can
422
+ # # iterate over all elements by calling #each, and the enumerable
423
+ # # will lazily make API calls to fetch subsequent pages. Other
424
+ # # methods are also available for managing paging directly.
425
+ # result.each do |response|
426
+ # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate.
427
+ # p response
428
+ # end
429
+ #
380
430
  def list_certificates request, options = nil
381
431
  raise ::ArgumentError, "request must be provided" if request.nil?
382
432
 
@@ -394,16 +444,20 @@ module Google
394
444
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
395
445
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
396
446
 
397
- header_params = {
398
- "parent" => request.parent
399
- }
447
+ header_params = {}
448
+ if request.parent
449
+ header_params["parent"] = request.parent
450
+ end
451
+
400
452
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
401
453
  metadata[:"x-goog-request-params"] ||= request_params_header
402
454
 
403
455
  options.apply_defaults timeout: @config.rpcs.list_certificates.timeout,
404
456
  metadata: metadata,
405
457
  retry_policy: @config.rpcs.list_certificates.retry_policy
406
- options.apply_defaults metadata: @config.metadata,
458
+
459
+ options.apply_defaults timeout: @config.timeout,
460
+ metadata: @config.metadata,
407
461
  retry_policy: @config.retry_policy
408
462
 
409
463
  @certificate_authority_service_stub.call_rpc :list_certificates, request, options: options do |response, operation|
@@ -461,6 +515,21 @@ module Google
461
515
  #
462
516
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
463
517
  #
518
+ # @example Basic example
519
+ # require "google/cloud/security/private_ca/v1beta1"
520
+ #
521
+ # # Create a client object. The client can be reused for multiple calls.
522
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
523
+ #
524
+ # # Create a request. To set request fields, pass in keyword arguments.
525
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest.new
526
+ #
527
+ # # Call the revoke_certificate method.
528
+ # result = client.revoke_certificate request
529
+ #
530
+ # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate.
531
+ # p result
532
+ #
464
533
  def revoke_certificate request, options = nil
465
534
  raise ::ArgumentError, "request must be provided" if request.nil?
466
535
 
@@ -478,16 +547,20 @@ module Google
478
547
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
479
548
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
480
549
 
481
- header_params = {
482
- "name" => request.name
483
- }
550
+ header_params = {}
551
+ if request.name
552
+ header_params["name"] = request.name
553
+ end
554
+
484
555
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
485
556
  metadata[:"x-goog-request-params"] ||= request_params_header
486
557
 
487
558
  options.apply_defaults timeout: @config.rpcs.revoke_certificate.timeout,
488
559
  metadata: metadata,
489
560
  retry_policy: @config.rpcs.revoke_certificate.retry_policy
490
- options.apply_defaults metadata: @config.metadata,
561
+
562
+ options.apply_defaults timeout: @config.timeout,
563
+ metadata: @config.metadata,
491
564
  retry_policy: @config.retry_policy
492
565
 
493
566
  @certificate_authority_service_stub.call_rpc :revoke_certificate, request, options: options do |response, operation|
@@ -544,6 +617,21 @@ module Google
544
617
  #
545
618
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
546
619
  #
620
+ # @example Basic example
621
+ # require "google/cloud/security/private_ca/v1beta1"
622
+ #
623
+ # # Create a client object. The client can be reused for multiple calls.
624
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
625
+ #
626
+ # # Create a request. To set request fields, pass in keyword arguments.
627
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest.new
628
+ #
629
+ # # Call the update_certificate method.
630
+ # result = client.update_certificate request
631
+ #
632
+ # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate.
633
+ # p result
634
+ #
547
635
  def update_certificate request, options = nil
548
636
  raise ::ArgumentError, "request must be provided" if request.nil?
549
637
 
@@ -561,16 +649,20 @@ module Google
561
649
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
562
650
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
563
651
 
564
- header_params = {
565
- "certificate.name" => request.certificate.name
566
- }
652
+ header_params = {}
653
+ if request.certificate&.name
654
+ header_params["certificate.name"] = request.certificate.name
655
+ end
656
+
567
657
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
568
658
  metadata[:"x-goog-request-params"] ||= request_params_header
569
659
 
570
660
  options.apply_defaults timeout: @config.rpcs.update_certificate.timeout,
571
661
  metadata: metadata,
572
662
  retry_policy: @config.rpcs.update_certificate.retry_policy
573
- options.apply_defaults metadata: @config.metadata,
663
+
664
+ options.apply_defaults timeout: @config.timeout,
665
+ metadata: @config.metadata,
574
666
  retry_policy: @config.retry_policy
575
667
 
576
668
  @certificate_authority_service_stub.call_rpc :update_certificate, request, options: options do |response, operation|
@@ -636,6 +728,28 @@ module Google
636
728
  #
637
729
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
638
730
  #
731
+ # @example Basic example
732
+ # require "google/cloud/security/private_ca/v1beta1"
733
+ #
734
+ # # Create a client object. The client can be reused for multiple calls.
735
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
736
+ #
737
+ # # Create a request. To set request fields, pass in keyword arguments.
738
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest.new
739
+ #
740
+ # # Call the activate_certificate_authority method.
741
+ # result = client.activate_certificate_authority request
742
+ #
743
+ # # The returned object is of type Gapic::Operation. You can use this
744
+ # # object to check the status of an operation, cancel it, or wait
745
+ # # for results. Here is how to block until completion:
746
+ # result.wait_until_done! timeout: 60
747
+ # if result.response?
748
+ # p result.response
749
+ # else
750
+ # puts "Error!"
751
+ # end
752
+ #
639
753
  def activate_certificate_authority request, options = nil
640
754
  raise ::ArgumentError, "request must be provided" if request.nil?
641
755
 
@@ -653,16 +767,20 @@ module Google
653
767
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
654
768
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
655
769
 
656
- header_params = {
657
- "name" => request.name
658
- }
770
+ header_params = {}
771
+ if request.name
772
+ header_params["name"] = request.name
773
+ end
774
+
659
775
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
660
776
  metadata[:"x-goog-request-params"] ||= request_params_header
661
777
 
662
778
  options.apply_defaults timeout: @config.rpcs.activate_certificate_authority.timeout,
663
779
  metadata: metadata,
664
780
  retry_policy: @config.rpcs.activate_certificate_authority.retry_policy
665
- options.apply_defaults metadata: @config.metadata,
781
+
782
+ options.apply_defaults timeout: @config.timeout,
783
+ metadata: @config.metadata,
666
784
  retry_policy: @config.retry_policy
667
785
 
668
786
  @certificate_authority_service_stub.call_rpc :activate_certificate_authority, request, options: options do |response, operation|
@@ -724,6 +842,28 @@ module Google
724
842
  #
725
843
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
726
844
  #
845
+ # @example Basic example
846
+ # require "google/cloud/security/private_ca/v1beta1"
847
+ #
848
+ # # Create a client object. The client can be reused for multiple calls.
849
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
850
+ #
851
+ # # Create a request. To set request fields, pass in keyword arguments.
852
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest.new
853
+ #
854
+ # # Call the create_certificate_authority method.
855
+ # result = client.create_certificate_authority request
856
+ #
857
+ # # The returned object is of type Gapic::Operation. You can use this
858
+ # # object to check the status of an operation, cancel it, or wait
859
+ # # for results. Here is how to block until completion:
860
+ # result.wait_until_done! timeout: 60
861
+ # if result.response?
862
+ # p result.response
863
+ # else
864
+ # puts "Error!"
865
+ # end
866
+ #
727
867
  def create_certificate_authority request, options = nil
728
868
  raise ::ArgumentError, "request must be provided" if request.nil?
729
869
 
@@ -741,16 +881,20 @@ module Google
741
881
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
742
882
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
743
883
 
744
- header_params = {
745
- "parent" => request.parent
746
- }
884
+ header_params = {}
885
+ if request.parent
886
+ header_params["parent"] = request.parent
887
+ end
888
+
747
889
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
748
890
  metadata[:"x-goog-request-params"] ||= request_params_header
749
891
 
750
892
  options.apply_defaults timeout: @config.rpcs.create_certificate_authority.timeout,
751
893
  metadata: metadata,
752
894
  retry_policy: @config.rpcs.create_certificate_authority.retry_policy
753
- options.apply_defaults metadata: @config.metadata,
895
+
896
+ options.apply_defaults timeout: @config.timeout,
897
+ metadata: @config.metadata,
754
898
  retry_policy: @config.retry_policy
755
899
 
756
900
  @certificate_authority_service_stub.call_rpc :create_certificate_authority, request, options: options do |response, operation|
@@ -806,6 +950,28 @@ module Google
806
950
  #
807
951
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
808
952
  #
953
+ # @example Basic example
954
+ # require "google/cloud/security/private_ca/v1beta1"
955
+ #
956
+ # # Create a client object. The client can be reused for multiple calls.
957
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
958
+ #
959
+ # # Create a request. To set request fields, pass in keyword arguments.
960
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest.new
961
+ #
962
+ # # Call the disable_certificate_authority method.
963
+ # result = client.disable_certificate_authority request
964
+ #
965
+ # # The returned object is of type Gapic::Operation. You can use this
966
+ # # object to check the status of an operation, cancel it, or wait
967
+ # # for results. Here is how to block until completion:
968
+ # result.wait_until_done! timeout: 60
969
+ # if result.response?
970
+ # p result.response
971
+ # else
972
+ # puts "Error!"
973
+ # end
974
+ #
809
975
  def disable_certificate_authority request, options = nil
810
976
  raise ::ArgumentError, "request must be provided" if request.nil?
811
977
 
@@ -823,16 +989,20 @@ module Google
823
989
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
824
990
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
825
991
 
826
- header_params = {
827
- "name" => request.name
828
- }
992
+ header_params = {}
993
+ if request.name
994
+ header_params["name"] = request.name
995
+ end
996
+
829
997
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
830
998
  metadata[:"x-goog-request-params"] ||= request_params_header
831
999
 
832
1000
  options.apply_defaults timeout: @config.rpcs.disable_certificate_authority.timeout,
833
1001
  metadata: metadata,
834
1002
  retry_policy: @config.rpcs.disable_certificate_authority.retry_policy
835
- options.apply_defaults metadata: @config.metadata,
1003
+
1004
+ options.apply_defaults timeout: @config.timeout,
1005
+ metadata: @config.metadata,
836
1006
  retry_policy: @config.retry_policy
837
1007
 
838
1008
  @certificate_authority_service_stub.call_rpc :disable_certificate_authority, request, options: options do |response, operation|
@@ -888,6 +1058,28 @@ module Google
888
1058
  #
889
1059
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
890
1060
  #
1061
+ # @example Basic example
1062
+ # require "google/cloud/security/private_ca/v1beta1"
1063
+ #
1064
+ # # Create a client object. The client can be reused for multiple calls.
1065
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
1066
+ #
1067
+ # # Create a request. To set request fields, pass in keyword arguments.
1068
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest.new
1069
+ #
1070
+ # # Call the enable_certificate_authority method.
1071
+ # result = client.enable_certificate_authority request
1072
+ #
1073
+ # # The returned object is of type Gapic::Operation. You can use this
1074
+ # # object to check the status of an operation, cancel it, or wait
1075
+ # # for results. Here is how to block until completion:
1076
+ # result.wait_until_done! timeout: 60
1077
+ # if result.response?
1078
+ # p result.response
1079
+ # else
1080
+ # puts "Error!"
1081
+ # end
1082
+ #
891
1083
  def enable_certificate_authority request, options = nil
892
1084
  raise ::ArgumentError, "request must be provided" if request.nil?
893
1085
 
@@ -905,16 +1097,20 @@ module Google
905
1097
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
906
1098
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
907
1099
 
908
- header_params = {
909
- "name" => request.name
910
- }
1100
+ header_params = {}
1101
+ if request.name
1102
+ header_params["name"] = request.name
1103
+ end
1104
+
911
1105
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
912
1106
  metadata[:"x-goog-request-params"] ||= request_params_header
913
1107
 
914
1108
  options.apply_defaults timeout: @config.rpcs.enable_certificate_authority.timeout,
915
1109
  metadata: metadata,
916
1110
  retry_policy: @config.rpcs.enable_certificate_authority.retry_policy
917
- options.apply_defaults metadata: @config.metadata,
1111
+
1112
+ options.apply_defaults timeout: @config.timeout,
1113
+ metadata: @config.metadata,
918
1114
  retry_policy: @config.retry_policy
919
1115
 
920
1116
  @certificate_authority_service_stub.call_rpc :enable_certificate_authority, request, options: options do |response, operation|
@@ -962,6 +1158,21 @@ module Google
962
1158
  #
963
1159
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
964
1160
  #
1161
+ # @example Basic example
1162
+ # require "google/cloud/security/private_ca/v1beta1"
1163
+ #
1164
+ # # Create a client object. The client can be reused for multiple calls.
1165
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
1166
+ #
1167
+ # # Create a request. To set request fields, pass in keyword arguments.
1168
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest.new
1169
+ #
1170
+ # # Call the fetch_certificate_authority_csr method.
1171
+ # result = client.fetch_certificate_authority_csr request
1172
+ #
1173
+ # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse.
1174
+ # p result
1175
+ #
965
1176
  def fetch_certificate_authority_csr request, options = nil
966
1177
  raise ::ArgumentError, "request must be provided" if request.nil?
967
1178
 
@@ -979,16 +1190,20 @@ module Google
979
1190
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
980
1191
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
981
1192
 
982
- header_params = {
983
- "name" => request.name
984
- }
1193
+ header_params = {}
1194
+ if request.name
1195
+ header_params["name"] = request.name
1196
+ end
1197
+
985
1198
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
986
1199
  metadata[:"x-goog-request-params"] ||= request_params_header
987
1200
 
988
1201
  options.apply_defaults timeout: @config.rpcs.fetch_certificate_authority_csr.timeout,
989
1202
  metadata: metadata,
990
1203
  retry_policy: @config.rpcs.fetch_certificate_authority_csr.retry_policy
991
- options.apply_defaults metadata: @config.metadata,
1204
+
1205
+ options.apply_defaults timeout: @config.timeout,
1206
+ metadata: @config.metadata,
992
1207
  retry_policy: @config.retry_policy
993
1208
 
994
1209
  @certificate_authority_service_stub.call_rpc :fetch_certificate_authority_csr, request, options: options do |response, operation|
@@ -1029,6 +1244,21 @@ module Google
1029
1244
  #
1030
1245
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1031
1246
  #
1247
+ # @example Basic example
1248
+ # require "google/cloud/security/private_ca/v1beta1"
1249
+ #
1250
+ # # Create a client object. The client can be reused for multiple calls.
1251
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
1252
+ #
1253
+ # # Create a request. To set request fields, pass in keyword arguments.
1254
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest.new
1255
+ #
1256
+ # # Call the get_certificate_authority method.
1257
+ # result = client.get_certificate_authority request
1258
+ #
1259
+ # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority.
1260
+ # p result
1261
+ #
1032
1262
  def get_certificate_authority request, options = nil
1033
1263
  raise ::ArgumentError, "request must be provided" if request.nil?
1034
1264
 
@@ -1046,16 +1276,20 @@ module Google
1046
1276
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1047
1277
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1048
1278
 
1049
- header_params = {
1050
- "name" => request.name
1051
- }
1279
+ header_params = {}
1280
+ if request.name
1281
+ header_params["name"] = request.name
1282
+ end
1283
+
1052
1284
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1053
1285
  metadata[:"x-goog-request-params"] ||= request_params_header
1054
1286
 
1055
1287
  options.apply_defaults timeout: @config.rpcs.get_certificate_authority.timeout,
1056
1288
  metadata: metadata,
1057
1289
  retry_policy: @config.rpcs.get_certificate_authority.retry_policy
1058
- options.apply_defaults metadata: @config.metadata,
1290
+
1291
+ options.apply_defaults timeout: @config.timeout,
1292
+ metadata: @config.metadata,
1059
1293
  retry_policy: @config.retry_policy
1060
1294
 
1061
1295
  @certificate_authority_service_stub.call_rpc :get_certificate_authority, request, options: options do |response, operation|
@@ -1111,6 +1345,27 @@ module Google
1111
1345
  #
1112
1346
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1113
1347
  #
1348
+ # @example Basic example
1349
+ # require "google/cloud/security/private_ca/v1beta1"
1350
+ #
1351
+ # # Create a client object. The client can be reused for multiple calls.
1352
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
1353
+ #
1354
+ # # Create a request. To set request fields, pass in keyword arguments.
1355
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest.new
1356
+ #
1357
+ # # Call the list_certificate_authorities method.
1358
+ # result = client.list_certificate_authorities request
1359
+ #
1360
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1361
+ # # iterate over all elements by calling #each, and the enumerable
1362
+ # # will lazily make API calls to fetch subsequent pages. Other
1363
+ # # methods are also available for managing paging directly.
1364
+ # result.each do |response|
1365
+ # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority.
1366
+ # p response
1367
+ # end
1368
+ #
1114
1369
  def list_certificate_authorities request, options = nil
1115
1370
  raise ::ArgumentError, "request must be provided" if request.nil?
1116
1371
 
@@ -1128,16 +1383,20 @@ module Google
1128
1383
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1129
1384
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1130
1385
 
1131
- header_params = {
1132
- "parent" => request.parent
1133
- }
1386
+ header_params = {}
1387
+ if request.parent
1388
+ header_params["parent"] = request.parent
1389
+ end
1390
+
1134
1391
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1135
1392
  metadata[:"x-goog-request-params"] ||= request_params_header
1136
1393
 
1137
1394
  options.apply_defaults timeout: @config.rpcs.list_certificate_authorities.timeout,
1138
1395
  metadata: metadata,
1139
1396
  retry_policy: @config.rpcs.list_certificate_authorities.retry_policy
1140
- options.apply_defaults metadata: @config.metadata,
1397
+
1398
+ options.apply_defaults timeout: @config.timeout,
1399
+ metadata: @config.metadata,
1141
1400
  retry_policy: @config.retry_policy
1142
1401
 
1143
1402
  @certificate_authority_service_stub.call_rpc :list_certificate_authorities, request, options: options do |response, operation|
@@ -1193,6 +1452,28 @@ module Google
1193
1452
  #
1194
1453
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1195
1454
  #
1455
+ # @example Basic example
1456
+ # require "google/cloud/security/private_ca/v1beta1"
1457
+ #
1458
+ # # Create a client object. The client can be reused for multiple calls.
1459
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
1460
+ #
1461
+ # # Create a request. To set request fields, pass in keyword arguments.
1462
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest.new
1463
+ #
1464
+ # # Call the restore_certificate_authority method.
1465
+ # result = client.restore_certificate_authority request
1466
+ #
1467
+ # # The returned object is of type Gapic::Operation. You can use this
1468
+ # # object to check the status of an operation, cancel it, or wait
1469
+ # # for results. Here is how to block until completion:
1470
+ # result.wait_until_done! timeout: 60
1471
+ # if result.response?
1472
+ # p result.response
1473
+ # else
1474
+ # puts "Error!"
1475
+ # end
1476
+ #
1196
1477
  def restore_certificate_authority request, options = nil
1197
1478
  raise ::ArgumentError, "request must be provided" if request.nil?
1198
1479
 
@@ -1210,16 +1491,20 @@ module Google
1210
1491
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1211
1492
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1212
1493
 
1213
- header_params = {
1214
- "name" => request.name
1215
- }
1494
+ header_params = {}
1495
+ if request.name
1496
+ header_params["name"] = request.name
1497
+ end
1498
+
1216
1499
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1217
1500
  metadata[:"x-goog-request-params"] ||= request_params_header
1218
1501
 
1219
1502
  options.apply_defaults timeout: @config.rpcs.restore_certificate_authority.timeout,
1220
1503
  metadata: metadata,
1221
1504
  retry_policy: @config.rpcs.restore_certificate_authority.retry_policy
1222
- options.apply_defaults metadata: @config.metadata,
1505
+
1506
+ options.apply_defaults timeout: @config.timeout,
1507
+ metadata: @config.metadata,
1223
1508
  retry_policy: @config.retry_policy
1224
1509
 
1225
1510
  @certificate_authority_service_stub.call_rpc :restore_certificate_authority, request, options: options do |response, operation|
@@ -1275,6 +1560,28 @@ module Google
1275
1560
  #
1276
1561
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1277
1562
  #
1563
+ # @example Basic example
1564
+ # require "google/cloud/security/private_ca/v1beta1"
1565
+ #
1566
+ # # Create a client object. The client can be reused for multiple calls.
1567
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
1568
+ #
1569
+ # # Create a request. To set request fields, pass in keyword arguments.
1570
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest.new
1571
+ #
1572
+ # # Call the schedule_delete_certificate_authority method.
1573
+ # result = client.schedule_delete_certificate_authority request
1574
+ #
1575
+ # # The returned object is of type Gapic::Operation. You can use this
1576
+ # # object to check the status of an operation, cancel it, or wait
1577
+ # # for results. Here is how to block until completion:
1578
+ # result.wait_until_done! timeout: 60
1579
+ # if result.response?
1580
+ # p result.response
1581
+ # else
1582
+ # puts "Error!"
1583
+ # end
1584
+ #
1278
1585
  def schedule_delete_certificate_authority request, options = nil
1279
1586
  raise ::ArgumentError, "request must be provided" if request.nil?
1280
1587
 
@@ -1292,16 +1599,20 @@ module Google
1292
1599
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1293
1600
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1294
1601
 
1295
- header_params = {
1296
- "name" => request.name
1297
- }
1602
+ header_params = {}
1603
+ if request.name
1604
+ header_params["name"] = request.name
1605
+ end
1606
+
1298
1607
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1299
1608
  metadata[:"x-goog-request-params"] ||= request_params_header
1300
1609
 
1301
1610
  options.apply_defaults timeout: @config.rpcs.schedule_delete_certificate_authority.timeout,
1302
1611
  metadata: metadata,
1303
1612
  retry_policy: @config.rpcs.schedule_delete_certificate_authority.retry_policy
1304
- options.apply_defaults metadata: @config.metadata,
1613
+
1614
+ options.apply_defaults timeout: @config.timeout,
1615
+ metadata: @config.metadata,
1305
1616
  retry_policy: @config.retry_policy
1306
1617
 
1307
1618
  @certificate_authority_service_stub.call_rpc :schedule_delete_certificate_authority, request, options: options do |response, operation|
@@ -1358,6 +1669,28 @@ module Google
1358
1669
  #
1359
1670
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1360
1671
  #
1672
+ # @example Basic example
1673
+ # require "google/cloud/security/private_ca/v1beta1"
1674
+ #
1675
+ # # Create a client object. The client can be reused for multiple calls.
1676
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
1677
+ #
1678
+ # # Create a request. To set request fields, pass in keyword arguments.
1679
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest.new
1680
+ #
1681
+ # # Call the update_certificate_authority method.
1682
+ # result = client.update_certificate_authority request
1683
+ #
1684
+ # # The returned object is of type Gapic::Operation. You can use this
1685
+ # # object to check the status of an operation, cancel it, or wait
1686
+ # # for results. Here is how to block until completion:
1687
+ # result.wait_until_done! timeout: 60
1688
+ # if result.response?
1689
+ # p result.response
1690
+ # else
1691
+ # puts "Error!"
1692
+ # end
1693
+ #
1361
1694
  def update_certificate_authority request, options = nil
1362
1695
  raise ::ArgumentError, "request must be provided" if request.nil?
1363
1696
 
@@ -1375,16 +1708,20 @@ module Google
1375
1708
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1376
1709
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1377
1710
 
1378
- header_params = {
1379
- "certificate_authority.name" => request.certificate_authority.name
1380
- }
1711
+ header_params = {}
1712
+ if request.certificate_authority&.name
1713
+ header_params["certificate_authority.name"] = request.certificate_authority.name
1714
+ end
1715
+
1381
1716
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1382
1717
  metadata[:"x-goog-request-params"] ||= request_params_header
1383
1718
 
1384
1719
  options.apply_defaults timeout: @config.rpcs.update_certificate_authority.timeout,
1385
1720
  metadata: metadata,
1386
1721
  retry_policy: @config.rpcs.update_certificate_authority.retry_policy
1387
- options.apply_defaults metadata: @config.metadata,
1722
+
1723
+ options.apply_defaults timeout: @config.timeout,
1724
+ metadata: @config.metadata,
1388
1725
  retry_policy: @config.retry_policy
1389
1726
 
1390
1727
  @certificate_authority_service_stub.call_rpc :update_certificate_authority, request, options: options do |response, operation|
@@ -1426,6 +1763,21 @@ module Google
1426
1763
  #
1427
1764
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1428
1765
  #
1766
+ # @example Basic example
1767
+ # require "google/cloud/security/private_ca/v1beta1"
1768
+ #
1769
+ # # Create a client object. The client can be reused for multiple calls.
1770
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
1771
+ #
1772
+ # # Create a request. To set request fields, pass in keyword arguments.
1773
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest.new
1774
+ #
1775
+ # # Call the get_certificate_revocation_list method.
1776
+ # result = client.get_certificate_revocation_list request
1777
+ #
1778
+ # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList.
1779
+ # p result
1780
+ #
1429
1781
  def get_certificate_revocation_list request, options = nil
1430
1782
  raise ::ArgumentError, "request must be provided" if request.nil?
1431
1783
 
@@ -1443,16 +1795,20 @@ module Google
1443
1795
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1444
1796
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1445
1797
 
1446
- header_params = {
1447
- "name" => request.name
1448
- }
1798
+ header_params = {}
1799
+ if request.name
1800
+ header_params["name"] = request.name
1801
+ end
1802
+
1449
1803
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1450
1804
  metadata[:"x-goog-request-params"] ||= request_params_header
1451
1805
 
1452
1806
  options.apply_defaults timeout: @config.rpcs.get_certificate_revocation_list.timeout,
1453
1807
  metadata: metadata,
1454
1808
  retry_policy: @config.rpcs.get_certificate_revocation_list.retry_policy
1455
- options.apply_defaults metadata: @config.metadata,
1809
+
1810
+ options.apply_defaults timeout: @config.timeout,
1811
+ metadata: @config.metadata,
1456
1812
  retry_policy: @config.retry_policy
1457
1813
 
1458
1814
  @certificate_authority_service_stub.call_rpc :get_certificate_revocation_list, request, options: options do |response, operation|
@@ -1508,6 +1864,27 @@ module Google
1508
1864
  #
1509
1865
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1510
1866
  #
1867
+ # @example Basic example
1868
+ # require "google/cloud/security/private_ca/v1beta1"
1869
+ #
1870
+ # # Create a client object. The client can be reused for multiple calls.
1871
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
1872
+ #
1873
+ # # Create a request. To set request fields, pass in keyword arguments.
1874
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest.new
1875
+ #
1876
+ # # Call the list_certificate_revocation_lists method.
1877
+ # result = client.list_certificate_revocation_lists request
1878
+ #
1879
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1880
+ # # iterate over all elements by calling #each, and the enumerable
1881
+ # # will lazily make API calls to fetch subsequent pages. Other
1882
+ # # methods are also available for managing paging directly.
1883
+ # result.each do |response|
1884
+ # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList.
1885
+ # p response
1886
+ # end
1887
+ #
1511
1888
  def list_certificate_revocation_lists request, options = nil
1512
1889
  raise ::ArgumentError, "request must be provided" if request.nil?
1513
1890
 
@@ -1525,16 +1902,20 @@ module Google
1525
1902
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1526
1903
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1527
1904
 
1528
- header_params = {
1529
- "parent" => request.parent
1530
- }
1905
+ header_params = {}
1906
+ if request.parent
1907
+ header_params["parent"] = request.parent
1908
+ end
1909
+
1531
1910
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1532
1911
  metadata[:"x-goog-request-params"] ||= request_params_header
1533
1912
 
1534
1913
  options.apply_defaults timeout: @config.rpcs.list_certificate_revocation_lists.timeout,
1535
1914
  metadata: metadata,
1536
1915
  retry_policy: @config.rpcs.list_certificate_revocation_lists.retry_policy
1537
- options.apply_defaults metadata: @config.metadata,
1916
+
1917
+ options.apply_defaults timeout: @config.timeout,
1918
+ metadata: @config.metadata,
1538
1919
  retry_policy: @config.retry_policy
1539
1920
 
1540
1921
  @certificate_authority_service_stub.call_rpc :list_certificate_revocation_lists, request, options: options do |response, operation|
@@ -1591,6 +1972,28 @@ module Google
1591
1972
  #
1592
1973
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1593
1974
  #
1975
+ # @example Basic example
1976
+ # require "google/cloud/security/private_ca/v1beta1"
1977
+ #
1978
+ # # Create a client object. The client can be reused for multiple calls.
1979
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
1980
+ #
1981
+ # # Create a request. To set request fields, pass in keyword arguments.
1982
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest.new
1983
+ #
1984
+ # # Call the update_certificate_revocation_list method.
1985
+ # result = client.update_certificate_revocation_list request
1986
+ #
1987
+ # # The returned object is of type Gapic::Operation. You can use this
1988
+ # # object to check the status of an operation, cancel it, or wait
1989
+ # # for results. Here is how to block until completion:
1990
+ # result.wait_until_done! timeout: 60
1991
+ # if result.response?
1992
+ # p result.response
1993
+ # else
1994
+ # puts "Error!"
1995
+ # end
1996
+ #
1594
1997
  def update_certificate_revocation_list request, options = nil
1595
1998
  raise ::ArgumentError, "request must be provided" if request.nil?
1596
1999
 
@@ -1608,16 +2011,20 @@ module Google
1608
2011
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1609
2012
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1610
2013
 
1611
- header_params = {
1612
- "certificate_revocation_list.name" => request.certificate_revocation_list.name
1613
- }
2014
+ header_params = {}
2015
+ if request.certificate_revocation_list&.name
2016
+ header_params["certificate_revocation_list.name"] = request.certificate_revocation_list.name
2017
+ end
2018
+
1614
2019
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1615
2020
  metadata[:"x-goog-request-params"] ||= request_params_header
1616
2021
 
1617
2022
  options.apply_defaults timeout: @config.rpcs.update_certificate_revocation_list.timeout,
1618
2023
  metadata: metadata,
1619
2024
  retry_policy: @config.rpcs.update_certificate_revocation_list.retry_policy
1620
- options.apply_defaults metadata: @config.metadata,
2025
+
2026
+ options.apply_defaults timeout: @config.timeout,
2027
+ metadata: @config.metadata,
1621
2028
  retry_policy: @config.retry_policy
1622
2029
 
1623
2030
  @certificate_authority_service_stub.call_rpc :update_certificate_revocation_list, request, options: options do |response, operation|
@@ -1658,6 +2065,21 @@ module Google
1658
2065
  #
1659
2066
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1660
2067
  #
2068
+ # @example Basic example
2069
+ # require "google/cloud/security/private_ca/v1beta1"
2070
+ #
2071
+ # # Create a client object. The client can be reused for multiple calls.
2072
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
2073
+ #
2074
+ # # Create a request. To set request fields, pass in keyword arguments.
2075
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest.new
2076
+ #
2077
+ # # Call the get_reusable_config method.
2078
+ # result = client.get_reusable_config request
2079
+ #
2080
+ # # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig.
2081
+ # p result
2082
+ #
1661
2083
  def get_reusable_config request, options = nil
1662
2084
  raise ::ArgumentError, "request must be provided" if request.nil?
1663
2085
 
@@ -1675,16 +2097,20 @@ module Google
1675
2097
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1676
2098
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1677
2099
 
1678
- header_params = {
1679
- "name" => request.name
1680
- }
2100
+ header_params = {}
2101
+ if request.name
2102
+ header_params["name"] = request.name
2103
+ end
2104
+
1681
2105
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1682
2106
  metadata[:"x-goog-request-params"] ||= request_params_header
1683
2107
 
1684
2108
  options.apply_defaults timeout: @config.rpcs.get_reusable_config.timeout,
1685
2109
  metadata: metadata,
1686
2110
  retry_policy: @config.rpcs.get_reusable_config.retry_policy
1687
- options.apply_defaults metadata: @config.metadata,
2111
+
2112
+ options.apply_defaults timeout: @config.timeout,
2113
+ metadata: @config.metadata,
1688
2114
  retry_policy: @config.retry_policy
1689
2115
 
1690
2116
  @certificate_authority_service_stub.call_rpc :get_reusable_config, request, options: options do |response, operation|
@@ -1740,6 +2166,27 @@ module Google
1740
2166
  #
1741
2167
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1742
2168
  #
2169
+ # @example Basic example
2170
+ # require "google/cloud/security/private_ca/v1beta1"
2171
+ #
2172
+ # # Create a client object. The client can be reused for multiple calls.
2173
+ # client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new
2174
+ #
2175
+ # # Create a request. To set request fields, pass in keyword arguments.
2176
+ # request = Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest.new
2177
+ #
2178
+ # # Call the list_reusable_configs method.
2179
+ # result = client.list_reusable_configs request
2180
+ #
2181
+ # # The returned object is of type Gapic::PagedEnumerable. You can
2182
+ # # iterate over all elements by calling #each, and the enumerable
2183
+ # # will lazily make API calls to fetch subsequent pages. Other
2184
+ # # methods are also available for managing paging directly.
2185
+ # result.each do |response|
2186
+ # # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig.
2187
+ # p response
2188
+ # end
2189
+ #
1743
2190
  def list_reusable_configs request, options = nil
1744
2191
  raise ::ArgumentError, "request must be provided" if request.nil?
1745
2192
 
@@ -1757,16 +2204,20 @@ module Google
1757
2204
  gapic_version: ::Google::Cloud::Security::PrivateCA::V1beta1::VERSION
1758
2205
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1759
2206
 
1760
- header_params = {
1761
- "parent" => request.parent
1762
- }
2207
+ header_params = {}
2208
+ if request.parent
2209
+ header_params["parent"] = request.parent
2210
+ end
2211
+
1763
2212
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1764
2213
  metadata[:"x-goog-request-params"] ||= request_params_header
1765
2214
 
1766
2215
  options.apply_defaults timeout: @config.rpcs.list_reusable_configs.timeout,
1767
2216
  metadata: metadata,
1768
2217
  retry_policy: @config.rpcs.list_reusable_configs.retry_policy
1769
- options.apply_defaults metadata: @config.metadata,
2218
+
2219
+ options.apply_defaults timeout: @config.timeout,
2220
+ metadata: @config.metadata,
1770
2221
  retry_policy: @config.retry_policy
1771
2222
 
1772
2223
  @certificate_authority_service_stub.call_rpc :list_reusable_configs, request, options: options do |response, operation|
@@ -1791,22 +2242,21 @@ module Google
1791
2242
  # Configuration can be applied globally to all clients, or to a single client
1792
2243
  # on construction.
1793
2244
  #
1794
- # # Examples
1795
- #
1796
- # To modify the global config, setting the timeout for create_certificate
1797
- # to 20 seconds, and all remaining timeouts to 10 seconds:
1798
- #
1799
- # ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.configure do |config|
1800
- # config.timeout = 10.0
1801
- # config.rpcs.create_certificate.timeout = 20.0
1802
- # end
1803
- #
1804
- # To apply the above configuration only to a new client:
1805
- #
1806
- # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config|
1807
- # config.timeout = 10.0
1808
- # config.rpcs.create_certificate.timeout = 20.0
1809
- # end
2245
+ # @example
2246
+ #
2247
+ # # Modify the global config, setting the timeout for
2248
+ # # create_certificate to 20 seconds,
2249
+ # # and all remaining timeouts to 10 seconds.
2250
+ # ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.configure do |config|
2251
+ # config.timeout = 10.0
2252
+ # config.rpcs.create_certificate.timeout = 20.0
2253
+ # end
2254
+ #
2255
+ # # Apply the above configuration only to a new client.
2256
+ # client = ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new do |config|
2257
+ # config.timeout = 10.0
2258
+ # config.rpcs.create_certificate.timeout = 20.0
2259
+ # end
1810
2260
  #
1811
2261
  # @!attribute [rw] endpoint
1812
2262
  # The hostname or hostname:port of the service endpoint.