google-cloud-kms-v1 0.9.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -299,12 +299,16 @@ module Google
299
299
  #
300
300
  # @param parent [::String]
301
301
  # Required. The resource name of the location associated with the
302
- # {::Google::Cloud::Kms::V1::KeyRing KeyRings}, in the format `projects/*/locations/*`.
302
+ # {::Google::Cloud::Kms::V1::KeyRing KeyRings}, in the format
303
+ # `projects/*/locations/*`.
303
304
  # @param page_size [::Integer]
304
- # Optional. Optional limit on the number of {::Google::Cloud::Kms::V1::KeyRing KeyRings} to include in the
305
- # response. Further {::Google::Cloud::Kms::V1::KeyRing KeyRings} can subsequently be obtained by
306
- # including the {::Google::Cloud::Kms::V1::ListKeyRingsResponse#next_page_token ListKeyRingsResponse.next_page_token} in a subsequent
307
- # request. If unspecified, the server will pick an appropriate default.
305
+ # Optional. Optional limit on the number of
306
+ # {::Google::Cloud::Kms::V1::KeyRing KeyRings} to include in the response. Further
307
+ # {::Google::Cloud::Kms::V1::KeyRing KeyRings} can subsequently be obtained by
308
+ # including the
309
+ # {::Google::Cloud::Kms::V1::ListKeyRingsResponse#next_page_token ListKeyRingsResponse.next_page_token}
310
+ # in a subsequent request. If unspecified, the server will pick an
311
+ # appropriate default.
308
312
  # @param page_token [::String]
309
313
  # Optional. Optional pagination token, returned earlier via
310
314
  # {::Google::Cloud::Kms::V1::ListKeyRingsResponse#next_page_token ListKeyRingsResponse.next_page_token}.
@@ -327,6 +331,27 @@ module Google
327
331
  #
328
332
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
329
333
  #
334
+ # @example Basic example
335
+ # require "google/cloud/kms/v1"
336
+ #
337
+ # # Create a client object. The client can be reused for multiple calls.
338
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
339
+ #
340
+ # # Create a request. To set request fields, pass in keyword arguments.
341
+ # request = Google::Cloud::Kms::V1::ListKeyRingsRequest.new
342
+ #
343
+ # # Call the list_key_rings method.
344
+ # result = client.list_key_rings request
345
+ #
346
+ # # The returned object is of type Gapic::PagedEnumerable. You can
347
+ # # iterate over all elements by calling #each, and the enumerable
348
+ # # will lazily make API calls to fetch subsequent pages. Other
349
+ # # methods are also available for managing paging directly.
350
+ # result.each do |response|
351
+ # # Each element is of type ::Google::Cloud::Kms::V1::KeyRing.
352
+ # p response
353
+ # end
354
+ #
330
355
  def list_key_rings request, options = nil
331
356
  raise ::ArgumentError, "request must be provided" if request.nil?
332
357
 
@@ -344,9 +369,11 @@ module Google
344
369
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
345
370
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
346
371
 
347
- header_params = {
348
- "parent" => request.parent
349
- }
372
+ header_params = {}
373
+ if request.parent
374
+ header_params["parent"] = request.parent
375
+ end
376
+
350
377
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
351
378
  metadata[:"x-goog-request-params"] ||= request_params_header
352
379
 
@@ -386,13 +413,16 @@ module Google
386
413
  # the default parameter values, pass an empty Hash as a request object (see above).
387
414
  #
388
415
  # @param parent [::String]
389
- # Required. The resource name of the {::Google::Cloud::Kms::V1::KeyRing KeyRing} to list, in the format
390
- # `projects/*/locations/*/keyRings/*`.
416
+ # Required. The resource name of the {::Google::Cloud::Kms::V1::KeyRing KeyRing}
417
+ # to list, in the format `projects/*/locations/*/keyRings/*`.
391
418
  # @param page_size [::Integer]
392
- # Optional. Optional limit on the number of {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} to include in the
393
- # response. Further {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} can subsequently be obtained by
394
- # including the {::Google::Cloud::Kms::V1::ListCryptoKeysResponse#next_page_token ListCryptoKeysResponse.next_page_token} in a subsequent
395
- # request. If unspecified, the server will pick an appropriate default.
419
+ # Optional. Optional limit on the number of
420
+ # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} to include in the response.
421
+ # Further {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys} can subsequently be
422
+ # obtained by including the
423
+ # {::Google::Cloud::Kms::V1::ListCryptoKeysResponse#next_page_token ListCryptoKeysResponse.next_page_token}
424
+ # in a subsequent request. If unspecified, the server will pick an
425
+ # appropriate default.
396
426
  # @param page_token [::String]
397
427
  # Optional. Optional pagination token, returned earlier via
398
428
  # {::Google::Cloud::Kms::V1::ListCryptoKeysResponse#next_page_token ListCryptoKeysResponse.next_page_token}.
@@ -417,6 +447,27 @@ module Google
417
447
  #
418
448
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
419
449
  #
450
+ # @example Basic example
451
+ # require "google/cloud/kms/v1"
452
+ #
453
+ # # Create a client object. The client can be reused for multiple calls.
454
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
455
+ #
456
+ # # Create a request. To set request fields, pass in keyword arguments.
457
+ # request = Google::Cloud::Kms::V1::ListCryptoKeysRequest.new
458
+ #
459
+ # # Call the list_crypto_keys method.
460
+ # result = client.list_crypto_keys request
461
+ #
462
+ # # The returned object is of type Gapic::PagedEnumerable. You can
463
+ # # iterate over all elements by calling #each, and the enumerable
464
+ # # will lazily make API calls to fetch subsequent pages. Other
465
+ # # methods are also available for managing paging directly.
466
+ # result.each do |response|
467
+ # # Each element is of type ::Google::Cloud::Kms::V1::CryptoKey.
468
+ # p response
469
+ # end
470
+ #
420
471
  def list_crypto_keys request, options = nil
421
472
  raise ::ArgumentError, "request must be provided" if request.nil?
422
473
 
@@ -434,9 +485,11 @@ module Google
434
485
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
435
486
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
436
487
 
437
- header_params = {
438
- "parent" => request.parent
439
- }
488
+ header_params = {}
489
+ if request.parent
490
+ header_params["parent"] = request.parent
491
+ end
492
+
440
493
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
441
494
  metadata[:"x-goog-request-params"] ||= request_params_header
442
495
 
@@ -476,14 +529,17 @@ module Google
476
529
  # the default parameter values, pass an empty Hash as a request object (see above).
477
530
  #
478
531
  # @param parent [::String]
479
- # Required. The resource name of the {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to list, in the format
532
+ # Required. The resource name of the
533
+ # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to list, in the format
480
534
  # `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
481
535
  # @param page_size [::Integer]
482
- # Optional. Optional limit on the number of {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} to
483
- # include in the response. Further {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} can
484
- # subsequently be obtained by including the
485
- # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse#next_page_token ListCryptoKeyVersionsResponse.next_page_token} in a subsequent request.
486
- # If unspecified, the server will pick an appropriate default.
536
+ # Optional. Optional limit on the number of
537
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions} to include in the
538
+ # response. Further {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}
539
+ # can subsequently be obtained by including the
540
+ # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse#next_page_token ListCryptoKeyVersionsResponse.next_page_token}
541
+ # in a subsequent request. If unspecified, the server will pick an
542
+ # appropriate default.
487
543
  # @param page_token [::String]
488
544
  # Optional. Optional pagination token, returned earlier via
489
545
  # {::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse#next_page_token ListCryptoKeyVersionsResponse.next_page_token}.
@@ -508,6 +564,27 @@ module Google
508
564
  #
509
565
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
510
566
  #
567
+ # @example Basic example
568
+ # require "google/cloud/kms/v1"
569
+ #
570
+ # # Create a client object. The client can be reused for multiple calls.
571
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
572
+ #
573
+ # # Create a request. To set request fields, pass in keyword arguments.
574
+ # request = Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest.new
575
+ #
576
+ # # Call the list_crypto_key_versions method.
577
+ # result = client.list_crypto_key_versions request
578
+ #
579
+ # # The returned object is of type Gapic::PagedEnumerable. You can
580
+ # # iterate over all elements by calling #each, and the enumerable
581
+ # # will lazily make API calls to fetch subsequent pages. Other
582
+ # # methods are also available for managing paging directly.
583
+ # result.each do |response|
584
+ # # Each element is of type ::Google::Cloud::Kms::V1::CryptoKeyVersion.
585
+ # p response
586
+ # end
587
+ #
511
588
  def list_crypto_key_versions request, options = nil
512
589
  raise ::ArgumentError, "request must be provided" if request.nil?
513
590
 
@@ -525,9 +602,11 @@ module Google
525
602
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
526
603
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
527
604
 
528
- header_params = {
529
- "parent" => request.parent
530
- }
605
+ header_params = {}
606
+ if request.parent
607
+ header_params["parent"] = request.parent
608
+ end
609
+
531
610
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
532
611
  metadata[:"x-goog-request-params"] ||= request_params_header
533
612
 
@@ -567,13 +646,16 @@ module Google
567
646
  # the default parameter values, pass an empty Hash as a request object (see above).
568
647
  #
569
648
  # @param parent [::String]
570
- # Required. The resource name of the {::Google::Cloud::Kms::V1::KeyRing KeyRing} to list, in the format
571
- # `projects/*/locations/*/keyRings/*`.
649
+ # Required. The resource name of the {::Google::Cloud::Kms::V1::KeyRing KeyRing}
650
+ # to list, in the format `projects/*/locations/*/keyRings/*`.
572
651
  # @param page_size [::Integer]
573
- # Optional. Optional limit on the number of {::Google::Cloud::Kms::V1::ImportJob ImportJobs} to include in the
574
- # response. Further {::Google::Cloud::Kms::V1::ImportJob ImportJobs} can subsequently be obtained by
575
- # including the {::Google::Cloud::Kms::V1::ListImportJobsResponse#next_page_token ListImportJobsResponse.next_page_token} in a subsequent
576
- # request. If unspecified, the server will pick an appropriate default.
652
+ # Optional. Optional limit on the number of
653
+ # {::Google::Cloud::Kms::V1::ImportJob ImportJobs} to include in the response.
654
+ # Further {::Google::Cloud::Kms::V1::ImportJob ImportJobs} can subsequently be
655
+ # obtained by including the
656
+ # {::Google::Cloud::Kms::V1::ListImportJobsResponse#next_page_token ListImportJobsResponse.next_page_token}
657
+ # in a subsequent request. If unspecified, the server will pick an
658
+ # appropriate default.
577
659
  # @param page_token [::String]
578
660
  # Optional. Optional pagination token, returned earlier via
579
661
  # {::Google::Cloud::Kms::V1::ListImportJobsResponse#next_page_token ListImportJobsResponse.next_page_token}.
@@ -596,6 +678,27 @@ module Google
596
678
  #
597
679
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
598
680
  #
681
+ # @example Basic example
682
+ # require "google/cloud/kms/v1"
683
+ #
684
+ # # Create a client object. The client can be reused for multiple calls.
685
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
686
+ #
687
+ # # Create a request. To set request fields, pass in keyword arguments.
688
+ # request = Google::Cloud::Kms::V1::ListImportJobsRequest.new
689
+ #
690
+ # # Call the list_import_jobs method.
691
+ # result = client.list_import_jobs request
692
+ #
693
+ # # The returned object is of type Gapic::PagedEnumerable. You can
694
+ # # iterate over all elements by calling #each, and the enumerable
695
+ # # will lazily make API calls to fetch subsequent pages. Other
696
+ # # methods are also available for managing paging directly.
697
+ # result.each do |response|
698
+ # # Each element is of type ::Google::Cloud::Kms::V1::ImportJob.
699
+ # p response
700
+ # end
701
+ #
599
702
  def list_import_jobs request, options = nil
600
703
  raise ::ArgumentError, "request must be provided" if request.nil?
601
704
 
@@ -613,9 +716,11 @@ module Google
613
716
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
614
717
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
615
718
 
616
- header_params = {
617
- "parent" => request.parent
618
- }
719
+ header_params = {}
720
+ if request.parent
721
+ header_params["parent"] = request.parent
722
+ end
723
+
619
724
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
620
725
  metadata[:"x-goog-request-params"] ||= request_params_header
621
726
 
@@ -655,7 +760,8 @@ module Google
655
760
  # the default parameter values, pass an empty Hash as a request object (see above).
656
761
  #
657
762
  # @param name [::String]
658
- # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the {::Google::Cloud::Kms::V1::KeyRing KeyRing} to get.
763
+ # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the
764
+ # {::Google::Cloud::Kms::V1::KeyRing KeyRing} to get.
659
765
  #
660
766
  # @yield [response, operation] Access the result along with the RPC operation
661
767
  # @yieldparam response [::Google::Cloud::Kms::V1::KeyRing]
@@ -665,6 +771,21 @@ module Google
665
771
  #
666
772
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
667
773
  #
774
+ # @example Basic example
775
+ # require "google/cloud/kms/v1"
776
+ #
777
+ # # Create a client object. The client can be reused for multiple calls.
778
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
779
+ #
780
+ # # Create a request. To set request fields, pass in keyword arguments.
781
+ # request = Google::Cloud::Kms::V1::GetKeyRingRequest.new
782
+ #
783
+ # # Call the get_key_ring method.
784
+ # result = client.get_key_ring request
785
+ #
786
+ # # The returned object is of type Google::Cloud::Kms::V1::KeyRing.
787
+ # p result
788
+ #
668
789
  def get_key_ring request, options = nil
669
790
  raise ::ArgumentError, "request must be provided" if request.nil?
670
791
 
@@ -682,9 +803,11 @@ module Google
682
803
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
683
804
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
684
805
 
685
- header_params = {
686
- "name" => request.name
687
- }
806
+ header_params = {}
807
+ if request.name
808
+ header_params["name"] = request.name
809
+ end
810
+
688
811
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
689
812
  metadata[:"x-goog-request-params"] ||= request_params_header
690
813
 
@@ -705,8 +828,9 @@ module Google
705
828
  end
706
829
 
707
830
  ##
708
- # Returns metadata for a given {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}, as well as its
709
- # {::Google::Cloud::Kms::V1::CryptoKey#primary primary} {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}.
831
+ # Returns metadata for a given {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}, as
832
+ # well as its {::Google::Cloud::Kms::V1::CryptoKey#primary primary}
833
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}.
710
834
  #
711
835
  # @overload get_crypto_key(request, options = nil)
712
836
  # Pass arguments to `get_crypto_key` via a request object, either of type
@@ -724,7 +848,8 @@ module Google
724
848
  # the default parameter values, pass an empty Hash as a request object (see above).
725
849
  #
726
850
  # @param name [::String]
727
- # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to get.
851
+ # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the
852
+ # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to get.
728
853
  #
729
854
  # @yield [response, operation] Access the result along with the RPC operation
730
855
  # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKey]
@@ -734,6 +859,21 @@ module Google
734
859
  #
735
860
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
736
861
  #
862
+ # @example Basic example
863
+ # require "google/cloud/kms/v1"
864
+ #
865
+ # # Create a client object. The client can be reused for multiple calls.
866
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
867
+ #
868
+ # # Create a request. To set request fields, pass in keyword arguments.
869
+ # request = Google::Cloud::Kms::V1::GetCryptoKeyRequest.new
870
+ #
871
+ # # Call the get_crypto_key method.
872
+ # result = client.get_crypto_key request
873
+ #
874
+ # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey.
875
+ # p result
876
+ #
737
877
  def get_crypto_key request, options = nil
738
878
  raise ::ArgumentError, "request must be provided" if request.nil?
739
879
 
@@ -751,9 +891,11 @@ module Google
751
891
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
752
892
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
753
893
 
754
- header_params = {
755
- "name" => request.name
756
- }
894
+ header_params = {}
895
+ if request.name
896
+ header_params["name"] = request.name
897
+ end
898
+
757
899
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
758
900
  metadata[:"x-goog-request-params"] ||= request_params_header
759
901
 
@@ -774,7 +916,8 @@ module Google
774
916
  end
775
917
 
776
918
  ##
777
- # Returns metadata for a given {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}.
919
+ # Returns metadata for a given
920
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}.
778
921
  #
779
922
  # @overload get_crypto_key_version(request, options = nil)
780
923
  # Pass arguments to `get_crypto_key_version` via a request object, either of type
@@ -792,7 +935,8 @@ module Google
792
935
  # the default parameter values, pass an empty Hash as a request object (see above).
793
936
  #
794
937
  # @param name [::String]
795
- # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to get.
938
+ # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the
939
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to get.
796
940
  #
797
941
  # @yield [response, operation] Access the result along with the RPC operation
798
942
  # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKeyVersion]
@@ -802,6 +946,21 @@ module Google
802
946
  #
803
947
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
804
948
  #
949
+ # @example Basic example
950
+ # require "google/cloud/kms/v1"
951
+ #
952
+ # # Create a client object. The client can be reused for multiple calls.
953
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
954
+ #
955
+ # # Create a request. To set request fields, pass in keyword arguments.
956
+ # request = Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest.new
957
+ #
958
+ # # Call the get_crypto_key_version method.
959
+ # result = client.get_crypto_key_version request
960
+ #
961
+ # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion.
962
+ # p result
963
+ #
805
964
  def get_crypto_key_version request, options = nil
806
965
  raise ::ArgumentError, "request must be provided" if request.nil?
807
966
 
@@ -819,9 +978,11 @@ module Google
819
978
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
820
979
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
821
980
 
822
- header_params = {
823
- "name" => request.name
824
- }
981
+ header_params = {}
982
+ if request.name
983
+ header_params["name"] = request.name
984
+ end
985
+
825
986
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
826
987
  metadata[:"x-goog-request-params"] ||= request_params_header
827
988
 
@@ -842,9 +1003,11 @@ module Google
842
1003
  end
843
1004
 
844
1005
  ##
845
- # Returns the public key for the given {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. The
1006
+ # Returns the public key for the given
1007
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. The
846
1008
  # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be
847
- # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ASYMMETRIC_SIGN ASYMMETRIC_SIGN} or
1009
+ # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ASYMMETRIC_SIGN ASYMMETRIC_SIGN}
1010
+ # or
848
1011
  # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ASYMMETRIC_DECRYPT ASYMMETRIC_DECRYPT}.
849
1012
  #
850
1013
  # @overload get_public_key(request, options = nil)
@@ -863,8 +1026,8 @@ module Google
863
1026
  # the default parameter values, pass an empty Hash as a request object (see above).
864
1027
  #
865
1028
  # @param name [::String]
866
- # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} public key to
867
- # get.
1029
+ # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of the
1030
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} public key to get.
868
1031
  #
869
1032
  # @yield [response, operation] Access the result along with the RPC operation
870
1033
  # @yieldparam response [::Google::Cloud::Kms::V1::PublicKey]
@@ -874,6 +1037,21 @@ module Google
874
1037
  #
875
1038
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
876
1039
  #
1040
+ # @example Basic example
1041
+ # require "google/cloud/kms/v1"
1042
+ #
1043
+ # # Create a client object. The client can be reused for multiple calls.
1044
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
1045
+ #
1046
+ # # Create a request. To set request fields, pass in keyword arguments.
1047
+ # request = Google::Cloud::Kms::V1::GetPublicKeyRequest.new
1048
+ #
1049
+ # # Call the get_public_key method.
1050
+ # result = client.get_public_key request
1051
+ #
1052
+ # # The returned object is of type Google::Cloud::Kms::V1::PublicKey.
1053
+ # p result
1054
+ #
877
1055
  def get_public_key request, options = nil
878
1056
  raise ::ArgumentError, "request must be provided" if request.nil?
879
1057
 
@@ -891,9 +1069,11 @@ module Google
891
1069
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
892
1070
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
893
1071
 
894
- header_params = {
895
- "name" => request.name
896
- }
1072
+ header_params = {}
1073
+ if request.name
1074
+ header_params["name"] = request.name
1075
+ end
1076
+
897
1077
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
898
1078
  metadata[:"x-goog-request-params"] ||= request_params_header
899
1079
 
@@ -932,7 +1112,8 @@ module Google
932
1112
  # the default parameter values, pass an empty Hash as a request object (see above).
933
1113
  #
934
1114
  # @param name [::String]
935
- # Required. The {::Google::Cloud::Kms::V1::ImportJob#name name} of the {::Google::Cloud::Kms::V1::ImportJob ImportJob} to get.
1115
+ # Required. The {::Google::Cloud::Kms::V1::ImportJob#name name} of the
1116
+ # {::Google::Cloud::Kms::V1::ImportJob ImportJob} to get.
936
1117
  #
937
1118
  # @yield [response, operation] Access the result along with the RPC operation
938
1119
  # @yieldparam response [::Google::Cloud::Kms::V1::ImportJob]
@@ -942,6 +1123,21 @@ module Google
942
1123
  #
943
1124
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
944
1125
  #
1126
+ # @example Basic example
1127
+ # require "google/cloud/kms/v1"
1128
+ #
1129
+ # # Create a client object. The client can be reused for multiple calls.
1130
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
1131
+ #
1132
+ # # Create a request. To set request fields, pass in keyword arguments.
1133
+ # request = Google::Cloud::Kms::V1::GetImportJobRequest.new
1134
+ #
1135
+ # # Call the get_import_job method.
1136
+ # result = client.get_import_job request
1137
+ #
1138
+ # # The returned object is of type Google::Cloud::Kms::V1::ImportJob.
1139
+ # p result
1140
+ #
945
1141
  def get_import_job request, options = nil
946
1142
  raise ::ArgumentError, "request must be provided" if request.nil?
947
1143
 
@@ -959,9 +1155,11 @@ module Google
959
1155
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
960
1156
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
961
1157
 
962
- header_params = {
963
- "name" => request.name
964
- }
1158
+ header_params = {}
1159
+ if request.name
1160
+ header_params["name"] = request.name
1161
+ end
1162
+
965
1163
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
966
1164
  metadata[:"x-goog-request-params"] ||= request_params_header
967
1165
 
@@ -982,7 +1180,8 @@ module Google
982
1180
  end
983
1181
 
984
1182
  ##
985
- # Create a new {::Google::Cloud::Kms::V1::KeyRing KeyRing} in a given Project and Location.
1183
+ # Create a new {::Google::Cloud::Kms::V1::KeyRing KeyRing} in a given Project and
1184
+ # Location.
986
1185
  #
987
1186
  # @overload create_key_ring(request, options = nil)
988
1187
  # Pass arguments to `create_key_ring` via a request object, either of type
@@ -1001,12 +1200,14 @@ module Google
1001
1200
  #
1002
1201
  # @param parent [::String]
1003
1202
  # Required. The resource name of the location associated with the
1004
- # {::Google::Cloud::Kms::V1::KeyRing KeyRings}, in the format `projects/*/locations/*`.
1203
+ # {::Google::Cloud::Kms::V1::KeyRing KeyRings}, in the format
1204
+ # `projects/*/locations/*`.
1005
1205
  # @param key_ring_id [::String]
1006
1206
  # Required. It must be unique within a location and match the regular
1007
1207
  # expression `[a-zA-Z0-9_-]{1,63}`
1008
1208
  # @param key_ring [::Google::Cloud::Kms::V1::KeyRing, ::Hash]
1009
- # Required. A {::Google::Cloud::Kms::V1::KeyRing KeyRing} with initial field values.
1209
+ # Required. A {::Google::Cloud::Kms::V1::KeyRing KeyRing} with initial field
1210
+ # values.
1010
1211
  #
1011
1212
  # @yield [response, operation] Access the result along with the RPC operation
1012
1213
  # @yieldparam response [::Google::Cloud::Kms::V1::KeyRing]
@@ -1016,6 +1217,21 @@ module Google
1016
1217
  #
1017
1218
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1018
1219
  #
1220
+ # @example Basic example
1221
+ # require "google/cloud/kms/v1"
1222
+ #
1223
+ # # Create a client object. The client can be reused for multiple calls.
1224
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
1225
+ #
1226
+ # # Create a request. To set request fields, pass in keyword arguments.
1227
+ # request = Google::Cloud::Kms::V1::CreateKeyRingRequest.new
1228
+ #
1229
+ # # Call the create_key_ring method.
1230
+ # result = client.create_key_ring request
1231
+ #
1232
+ # # The returned object is of type Google::Cloud::Kms::V1::KeyRing.
1233
+ # p result
1234
+ #
1019
1235
  def create_key_ring request, options = nil
1020
1236
  raise ::ArgumentError, "request must be provided" if request.nil?
1021
1237
 
@@ -1033,9 +1249,11 @@ module Google
1033
1249
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
1034
1250
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1035
1251
 
1036
- header_params = {
1037
- "parent" => request.parent
1038
- }
1252
+ header_params = {}
1253
+ if request.parent
1254
+ header_params["parent"] = request.parent
1255
+ end
1256
+
1039
1257
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1040
1258
  metadata[:"x-goog-request-params"] ||= request_params_header
1041
1259
 
@@ -1056,7 +1274,8 @@ module Google
1056
1274
  end
1057
1275
 
1058
1276
  ##
1059
- # Create a new {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} within a {::Google::Cloud::Kms::V1::KeyRing KeyRing}.
1277
+ # Create a new {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} within a
1278
+ # {::Google::Cloud::Kms::V1::KeyRing KeyRing}.
1060
1279
  #
1061
1280
  # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} and
1062
1281
  # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#algorithm CryptoKey.version_template.algorithm}
@@ -1078,17 +1297,21 @@ module Google
1078
1297
  # the default parameter values, pass an empty Hash as a request object (see above).
1079
1298
  #
1080
1299
  # @param parent [::String]
1081
- # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the KeyRing associated with the
1082
- # {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}.
1300
+ # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the KeyRing
1301
+ # associated with the {::Google::Cloud::Kms::V1::CryptoKey CryptoKeys}.
1083
1302
  # @param crypto_key_id [::String]
1084
1303
  # Required. It must be unique within a KeyRing and match the regular
1085
1304
  # expression `[a-zA-Z0-9_-]{1,63}`
1086
1305
  # @param crypto_key [::Google::Cloud::Kms::V1::CryptoKey, ::Hash]
1087
- # Required. A {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} with initial field values.
1306
+ # Required. A {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} with initial field
1307
+ # values.
1088
1308
  # @param skip_initial_version_creation [::Boolean]
1089
- # If set to true, the request will create a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} without any
1090
- # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. You must manually call
1091
- # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version CreateCryptoKeyVersion} or
1309
+ # If set to true, the request will create a
1310
+ # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} without any
1311
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}. You must
1312
+ # manually call
1313
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version CreateCryptoKeyVersion}
1314
+ # or
1092
1315
  # {::Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version ImportCryptoKeyVersion}
1093
1316
  # before you can use this {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}.
1094
1317
  #
@@ -1100,6 +1323,21 @@ module Google
1100
1323
  #
1101
1324
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1102
1325
  #
1326
+ # @example Basic example
1327
+ # require "google/cloud/kms/v1"
1328
+ #
1329
+ # # Create a client object. The client can be reused for multiple calls.
1330
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
1331
+ #
1332
+ # # Create a request. To set request fields, pass in keyword arguments.
1333
+ # request = Google::Cloud::Kms::V1::CreateCryptoKeyRequest.new
1334
+ #
1335
+ # # Call the create_crypto_key method.
1336
+ # result = client.create_crypto_key request
1337
+ #
1338
+ # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey.
1339
+ # p result
1340
+ #
1103
1341
  def create_crypto_key request, options = nil
1104
1342
  raise ::ArgumentError, "request must be provided" if request.nil?
1105
1343
 
@@ -1117,9 +1355,11 @@ module Google
1117
1355
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
1118
1356
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1119
1357
 
1120
- header_params = {
1121
- "parent" => request.parent
1122
- }
1358
+ header_params = {}
1359
+ if request.parent
1360
+ header_params["parent"] = request.parent
1361
+ end
1362
+
1123
1363
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1124
1364
  metadata[:"x-goog-request-params"] ||= request_params_header
1125
1365
 
@@ -1140,7 +1380,8 @@ module Google
1140
1380
  end
1141
1381
 
1142
1382
  ##
1143
- # Create a new {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} in a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}.
1383
+ # Create a new {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} in a
1384
+ # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}.
1144
1385
  #
1145
1386
  # The server will assign the next sequential id. If unset,
1146
1387
  # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} will be set to
@@ -1162,10 +1403,12 @@ module Google
1162
1403
  # the default parameter values, pass an empty Hash as a request object (see above).
1163
1404
  #
1164
1405
  # @param parent [::String]
1165
- # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} associated with
1166
- # the {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}.
1406
+ # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the
1407
+ # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} associated with the
1408
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersions}.
1167
1409
  # @param crypto_key_version [::Google::Cloud::Kms::V1::CryptoKeyVersion, ::Hash]
1168
- # Required. A {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with initial field values.
1410
+ # Required. A {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with
1411
+ # initial field values.
1169
1412
  #
1170
1413
  # @yield [response, operation] Access the result along with the RPC operation
1171
1414
  # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKeyVersion]
@@ -1175,6 +1418,21 @@ module Google
1175
1418
  #
1176
1419
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1177
1420
  #
1421
+ # @example Basic example
1422
+ # require "google/cloud/kms/v1"
1423
+ #
1424
+ # # Create a client object. The client can be reused for multiple calls.
1425
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
1426
+ #
1427
+ # # Create a request. To set request fields, pass in keyword arguments.
1428
+ # request = Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest.new
1429
+ #
1430
+ # # Call the create_crypto_key_version method.
1431
+ # result = client.create_crypto_key_version request
1432
+ #
1433
+ # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion.
1434
+ # p result
1435
+ #
1178
1436
  def create_crypto_key_version request, options = nil
1179
1437
  raise ::ArgumentError, "request must be provided" if request.nil?
1180
1438
 
@@ -1192,9 +1450,11 @@ module Google
1192
1450
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
1193
1451
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1194
1452
 
1195
- header_params = {
1196
- "parent" => request.parent
1197
- }
1453
+ header_params = {}
1454
+ if request.parent
1455
+ header_params["parent"] = request.parent
1456
+ end
1457
+
1198
1458
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1199
1459
  metadata[:"x-goog-request-params"] ||= request_params_header
1200
1460
 
@@ -1215,12 +1475,14 @@ module Google
1215
1475
  end
1216
1476
 
1217
1477
  ##
1218
- # Import wrapped key material into a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}.
1478
+ # Import wrapped key material into a
1479
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}.
1219
1480
  #
1220
- # All requests must specify a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. If a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} is
1221
- # additionally specified in the request, key material will be reimported into
1222
- # that version. Otherwise, a new version will be created, and will be
1223
- # assigned the next sequential id within the {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}.
1481
+ # All requests must specify a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. If
1482
+ # a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} is additionally
1483
+ # specified in the request, key material will be reimported into that
1484
+ # version. Otherwise, a new version will be created, and will be assigned the
1485
+ # next sequential id within the {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}.
1224
1486
  #
1225
1487
  # @overload import_crypto_key_version(request, options = nil)
1226
1488
  # Pass arguments to `import_crypto_key_version` via a request object, either of type
@@ -1238,34 +1500,42 @@ module Google
1238
1500
  # the default parameter values, pass an empty Hash as a request object (see above).
1239
1501
  #
1240
1502
  # @param parent [::String]
1241
- # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to be imported into.
1503
+ # Required. The {::Google::Cloud::Kms::V1::CryptoKey#name name} of the
1504
+ # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to be imported into.
1242
1505
  #
1243
1506
  # The create permission is only required on this key when creating a new
1244
1507
  # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}.
1245
1508
  # @param crypto_key_version [::String]
1246
- # Optional. The optional {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of an existing
1247
- # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to target for an import operation.
1248
- # If this field is not present, a new {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} containing the
1509
+ # Optional. The optional {::Google::Cloud::Kms::V1::CryptoKeyVersion#name name} of
1510
+ # an existing {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to
1511
+ # target for an import operation. If this field is not present, a new
1512
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} containing the
1249
1513
  # supplied key material is created.
1250
1514
  #
1251
1515
  # If this field is present, the supplied key material is imported into
1252
- # the existing {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. To import into an existing
1253
- # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}, the {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} must be a child of
1254
- # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest#parent ImportCryptoKeyVersionRequest.parent}, have been previously created via
1255
- # [ImportCryptoKeyVersion][], and be in
1256
- # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED} or
1516
+ # the existing {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}. To
1517
+ # import into an existing
1518
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}, the
1519
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} must be a child of
1520
+ # {::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest#parent ImportCryptoKeyVersionRequest.parent},
1521
+ # have been previously created via [ImportCryptoKeyVersion][], and be in
1522
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED}
1523
+ # or
1257
1524
  # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::IMPORT_FAILED IMPORT_FAILED}
1258
1525
  # state. The key material and algorithm must match the previous
1259
- # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} exactly if the {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} has ever contained
1526
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} exactly if the
1527
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} has ever contained
1260
1528
  # key material.
1261
1529
  # @param algorithm [::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm]
1262
- # Required. The {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm algorithm} of
1263
- # the key being imported. This does not need to match the
1264
- # {::Google::Cloud::Kms::V1::CryptoKey#version_template version_template} of the {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} this
1265
- # version imports into.
1530
+ # Required. The
1531
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionAlgorithm algorithm}
1532
+ # of the key being imported. This does not need to match the
1533
+ # {::Google::Cloud::Kms::V1::CryptoKey#version_template version_template} of the
1534
+ # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} this version imports into.
1266
1535
  # @param import_job [::String]
1267
- # Required. The {::Google::Cloud::Kms::V1::ImportJob#name name} of the {::Google::Cloud::Kms::V1::ImportJob ImportJob} that was used to
1268
- # wrap this key material.
1536
+ # Required. The {::Google::Cloud::Kms::V1::ImportJob#name name} of the
1537
+ # {::Google::Cloud::Kms::V1::ImportJob ImportJob} that was used to wrap this key
1538
+ # material.
1269
1539
  # @param rsa_aes_wrapped_key [::String]
1270
1540
  # Wrapped key material produced with
1271
1541
  # {::Google::Cloud::Kms::V1::ImportJob::ImportMethod::RSA_OAEP_3072_SHA1_AES_256 RSA_OAEP_3072_SHA1_AES_256}
@@ -1275,8 +1545,9 @@ module Google
1275
1545
  # This field contains the concatenation of two wrapped keys:
1276
1546
  # <ol>
1277
1547
  # <li>An ephemeral AES-256 wrapping key wrapped with the
1278
- # {::Google::Cloud::Kms::V1::ImportJob#public_key public_key} using RSAES-OAEP with SHA-1,
1279
- # MGF1 with SHA-1, and an empty label.
1548
+ # {::Google::Cloud::Kms::V1::ImportJob#public_key public_key} using
1549
+ # RSAES-OAEP with SHA-1/SHA-256, MGF1 with SHA-1/SHA-256, and an
1550
+ # empty label.
1280
1551
  # </li>
1281
1552
  # <li>The key to be imported, wrapped with the ephemeral AES-256 key
1282
1553
  # using AES-KWP (RFC 5649).
@@ -1299,6 +1570,21 @@ module Google
1299
1570
  #
1300
1571
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1301
1572
  #
1573
+ # @example Basic example
1574
+ # require "google/cloud/kms/v1"
1575
+ #
1576
+ # # Create a client object. The client can be reused for multiple calls.
1577
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
1578
+ #
1579
+ # # Create a request. To set request fields, pass in keyword arguments.
1580
+ # request = Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest.new
1581
+ #
1582
+ # # Call the import_crypto_key_version method.
1583
+ # result = client.import_crypto_key_version request
1584
+ #
1585
+ # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion.
1586
+ # p result
1587
+ #
1302
1588
  def import_crypto_key_version request, options = nil
1303
1589
  raise ::ArgumentError, "request must be provided" if request.nil?
1304
1590
 
@@ -1316,9 +1602,11 @@ module Google
1316
1602
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
1317
1603
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1318
1604
 
1319
- header_params = {
1320
- "parent" => request.parent
1321
- }
1605
+ header_params = {}
1606
+ if request.parent
1607
+ header_params["parent"] = request.parent
1608
+ end
1609
+
1322
1610
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1323
1611
  metadata[:"x-goog-request-params"] ||= request_params_header
1324
1612
 
@@ -1339,9 +1627,11 @@ module Google
1339
1627
  end
1340
1628
 
1341
1629
  ##
1342
- # Create a new {::Google::Cloud::Kms::V1::ImportJob ImportJob} within a {::Google::Cloud::Kms::V1::KeyRing KeyRing}.
1630
+ # Create a new {::Google::Cloud::Kms::V1::ImportJob ImportJob} within a
1631
+ # {::Google::Cloud::Kms::V1::KeyRing KeyRing}.
1343
1632
  #
1344
- # {::Google::Cloud::Kms::V1::ImportJob#import_method ImportJob.import_method} is required.
1633
+ # {::Google::Cloud::Kms::V1::ImportJob#import_method ImportJob.import_method} is
1634
+ # required.
1345
1635
  #
1346
1636
  # @overload create_import_job(request, options = nil)
1347
1637
  # Pass arguments to `create_import_job` via a request object, either of type
@@ -1359,13 +1649,15 @@ module Google
1359
1649
  # the default parameter values, pass an empty Hash as a request object (see above).
1360
1650
  #
1361
1651
  # @param parent [::String]
1362
- # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the {::Google::Cloud::Kms::V1::KeyRing KeyRing} associated with the
1652
+ # Required. The {::Google::Cloud::Kms::V1::KeyRing#name name} of the
1653
+ # {::Google::Cloud::Kms::V1::KeyRing KeyRing} associated with the
1363
1654
  # {::Google::Cloud::Kms::V1::ImportJob ImportJobs}.
1364
1655
  # @param import_job_id [::String]
1365
1656
  # Required. It must be unique within a KeyRing and match the regular
1366
1657
  # expression `[a-zA-Z0-9_-]{1,63}`
1367
1658
  # @param import_job [::Google::Cloud::Kms::V1::ImportJob, ::Hash]
1368
- # Required. An {::Google::Cloud::Kms::V1::ImportJob ImportJob} with initial field values.
1659
+ # Required. An {::Google::Cloud::Kms::V1::ImportJob ImportJob} with initial field
1660
+ # values.
1369
1661
  #
1370
1662
  # @yield [response, operation] Access the result along with the RPC operation
1371
1663
  # @yieldparam response [::Google::Cloud::Kms::V1::ImportJob]
@@ -1375,6 +1667,21 @@ module Google
1375
1667
  #
1376
1668
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1377
1669
  #
1670
+ # @example Basic example
1671
+ # require "google/cloud/kms/v1"
1672
+ #
1673
+ # # Create a client object. The client can be reused for multiple calls.
1674
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
1675
+ #
1676
+ # # Create a request. To set request fields, pass in keyword arguments.
1677
+ # request = Google::Cloud::Kms::V1::CreateImportJobRequest.new
1678
+ #
1679
+ # # Call the create_import_job method.
1680
+ # result = client.create_import_job request
1681
+ #
1682
+ # # The returned object is of type Google::Cloud::Kms::V1::ImportJob.
1683
+ # p result
1684
+ #
1378
1685
  def create_import_job request, options = nil
1379
1686
  raise ::ArgumentError, "request must be provided" if request.nil?
1380
1687
 
@@ -1392,9 +1699,11 @@ module Google
1392
1699
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
1393
1700
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1394
1701
 
1395
- header_params = {
1396
- "parent" => request.parent
1397
- }
1702
+ header_params = {}
1703
+ if request.parent
1704
+ header_params["parent"] = request.parent
1705
+ end
1706
+
1398
1707
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1399
1708
  metadata[:"x-goog-request-params"] ||= request_params_header
1400
1709
 
@@ -1445,6 +1754,21 @@ module Google
1445
1754
  #
1446
1755
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1447
1756
  #
1757
+ # @example Basic example
1758
+ # require "google/cloud/kms/v1"
1759
+ #
1760
+ # # Create a client object. The client can be reused for multiple calls.
1761
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
1762
+ #
1763
+ # # Create a request. To set request fields, pass in keyword arguments.
1764
+ # request = Google::Cloud::Kms::V1::UpdateCryptoKeyRequest.new
1765
+ #
1766
+ # # Call the update_crypto_key method.
1767
+ # result = client.update_crypto_key request
1768
+ #
1769
+ # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey.
1770
+ # p result
1771
+ #
1448
1772
  def update_crypto_key request, options = nil
1449
1773
  raise ::ArgumentError, "request must be provided" if request.nil?
1450
1774
 
@@ -1462,9 +1786,11 @@ module Google
1462
1786
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
1463
1787
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1464
1788
 
1465
- header_params = {
1466
- "crypto_key.name" => request.crypto_key.name
1467
- }
1789
+ header_params = {}
1790
+ if request.crypto_key&.name
1791
+ header_params["crypto_key.name"] = request.crypto_key.name
1792
+ end
1793
+
1468
1794
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1469
1795
  metadata[:"x-goog-request-params"] ||= request_params_header
1470
1796
 
@@ -1485,13 +1811,18 @@ module Google
1485
1811
  end
1486
1812
 
1487
1813
  ##
1488
- # Update a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s metadata.
1814
+ # Update a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s
1815
+ # metadata.
1489
1816
  #
1490
1817
  # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} may be changed between
1491
- # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED} and
1492
- # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DISABLED DISABLED} using this
1493
- # method. See {::Google::Cloud::Kms::V1::KeyManagementService::Client#destroy_crypto_key_version DestroyCryptoKeyVersion} and {::Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version RestoreCryptoKeyVersion} to
1494
- # move between other states.
1818
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::ENABLED ENABLED}
1819
+ # and
1820
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DISABLED DISABLED}
1821
+ # using this method. See
1822
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client#destroy_crypto_key_version DestroyCryptoKeyVersion}
1823
+ # and
1824
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version RestoreCryptoKeyVersion}
1825
+ # to move between other states.
1495
1826
  #
1496
1827
  # @overload update_crypto_key_version(request, options = nil)
1497
1828
  # Pass arguments to `update_crypto_key_version` via a request object, either of type
@@ -1509,7 +1840,8 @@ module Google
1509
1840
  # the default parameter values, pass an empty Hash as a request object (see above).
1510
1841
  #
1511
1842
  # @param crypto_key_version [::Google::Cloud::Kms::V1::CryptoKeyVersion, ::Hash]
1512
- # Required. {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with updated values.
1843
+ # Required. {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with
1844
+ # updated values.
1513
1845
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1514
1846
  # Required. List of fields to be updated in this request.
1515
1847
  #
@@ -1521,6 +1853,21 @@ module Google
1521
1853
  #
1522
1854
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1523
1855
  #
1856
+ # @example Basic example
1857
+ # require "google/cloud/kms/v1"
1858
+ #
1859
+ # # Create a client object. The client can be reused for multiple calls.
1860
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
1861
+ #
1862
+ # # Create a request. To set request fields, pass in keyword arguments.
1863
+ # request = Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest.new
1864
+ #
1865
+ # # Call the update_crypto_key_version method.
1866
+ # result = client.update_crypto_key_version request
1867
+ #
1868
+ # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion.
1869
+ # p result
1870
+ #
1524
1871
  def update_crypto_key_version request, options = nil
1525
1872
  raise ::ArgumentError, "request must be provided" if request.nil?
1526
1873
 
@@ -1538,9 +1885,11 @@ module Google
1538
1885
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
1539
1886
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1540
1887
 
1541
- header_params = {
1542
- "crypto_key_version.name" => request.crypto_key_version.name
1543
- }
1888
+ header_params = {}
1889
+ if request.crypto_key_version&.name
1890
+ header_params["crypto_key_version.name"] = request.crypto_key_version.name
1891
+ end
1892
+
1544
1893
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1545
1894
  metadata[:"x-goog-request-params"] ||= request_params_header
1546
1895
 
@@ -1561,7 +1910,9 @@ module Google
1561
1910
  end
1562
1911
 
1563
1912
  ##
1564
- # Update the version of a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} that will be used in {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt Encrypt}.
1913
+ # Update the version of a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} that
1914
+ # will be used in
1915
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt Encrypt}.
1565
1916
  #
1566
1917
  # Returns an error if called on a key whose purpose is not
1567
1918
  # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}.
@@ -1582,9 +1933,11 @@ module Google
1582
1933
  # the default parameter values, pass an empty Hash as a request object (see above).
1583
1934
  #
1584
1935
  # @param name [::String]
1585
- # Required. The resource name of the {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to update.
1936
+ # Required. The resource name of the
1937
+ # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to update.
1586
1938
  # @param crypto_key_version_id [::String]
1587
- # Required. The id of the child {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use as primary.
1939
+ # Required. The id of the child
1940
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use as primary.
1588
1941
  #
1589
1942
  # @yield [response, operation] Access the result along with the RPC operation
1590
1943
  # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKey]
@@ -1594,6 +1947,21 @@ module Google
1594
1947
  #
1595
1948
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1596
1949
  #
1950
+ # @example Basic example
1951
+ # require "google/cloud/kms/v1"
1952
+ #
1953
+ # # Create a client object. The client can be reused for multiple calls.
1954
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
1955
+ #
1956
+ # # Create a request. To set request fields, pass in keyword arguments.
1957
+ # request = Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest.new
1958
+ #
1959
+ # # Call the update_crypto_key_primary_version method.
1960
+ # result = client.update_crypto_key_primary_version request
1961
+ #
1962
+ # # The returned object is of type Google::Cloud::Kms::V1::CryptoKey.
1963
+ # p result
1964
+ #
1597
1965
  def update_crypto_key_primary_version request, options = nil
1598
1966
  raise ::ArgumentError, "request must be provided" if request.nil?
1599
1967
 
@@ -1611,9 +1979,11 @@ module Google
1611
1979
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
1612
1980
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1613
1981
 
1614
- header_params = {
1615
- "name" => request.name
1616
- }
1982
+ header_params = {}
1983
+ if request.name
1984
+ header_params["name"] = request.name
1985
+ end
1986
+
1617
1987
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1618
1988
  metadata[:"x-goog-request-params"] ||= request_params_header
1619
1989
 
@@ -1634,19 +2004,27 @@ module Google
1634
2004
  end
1635
2005
 
1636
2006
  ##
1637
- # Schedule a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} for destruction.
2007
+ # Schedule a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} for
2008
+ # destruction.
1638
2009
  #
1639
- # Upon calling this method, {::Google::Cloud::Kms::V1::CryptoKeyVersion#state CryptoKeyVersion.state} will be set to
2010
+ # Upon calling this method,
2011
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state CryptoKeyVersion.state} will
2012
+ # be set to
1640
2013
  # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROY_SCHEDULED DESTROY_SCHEDULED},
1641
- # and {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} will be set to the time
1642
- # {::Google::Cloud::Kms::V1::CryptoKey#destroy_scheduled_duration destroy_scheduled_duration} in the
1643
- # future. At that time, the {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} will
1644
- # automatically change to
1645
- # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED}, and the key
1646
- # material will be irrevocably destroyed.
1647
- #
1648
- # Before the {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} is reached,
1649
- # {::Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version RestoreCryptoKeyVersion} may be called to reverse the process.
2014
+ # and {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} will
2015
+ # be set to the time
2016
+ # {::Google::Cloud::Kms::V1::CryptoKey#destroy_scheduled_duration destroy_scheduled_duration}
2017
+ # in the future. At that time, the
2018
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} will automatically
2019
+ # change to
2020
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED},
2021
+ # and the key material will be irrevocably destroyed.
2022
+ #
2023
+ # Before the
2024
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} is
2025
+ # reached,
2026
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version RestoreCryptoKeyVersion}
2027
+ # may be called to reverse the process.
1650
2028
  #
1651
2029
  # @overload destroy_crypto_key_version(request, options = nil)
1652
2030
  # Pass arguments to `destroy_crypto_key_version` via a request object, either of type
@@ -1664,7 +2042,8 @@ module Google
1664
2042
  # the default parameter values, pass an empty Hash as a request object (see above).
1665
2043
  #
1666
2044
  # @param name [::String]
1667
- # Required. The resource name of the {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to destroy.
2045
+ # Required. The resource name of the
2046
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to destroy.
1668
2047
  #
1669
2048
  # @yield [response, operation] Access the result along with the RPC operation
1670
2049
  # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKeyVersion]
@@ -1674,6 +2053,21 @@ module Google
1674
2053
  #
1675
2054
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1676
2055
  #
2056
+ # @example Basic example
2057
+ # require "google/cloud/kms/v1"
2058
+ #
2059
+ # # Create a client object. The client can be reused for multiple calls.
2060
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
2061
+ #
2062
+ # # Create a request. To set request fields, pass in keyword arguments.
2063
+ # request = Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest.new
2064
+ #
2065
+ # # Call the destroy_crypto_key_version method.
2066
+ # result = client.destroy_crypto_key_version request
2067
+ #
2068
+ # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion.
2069
+ # p result
2070
+ #
1677
2071
  def destroy_crypto_key_version request, options = nil
1678
2072
  raise ::ArgumentError, "request must be provided" if request.nil?
1679
2073
 
@@ -1691,9 +2085,11 @@ module Google
1691
2085
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
1692
2086
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1693
2087
 
1694
- header_params = {
1695
- "name" => request.name
1696
- }
2088
+ header_params = {}
2089
+ if request.name
2090
+ header_params["name"] = request.name
2091
+ end
2092
+
1697
2093
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1698
2094
  metadata[:"x-goog-request-params"] ||= request_params_header
1699
2095
 
@@ -1718,9 +2114,11 @@ module Google
1718
2114
  # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROY_SCHEDULED DESTROY_SCHEDULED}
1719
2115
  # state.
1720
2116
  #
1721
- # Upon restoration of the CryptoKeyVersion, {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state}
1722
- # will be set to {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DISABLED DISABLED},
1723
- # and {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} will be cleared.
2117
+ # Upon restoration of the CryptoKeyVersion,
2118
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state} will be set to
2119
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DISABLED DISABLED},
2120
+ # and {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} will
2121
+ # be cleared.
1724
2122
  #
1725
2123
  # @overload restore_crypto_key_version(request, options = nil)
1726
2124
  # Pass arguments to `restore_crypto_key_version` via a request object, either of type
@@ -1738,7 +2136,8 @@ module Google
1738
2136
  # the default parameter values, pass an empty Hash as a request object (see above).
1739
2137
  #
1740
2138
  # @param name [::String]
1741
- # Required. The resource name of the {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to restore.
2139
+ # Required. The resource name of the
2140
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to restore.
1742
2141
  #
1743
2142
  # @yield [response, operation] Access the result along with the RPC operation
1744
2143
  # @yieldparam response [::Google::Cloud::Kms::V1::CryptoKeyVersion]
@@ -1748,6 +2147,21 @@ module Google
1748
2147
  #
1749
2148
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1750
2149
  #
2150
+ # @example Basic example
2151
+ # require "google/cloud/kms/v1"
2152
+ #
2153
+ # # Create a client object. The client can be reused for multiple calls.
2154
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
2155
+ #
2156
+ # # Create a request. To set request fields, pass in keyword arguments.
2157
+ # request = Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest.new
2158
+ #
2159
+ # # Call the restore_crypto_key_version method.
2160
+ # result = client.restore_crypto_key_version request
2161
+ #
2162
+ # # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion.
2163
+ # p result
2164
+ #
1751
2165
  def restore_crypto_key_version request, options = nil
1752
2166
  raise ::ArgumentError, "request must be provided" if request.nil?
1753
2167
 
@@ -1765,9 +2179,11 @@ module Google
1765
2179
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
1766
2180
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1767
2181
 
1768
- header_params = {
1769
- "name" => request.name
1770
- }
2182
+ header_params = {}
2183
+ if request.name
2184
+ header_params["name"] = request.name
2185
+ end
2186
+
1771
2187
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1772
2188
  metadata[:"x-goog-request-params"] ||= request_params_header
1773
2189
 
@@ -1788,8 +2204,9 @@ module Google
1788
2204
  end
1789
2205
 
1790
2206
  ##
1791
- # Encrypts data, so that it can only be recovered by a call to {::Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt Decrypt}.
1792
- # The {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be
2207
+ # Encrypts data, so that it can only be recovered by a call to
2208
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt Decrypt}. The
2209
+ # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be
1793
2210
  # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}.
1794
2211
  #
1795
2212
  # @overload encrypt(request, options = nil)
@@ -1808,59 +2225,75 @@ module Google
1808
2225
  # the default parameter values, pass an empty Hash as a request object (see above).
1809
2226
  #
1810
2227
  # @param name [::String]
1811
- # Required. The resource name of the {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} or {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}
1812
- # to use for encryption.
2228
+ # Required. The resource name of the
2229
+ # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} or
2230
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for
2231
+ # encryption.
1813
2232
  #
1814
- # If a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} is specified, the server will use its
1815
- # {::Google::Cloud::Kms::V1::CryptoKey#primary primary version}.
2233
+ # If a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} is specified, the server
2234
+ # will use its {::Google::Cloud::Kms::V1::CryptoKey#primary primary version}.
1816
2235
  # @param plaintext [::String]
1817
2236
  # Required. The data to encrypt. Must be no larger than 64KiB.
1818
2237
  #
1819
2238
  # The maximum size depends on the key version's
1820
- # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. For
1821
- # {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE} keys, the plaintext must be no larger
1822
- # than 64KiB. For {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of the
1823
- # plaintext and additional_authenticated_data fields must be no larger than
1824
- # 8KiB.
2239
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}.
2240
+ # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE} keys, the
2241
+ # plaintext must be no larger than 64KiB. For
2242
+ # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of
2243
+ # the plaintext and additional_authenticated_data fields must be no larger
2244
+ # than 8KiB.
1825
2245
  # @param additional_authenticated_data [::String]
1826
- # Optional. Optional data that, if specified, must also be provided during decryption
1827
- # through {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}.
2246
+ # Optional. Optional data that, if specified, must also be provided during
2247
+ # decryption through
2248
+ # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}.
1828
2249
  #
1829
2250
  # The maximum size depends on the key version's
1830
- # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}. For
1831
- # {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE} keys, the AAD must be no larger than
1832
- # 64KiB. For {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of the
1833
- # plaintext and additional_authenticated_data fields must be no larger than
1834
- # 8KiB.
2251
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersionTemplate#protection_level protection_level}.
2252
+ # For {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE} keys, the AAD
2253
+ # must be no larger than 64KiB. For
2254
+ # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} keys, the combined length of
2255
+ # the plaintext and additional_authenticated_data fields must be no larger
2256
+ # than 8KiB.
1835
2257
  # @param plaintext_crc32c [::Google::Protobuf::Int64Value, ::Hash]
1836
- # Optional. An optional CRC32C checksum of the {::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext}. If
1837
- # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will verify the integrity of the
1838
- # received {::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext} using this checksum.
1839
- # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will report an error if the checksum verification
1840
- # fails. If you receive a checksum error, your client should verify that
1841
- # CRC32C({::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext}) is equal to
1842
- # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext_crc32c EncryptRequest.plaintext_crc32c}, and if so, perform a limited number of
1843
- # retries. A persistent mismatch may indicate an issue in your computation of
1844
- # the CRC32C checksum.
1845
- # Note: This field is defined as int64 for reasons of compatibility across
1846
- # different languages. However, it is a non-negative integer, which will
1847
- # never exceed 2^32-1, and can be safely downconverted to uint32 in languages
1848
- # that support this type.
2258
+ # Optional. An optional CRC32C checksum of the
2259
+ # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext}.
2260
+ # If specified,
2261
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will
2262
+ # verify the integrity of the received
2263
+ # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext}
2264
+ # using this checksum.
2265
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will
2266
+ # report an error if the checksum verification fails. If you receive a
2267
+ # checksum error, your client should verify that
2268
+ # CRC32C({::Google::Cloud::Kms::V1::EncryptRequest#plaintext EncryptRequest.plaintext})
2269
+ # is equal to
2270
+ # {::Google::Cloud::Kms::V1::EncryptRequest#plaintext_crc32c EncryptRequest.plaintext_crc32c},
2271
+ # and if so, perform a limited number of retries. A persistent mismatch may
2272
+ # indicate an issue in your computation of the CRC32C checksum. Note: This
2273
+ # field is defined as int64 for reasons of compatibility across different
2274
+ # languages. However, it is a non-negative integer, which will never exceed
2275
+ # 2^32-1, and can be safely downconverted to uint32 in languages that support
2276
+ # this type.
1849
2277
  # @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash]
1850
2278
  # Optional. An optional CRC32C checksum of the
1851
- # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}. If specified,
1852
- # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will verify the integrity of the received
1853
- # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data} using this checksum.
1854
- # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will report an error if the checksum verification
1855
- # fails. If you receive a checksum error, your client should verify that
1856
- # CRC32C({::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}) is equal to
1857
- # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data_crc32c EncryptRequest.additional_authenticated_data_crc32c}, and if so, perform
1858
- # a limited number of retries. A persistent mismatch may indicate an issue in
1859
- # your computation of the CRC32C checksum.
1860
- # Note: This field is defined as int64 for reasons of compatibility across
1861
- # different languages. However, it is a non-negative integer, which will
1862
- # never exceed 2^32-1, and can be safely downconverted to uint32 in languages
1863
- # that support this type.
2279
+ # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}.
2280
+ # If specified,
2281
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will
2282
+ # verify the integrity of the received
2283
+ # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}
2284
+ # using this checksum.
2285
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will
2286
+ # report an error if the checksum verification fails. If you receive a
2287
+ # checksum error, your client should verify that
2288
+ # CRC32C({::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data})
2289
+ # is equal to
2290
+ # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data_crc32c EncryptRequest.additional_authenticated_data_crc32c},
2291
+ # and if so, perform a limited number of retries. A persistent mismatch may
2292
+ # indicate an issue in your computation of the CRC32C checksum. Note: This
2293
+ # field is defined as int64 for reasons of compatibility across different
2294
+ # languages. However, it is a non-negative integer, which will never exceed
2295
+ # 2^32-1, and can be safely downconverted to uint32 in languages that support
2296
+ # this type.
1864
2297
  #
1865
2298
  # @yield [response, operation] Access the result along with the RPC operation
1866
2299
  # @yieldparam response [::Google::Cloud::Kms::V1::EncryptResponse]
@@ -1870,6 +2303,21 @@ module Google
1870
2303
  #
1871
2304
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1872
2305
  #
2306
+ # @example Basic example
2307
+ # require "google/cloud/kms/v1"
2308
+ #
2309
+ # # Create a client object. The client can be reused for multiple calls.
2310
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
2311
+ #
2312
+ # # Create a request. To set request fields, pass in keyword arguments.
2313
+ # request = Google::Cloud::Kms::V1::EncryptRequest.new
2314
+ #
2315
+ # # Call the encrypt method.
2316
+ # result = client.encrypt request
2317
+ #
2318
+ # # The returned object is of type Google::Cloud::Kms::V1::EncryptResponse.
2319
+ # p result
2320
+ #
1873
2321
  def encrypt request, options = nil
1874
2322
  raise ::ArgumentError, "request must be provided" if request.nil?
1875
2323
 
@@ -1887,9 +2335,11 @@ module Google
1887
2335
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
1888
2336
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1889
2337
 
1890
- header_params = {
1891
- "name" => request.name
1892
- }
2338
+ header_params = {}
2339
+ if request.name
2340
+ header_params["name"] = request.name
2341
+ end
2342
+
1893
2343
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1894
2344
  metadata[:"x-goog-request-params"] ||= request_params_header
1895
2345
 
@@ -1910,8 +2360,10 @@ module Google
1910
2360
  end
1911
2361
 
1912
2362
  ##
1913
- # Decrypts data that was protected by {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt Encrypt}. The {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose}
1914
- # must be {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}.
2363
+ # Decrypts data that was protected by
2364
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt Encrypt}. The
2365
+ # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be
2366
+ # {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}.
1915
2367
  #
1916
2368
  # @overload decrypt(request, options = nil)
1917
2369
  # Pass arguments to `decrypt` via a request object, either of type
@@ -1929,8 +2381,9 @@ module Google
1929
2381
  # the default parameter values, pass an empty Hash as a request object (see above).
1930
2382
  #
1931
2383
  # @param name [::String]
1932
- # Required. The resource name of the {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to use for decryption.
1933
- # The server will choose the appropriate version.
2384
+ # Required. The resource name of the
2385
+ # {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to use for decryption. The
2386
+ # server will choose the appropriate version.
1934
2387
  # @param ciphertext [::String]
1935
2388
  # Required. The encrypted data originally returned in
1936
2389
  # {::Google::Cloud::Kms::V1::EncryptResponse#ciphertext EncryptResponse.ciphertext}.
@@ -1938,34 +2391,45 @@ module Google
1938
2391
  # Optional. Optional data that must match the data originally supplied in
1939
2392
  # {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}.
1940
2393
  # @param ciphertext_crc32c [::Google::Protobuf::Int64Value, ::Hash]
1941
- # Optional. An optional CRC32C checksum of the {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext}. If
1942
- # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will verify the integrity of the
1943
- # received {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext} using this checksum.
1944
- # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will report an error if the checksum verification
1945
- # fails. If you receive a checksum error, your client should verify that
1946
- # CRC32C({::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext}) is equal to
1947
- # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext_crc32c DecryptRequest.ciphertext_crc32c}, and if so, perform a limited number
1948
- # of retries. A persistent mismatch may indicate an issue in your computation
1949
- # of the CRC32C checksum.
1950
- # Note: This field is defined as int64 for reasons of compatibility across
1951
- # different languages. However, it is a non-negative integer, which will
1952
- # never exceed 2^32-1, and can be safely downconverted to uint32 in languages
1953
- # that support this type.
2394
+ # Optional. An optional CRC32C checksum of the
2395
+ # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext}.
2396
+ # If specified,
2397
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will
2398
+ # verify the integrity of the received
2399
+ # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext}
2400
+ # using this checksum.
2401
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will
2402
+ # report an error if the checksum verification fails. If you receive a
2403
+ # checksum error, your client should verify that
2404
+ # CRC32C({::Google::Cloud::Kms::V1::DecryptRequest#ciphertext DecryptRequest.ciphertext})
2405
+ # is equal to
2406
+ # {::Google::Cloud::Kms::V1::DecryptRequest#ciphertext_crc32c DecryptRequest.ciphertext_crc32c},
2407
+ # and if so, perform a limited number of retries. A persistent mismatch may
2408
+ # indicate an issue in your computation of the CRC32C checksum. Note: This
2409
+ # field is defined as int64 for reasons of compatibility across different
2410
+ # languages. However, it is a non-negative integer, which will never exceed
2411
+ # 2^32-1, and can be safely downconverted to uint32 in languages that support
2412
+ # this type.
1954
2413
  # @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash]
1955
2414
  # Optional. An optional CRC32C checksum of the
1956
- # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}. If specified,
1957
- # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will verify the integrity of the received
1958
- # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data} using this checksum.
1959
- # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will report an error if the checksum verification
1960
- # fails. If you receive a checksum error, your client should verify that
1961
- # CRC32C({::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}) is equal to
1962
- # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data_crc32c DecryptRequest.additional_authenticated_data_crc32c}, and if so, perform
1963
- # a limited number of retries. A persistent mismatch may indicate an issue in
1964
- # your computation of the CRC32C checksum.
1965
- # Note: This field is defined as int64 for reasons of compatibility across
1966
- # different languages. However, it is a non-negative integer, which will
1967
- # never exceed 2^32-1, and can be safely downconverted to uint32 in languages
1968
- # that support this type.
2415
+ # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}.
2416
+ # If specified,
2417
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will
2418
+ # verify the integrity of the received
2419
+ # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}
2420
+ # using this checksum.
2421
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will
2422
+ # report an error if the checksum verification fails. If you receive a
2423
+ # checksum error, your client should verify that
2424
+ # CRC32C({::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data})
2425
+ # is equal to
2426
+ # {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data_crc32c DecryptRequest.additional_authenticated_data_crc32c},
2427
+ # and if so, perform a limited number of retries. A persistent mismatch may
2428
+ # indicate an issue in your computation of the CRC32C checksum. Note: This
2429
+ # field is defined as int64 for reasons of compatibility across different
2430
+ # languages. However, it is a non-negative integer, which will never exceed
2431
+ # 2^32-1, and can be safely downconverted to uint32 in languages that support
2432
+ # this type.
1969
2433
  #
1970
2434
  # @yield [response, operation] Access the result along with the RPC operation
1971
2435
  # @yieldparam response [::Google::Cloud::Kms::V1::DecryptResponse]
@@ -1975,6 +2439,21 @@ module Google
1975
2439
  #
1976
2440
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1977
2441
  #
2442
+ # @example Basic example
2443
+ # require "google/cloud/kms/v1"
2444
+ #
2445
+ # # Create a client object. The client can be reused for multiple calls.
2446
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
2447
+ #
2448
+ # # Create a request. To set request fields, pass in keyword arguments.
2449
+ # request = Google::Cloud::Kms::V1::DecryptRequest.new
2450
+ #
2451
+ # # Call the decrypt method.
2452
+ # result = client.decrypt request
2453
+ #
2454
+ # # The returned object is of type Google::Cloud::Kms::V1::DecryptResponse.
2455
+ # p result
2456
+ #
1978
2457
  def decrypt request, options = nil
1979
2458
  raise ::ArgumentError, "request must be provided" if request.nil?
1980
2459
 
@@ -1992,9 +2471,11 @@ module Google
1992
2471
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
1993
2472
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1994
2473
 
1995
- header_params = {
1996
- "name" => request.name
1997
- }
2474
+ header_params = {}
2475
+ if request.name
2476
+ header_params["name"] = request.name
2477
+ end
2478
+
1998
2479
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1999
2480
  metadata[:"x-goog-request-params"] ||= request_params_header
2000
2481
 
@@ -2015,9 +2496,11 @@ module Google
2015
2496
  end
2016
2497
 
2017
2498
  ##
2018
- # Signs data using a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose}
2499
+ # Signs data using a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}
2500
+ # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose}
2019
2501
  # ASYMMETRIC_SIGN, producing a signature that can be verified with the public
2020
- # key retrieved from {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key GetPublicKey}.
2502
+ # key retrieved from
2503
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key GetPublicKey}.
2021
2504
  #
2022
2505
  # @overload asymmetric_sign(request, options = nil)
2023
2506
  # Pass arguments to `asymmetric_sign` via a request object, either of type
@@ -2029,31 +2512,68 @@ module Google
2029
2512
  # @param options [::Gapic::CallOptions, ::Hash]
2030
2513
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2031
2514
  #
2032
- # @overload asymmetric_sign(name: nil, digest: nil, digest_crc32c: nil)
2515
+ # @overload asymmetric_sign(name: nil, digest: nil, digest_crc32c: nil, data: nil, data_crc32c: nil)
2033
2516
  # Pass arguments to `asymmetric_sign` via keyword arguments. Note that at
2034
2517
  # least one keyword argument is required. To specify no parameters, or to keep all
2035
2518
  # the default parameter values, pass an empty Hash as a request object (see above).
2036
2519
  #
2037
2520
  # @param name [::String]
2038
- # Required. The resource name of the {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for signing.
2521
+ # Required. The resource name of the
2522
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for
2523
+ # signing.
2039
2524
  # @param digest [::Google::Cloud::Kms::V1::Digest, ::Hash]
2040
- # Required. The digest of the data to sign. The digest must be produced with
2525
+ # Optional. The digest of the data to sign. The digest must be produced with
2041
2526
  # the same digest algorithm as specified by the key version's
2042
2527
  # {::Google::Cloud::Kms::V1::CryptoKeyVersion#algorithm algorithm}.
2528
+ #
2529
+ # This field may not be supplied if
2530
+ # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data}
2531
+ # is supplied.
2043
2532
  # @param digest_crc32c [::Google::Protobuf::Int64Value, ::Hash]
2044
- # Optional. An optional CRC32C checksum of the {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest}. If
2045
- # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will verify the integrity of the
2046
- # received {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest} using this checksum.
2047
- # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will report an error if the checksum verification
2048
- # fails. If you receive a checksum error, your client should verify that
2049
- # CRC32C({::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest}) is equal to
2050
- # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest_crc32c AsymmetricSignRequest.digest_crc32c}, and if so, perform a limited
2051
- # number of retries. A persistent mismatch may indicate an issue in your
2052
- # computation of the CRC32C checksum.
2053
- # Note: This field is defined as int64 for reasons of compatibility across
2054
- # different languages. However, it is a non-negative integer, which will
2055
- # never exceed 2^32-1, and can be safely downconverted to uint32 in languages
2056
- # that support this type.
2533
+ # Optional. An optional CRC32C checksum of the
2534
+ # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest}.
2535
+ # If specified,
2536
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will
2537
+ # verify the integrity of the received
2538
+ # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest}
2539
+ # using this checksum.
2540
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will
2541
+ # report an error if the checksum verification fails. If you receive a
2542
+ # checksum error, your client should verify that
2543
+ # CRC32C({::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest})
2544
+ # is equal to
2545
+ # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest_crc32c AsymmetricSignRequest.digest_crc32c},
2546
+ # and if so, perform a limited number of retries. A persistent mismatch may
2547
+ # indicate an issue in your computation of the CRC32C checksum. Note: This
2548
+ # field is defined as int64 for reasons of compatibility across different
2549
+ # languages. However, it is a non-negative integer, which will never exceed
2550
+ # 2^32-1, and can be safely downconverted to uint32 in languages that support
2551
+ # this type.
2552
+ # @param data [::String]
2553
+ # Optional. The data to sign.
2554
+ # It can't be supplied if
2555
+ # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#digest AsymmetricSignRequest.digest}
2556
+ # is supplied.
2557
+ # @param data_crc32c [::Google::Protobuf::Int64Value, ::Hash]
2558
+ # Optional. An optional CRC32C checksum of the
2559
+ # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data}.
2560
+ # If specified,
2561
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will
2562
+ # verify the integrity of the received
2563
+ # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data}
2564
+ # using this checksum.
2565
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will
2566
+ # report an error if the checksum verification fails. If you receive a
2567
+ # checksum error, your client should verify that
2568
+ # CRC32C({::Google::Cloud::Kms::V1::AsymmetricSignRequest#data AsymmetricSignRequest.data})
2569
+ # is equal to
2570
+ # {::Google::Cloud::Kms::V1::AsymmetricSignRequest#data_crc32c AsymmetricSignRequest.data_crc32c},
2571
+ # and if so, perform a limited number of retries. A persistent mismatch may
2572
+ # indicate an issue in your computation of the CRC32C checksum. Note: This
2573
+ # field is defined as int64 for reasons of compatibility across different
2574
+ # languages. However, it is a non-negative integer, which will never exceed
2575
+ # 2^32-1, and can be safely downconverted to uint32 in languages that support
2576
+ # this type.
2057
2577
  #
2058
2578
  # @yield [response, operation] Access the result along with the RPC operation
2059
2579
  # @yieldparam response [::Google::Cloud::Kms::V1::AsymmetricSignResponse]
@@ -2063,6 +2583,21 @@ module Google
2063
2583
  #
2064
2584
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2065
2585
  #
2586
+ # @example Basic example
2587
+ # require "google/cloud/kms/v1"
2588
+ #
2589
+ # # Create a client object. The client can be reused for multiple calls.
2590
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
2591
+ #
2592
+ # # Create a request. To set request fields, pass in keyword arguments.
2593
+ # request = Google::Cloud::Kms::V1::AsymmetricSignRequest.new
2594
+ #
2595
+ # # Call the asymmetric_sign method.
2596
+ # result = client.asymmetric_sign request
2597
+ #
2598
+ # # The returned object is of type Google::Cloud::Kms::V1::AsymmetricSignResponse.
2599
+ # p result
2600
+ #
2066
2601
  def asymmetric_sign request, options = nil
2067
2602
  raise ::ArgumentError, "request must be provided" if request.nil?
2068
2603
 
@@ -2080,9 +2615,11 @@ module Google
2080
2615
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
2081
2616
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2082
2617
 
2083
- header_params = {
2084
- "name" => request.name
2085
- }
2618
+ header_params = {}
2619
+ if request.name
2620
+ header_params["name"] = request.name
2621
+ end
2622
+
2086
2623
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2087
2624
  metadata[:"x-goog-request-params"] ||= request_params_header
2088
2625
 
@@ -2104,8 +2641,10 @@ module Google
2104
2641
 
2105
2642
  ##
2106
2643
  # Decrypts data that was encrypted with a public key retrieved from
2107
- # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key GetPublicKey} corresponding to a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with
2108
- # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} ASYMMETRIC_DECRYPT.
2644
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key GetPublicKey}
2645
+ # corresponding to a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}
2646
+ # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose}
2647
+ # ASYMMETRIC_DECRYPT.
2109
2648
  #
2110
2649
  # @overload asymmetric_decrypt(request, options = nil)
2111
2650
  # Pass arguments to `asymmetric_decrypt` via a request object, either of type
@@ -2123,25 +2662,33 @@ module Google
2123
2662
  # the default parameter values, pass an empty Hash as a request object (see above).
2124
2663
  #
2125
2664
  # @param name [::String]
2126
- # Required. The resource name of the {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for
2665
+ # Required. The resource name of the
2666
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for
2127
2667
  # decryption.
2128
2668
  # @param ciphertext [::String]
2129
- # Required. The data encrypted with the named {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s public
2130
- # key using OAEP.
2669
+ # Required. The data encrypted with the named
2670
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}'s public key using
2671
+ # OAEP.
2131
2672
  # @param ciphertext_crc32c [::Google::Protobuf::Int64Value, ::Hash]
2132
- # Optional. An optional CRC32C checksum of the {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext}.
2133
- # If specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will verify the integrity of the
2134
- # received {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext} using this checksum.
2135
- # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will report an error if the checksum verification
2136
- # fails. If you receive a checksum error, your client should verify that
2137
- # CRC32C({::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext}) is equal to
2138
- # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext_crc32c AsymmetricDecryptRequest.ciphertext_crc32c}, and if so, perform a
2139
- # limited number of retries. A persistent mismatch may indicate an issue in
2140
- # your computation of the CRC32C checksum.
2141
- # Note: This field is defined as int64 for reasons of compatibility across
2142
- # different languages. However, it is a non-negative integer, which will
2143
- # never exceed 2^32-1, and can be safely downconverted to uint32 in languages
2144
- # that support this type.
2673
+ # Optional. An optional CRC32C checksum of the
2674
+ # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext}.
2675
+ # If specified,
2676
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will
2677
+ # verify the integrity of the received
2678
+ # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext}
2679
+ # using this checksum.
2680
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will
2681
+ # report an error if the checksum verification fails. If you receive a
2682
+ # checksum error, your client should verify that
2683
+ # CRC32C({::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext AsymmetricDecryptRequest.ciphertext})
2684
+ # is equal to
2685
+ # {::Google::Cloud::Kms::V1::AsymmetricDecryptRequest#ciphertext_crc32c AsymmetricDecryptRequest.ciphertext_crc32c},
2686
+ # and if so, perform a limited number of retries. A persistent mismatch may
2687
+ # indicate an issue in your computation of the CRC32C checksum. Note: This
2688
+ # field is defined as int64 for reasons of compatibility across different
2689
+ # languages. However, it is a non-negative integer, which will never exceed
2690
+ # 2^32-1, and can be safely downconverted to uint32 in languages that support
2691
+ # this type.
2145
2692
  #
2146
2693
  # @yield [response, operation] Access the result along with the RPC operation
2147
2694
  # @yieldparam response [::Google::Cloud::Kms::V1::AsymmetricDecryptResponse]
@@ -2151,6 +2698,21 @@ module Google
2151
2698
  #
2152
2699
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2153
2700
  #
2701
+ # @example Basic example
2702
+ # require "google/cloud/kms/v1"
2703
+ #
2704
+ # # Create a client object. The client can be reused for multiple calls.
2705
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
2706
+ #
2707
+ # # Create a request. To set request fields, pass in keyword arguments.
2708
+ # request = Google::Cloud::Kms::V1::AsymmetricDecryptRequest.new
2709
+ #
2710
+ # # Call the asymmetric_decrypt method.
2711
+ # result = client.asymmetric_decrypt request
2712
+ #
2713
+ # # The returned object is of type Google::Cloud::Kms::V1::AsymmetricDecryptResponse.
2714
+ # p result
2715
+ #
2154
2716
  def asymmetric_decrypt request, options = nil
2155
2717
  raise ::ArgumentError, "request must be provided" if request.nil?
2156
2718
 
@@ -2168,9 +2730,11 @@ module Google
2168
2730
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
2169
2731
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2170
2732
 
2171
- header_params = {
2172
- "name" => request.name
2173
- }
2733
+ header_params = {}
2734
+ if request.name
2735
+ header_params["name"] = request.name
2736
+ end
2737
+
2174
2738
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2175
2739
  metadata[:"x-goog-request-params"] ||= request_params_header
2176
2740
 
@@ -2191,9 +2755,9 @@ module Google
2191
2755
  end
2192
2756
 
2193
2757
  ##
2194
- # Signs data using a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose}
2195
- # MAC, producing a tag that can be verified by another source with the
2196
- # same key.
2758
+ # Signs data using a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion}
2759
+ # with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} MAC,
2760
+ # producing a tag that can be verified by another source with the same key.
2197
2761
  #
2198
2762
  # @overload mac_sign(request, options = nil)
2199
2763
  # Pass arguments to `mac_sign` via a request object, either of type
@@ -2211,24 +2775,30 @@ module Google
2211
2775
  # the default parameter values, pass an empty Hash as a request object (see above).
2212
2776
  #
2213
2777
  # @param name [::String]
2214
- # Required. The resource name of the {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for signing.
2778
+ # Required. The resource name of the
2779
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for
2780
+ # signing.
2215
2781
  # @param data [::String]
2216
- # Required. The data to sign. The MAC tag is computed over this data field based on
2217
- # the specific algorithm.
2782
+ # Required. The data to sign. The MAC tag is computed over this data field
2783
+ # based on the specific algorithm.
2218
2784
  # @param data_crc32c [::Google::Protobuf::Int64Value, ::Hash]
2219
- # Optional. An optional CRC32C checksum of the {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data}. If
2220
- # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will verify the integrity of the
2221
- # received {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data} using this checksum.
2222
- # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will report an error if the checksum verification
2223
- # fails. If you receive a checksum error, your client should verify that
2224
- # CRC32C({::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data}) is equal to
2225
- # {::Google::Cloud::Kms::V1::MacSignRequest#data_crc32c MacSignRequest.data_crc32c}, and if so, perform a limited
2226
- # number of retries. A persistent mismatch may indicate an issue in your
2227
- # computation of the CRC32C checksum.
2228
- # Note: This field is defined as int64 for reasons of compatibility across
2229
- # different languages. However, it is a non-negative integer, which will
2230
- # never exceed 2^32-1, and can be safely downconverted to uint32 in languages
2231
- # that support this type.
2785
+ # Optional. An optional CRC32C checksum of the
2786
+ # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data}. If
2787
+ # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}
2788
+ # will verify the integrity of the received
2789
+ # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data} using this
2790
+ # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}
2791
+ # will report an error if the checksum verification fails. If you receive a
2792
+ # checksum error, your client should verify that
2793
+ # CRC32C({::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data}) is
2794
+ # equal to
2795
+ # {::Google::Cloud::Kms::V1::MacSignRequest#data_crc32c MacSignRequest.data_crc32c},
2796
+ # and if so, perform a limited number of retries. A persistent mismatch may
2797
+ # indicate an issue in your computation of the CRC32C checksum. Note: This
2798
+ # field is defined as int64 for reasons of compatibility across different
2799
+ # languages. However, it is a non-negative integer, which will never exceed
2800
+ # 2^32-1, and can be safely downconverted to uint32 in languages that support
2801
+ # this type.
2232
2802
  #
2233
2803
  # @yield [response, operation] Access the result along with the RPC operation
2234
2804
  # @yieldparam response [::Google::Cloud::Kms::V1::MacSignResponse]
@@ -2238,6 +2808,21 @@ module Google
2238
2808
  #
2239
2809
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2240
2810
  #
2811
+ # @example Basic example
2812
+ # require "google/cloud/kms/v1"
2813
+ #
2814
+ # # Create a client object. The client can be reused for multiple calls.
2815
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
2816
+ #
2817
+ # # Create a request. To set request fields, pass in keyword arguments.
2818
+ # request = Google::Cloud::Kms::V1::MacSignRequest.new
2819
+ #
2820
+ # # Call the mac_sign method.
2821
+ # result = client.mac_sign request
2822
+ #
2823
+ # # The returned object is of type Google::Cloud::Kms::V1::MacSignResponse.
2824
+ # p result
2825
+ #
2241
2826
  def mac_sign request, options = nil
2242
2827
  raise ::ArgumentError, "request must be provided" if request.nil?
2243
2828
 
@@ -2255,9 +2840,11 @@ module Google
2255
2840
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
2256
2841
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2257
2842
 
2258
- header_params = {
2259
- "name" => request.name
2260
- }
2843
+ header_params = {}
2844
+ if request.name
2845
+ header_params["name"] = request.name
2846
+ end
2847
+
2261
2848
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2262
2849
  metadata[:"x-goog-request-params"] ||= request_params_header
2263
2850
 
@@ -2278,9 +2865,10 @@ module Google
2278
2865
  end
2279
2866
 
2280
2867
  ##
2281
- # Verifies MAC tag using a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose}
2282
- # MAC, and returns a response that indicates whether or not the verification
2283
- # was successful.
2868
+ # Verifies MAC tag using a
2869
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with
2870
+ # {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} MAC, and returns
2871
+ # a response that indicates whether or not the verification was successful.
2284
2872
  #
2285
2873
  # @overload mac_verify(request, options = nil)
2286
2874
  # Pass arguments to `mac_verify` via a request object, either of type
@@ -2298,40 +2886,51 @@ module Google
2298
2886
  # the default parameter values, pass an empty Hash as a request object (see above).
2299
2887
  #
2300
2888
  # @param name [::String]
2301
- # Required. The resource name of the {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for verification.
2889
+ # Required. The resource name of the
2890
+ # {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for
2891
+ # verification.
2302
2892
  # @param data [::String]
2303
- # Required. The data used previously as a {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data} to generate the MAC
2304
- # tag.
2893
+ # Required. The data used previously as a
2894
+ # {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data} to generate
2895
+ # the MAC tag.
2305
2896
  # @param data_crc32c [::Google::Protobuf::Int64Value, ::Hash]
2306
- # Optional. An optional CRC32C checksum of the {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data}. If
2307
- # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will verify the integrity of the
2308
- # received {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data} using this checksum.
2309
- # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will report an error if the checksum verification
2310
- # fails. If you receive a checksum error, your client should verify that
2311
- # CRC32C({::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data}) is equal to
2312
- # {::Google::Cloud::Kms::V1::MacVerifyRequest#data_crc32c MacVerifyRequest.data_crc32c}, and if so, perform a limited
2313
- # number of retries. A persistent mismatch may indicate an issue in your
2314
- # computation of the CRC32C checksum.
2315
- # Note: This field is defined as int64 for reasons of compatibility across
2316
- # different languages. However, it is a non-negative integer, which will
2317
- # never exceed 2^32-1, and can be safely downconverted to uint32 in languages
2318
- # that support this type.
2897
+ # Optional. An optional CRC32C checksum of the
2898
+ # {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data}. If
2899
+ # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}
2900
+ # will verify the integrity of the received
2901
+ # {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data} using
2902
+ # this checksum.
2903
+ # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will
2904
+ # report an error if the checksum verification fails. If you receive a
2905
+ # checksum error, your client should verify that
2906
+ # CRC32C({::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data})
2907
+ # is equal to
2908
+ # {::Google::Cloud::Kms::V1::MacVerifyRequest#data_crc32c MacVerifyRequest.data_crc32c},
2909
+ # and if so, perform a limited number of retries. A persistent mismatch may
2910
+ # indicate an issue in your computation of the CRC32C checksum. Note: This
2911
+ # field is defined as int64 for reasons of compatibility across different
2912
+ # languages. However, it is a non-negative integer, which will never exceed
2913
+ # 2^32-1, and can be safely downconverted to uint32 in languages that support
2914
+ # this type.
2319
2915
  # @param mac [::String]
2320
2916
  # Required. The signature to verify.
2321
2917
  # @param mac_crc32c [::Google::Protobuf::Int64Value, ::Hash]
2322
- # Optional. An optional CRC32C checksum of the {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac}. If
2323
- # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will verify the integrity of the
2324
- # received {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac} using this checksum.
2325
- # {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will report an error if the checksum verification
2326
- # fails. If you receive a checksum error, your client should verify that
2918
+ # Optional. An optional CRC32C checksum of the
2919
+ # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac}. If
2920
+ # specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}
2921
+ # will verify the integrity of the received
2922
+ # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac} using this
2923
+ # checksum. {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService}
2924
+ # will report an error if the checksum verification fails. If you receive a
2925
+ # checksum error, your client should verify that
2327
2926
  # CRC32C([MacVerifyRequest.tag][]) is equal to
2328
- # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac_crc32c MacVerifyRequest.mac_crc32c}, and if so, perform a limited
2329
- # number of retries. A persistent mismatch may indicate an issue in your
2330
- # computation of the CRC32C checksum.
2331
- # Note: This field is defined as int64 for reasons of compatibility across
2332
- # different languages. However, it is a non-negative integer, which will
2333
- # never exceed 2^32-1, and can be safely downconverted to uint32 in languages
2334
- # that support this type.
2927
+ # {::Google::Cloud::Kms::V1::MacVerifyRequest#mac_crc32c MacVerifyRequest.mac_crc32c},
2928
+ # and if so, perform a limited number of retries. A persistent mismatch may
2929
+ # indicate an issue in your computation of the CRC32C checksum. Note: This
2930
+ # field is defined as int64 for reasons of compatibility across different
2931
+ # languages. However, it is a non-negative integer, which will never exceed
2932
+ # 2^32-1, and can be safely downconverted to uint32 in languages that support
2933
+ # this type.
2335
2934
  #
2336
2935
  # @yield [response, operation] Access the result along with the RPC operation
2337
2936
  # @yieldparam response [::Google::Cloud::Kms::V1::MacVerifyResponse]
@@ -2341,6 +2940,21 @@ module Google
2341
2940
  #
2342
2941
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2343
2942
  #
2943
+ # @example Basic example
2944
+ # require "google/cloud/kms/v1"
2945
+ #
2946
+ # # Create a client object. The client can be reused for multiple calls.
2947
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
2948
+ #
2949
+ # # Create a request. To set request fields, pass in keyword arguments.
2950
+ # request = Google::Cloud::Kms::V1::MacVerifyRequest.new
2951
+ #
2952
+ # # Call the mac_verify method.
2953
+ # result = client.mac_verify request
2954
+ #
2955
+ # # The returned object is of type Google::Cloud::Kms::V1::MacVerifyResponse.
2956
+ # p result
2957
+ #
2344
2958
  def mac_verify request, options = nil
2345
2959
  raise ::ArgumentError, "request must be provided" if request.nil?
2346
2960
 
@@ -2358,9 +2972,11 @@ module Google
2358
2972
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
2359
2973
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2360
2974
 
2361
- header_params = {
2362
- "name" => request.name
2363
- }
2975
+ header_params = {}
2976
+ if request.name
2977
+ header_params["name"] = request.name
2978
+ end
2979
+
2364
2980
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2365
2981
  metadata[:"x-goog-request-params"] ||= request_params_header
2366
2982
 
@@ -2406,8 +3022,10 @@ module Google
2406
3022
  # The length in bytes of the amount of randomness to retrieve. Minimum 8
2407
3023
  # bytes, maximum 1024 bytes.
2408
3024
  # @param protection_level [::Google::Cloud::Kms::V1::ProtectionLevel]
2409
- # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} to use when generating the random data. Defaults to
2410
- # {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE}.
3025
+ # The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} to use when
3026
+ # generating the random data. Currently, only
3027
+ # {::Google::Cloud::Kms::V1::ProtectionLevel::HSM HSM} protection level is
3028
+ # supported.
2411
3029
  #
2412
3030
  # @yield [response, operation] Access the result along with the RPC operation
2413
3031
  # @yieldparam response [::Google::Cloud::Kms::V1::GenerateRandomBytesResponse]
@@ -2417,6 +3035,21 @@ module Google
2417
3035
  #
2418
3036
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2419
3037
  #
3038
+ # @example Basic example
3039
+ # require "google/cloud/kms/v1"
3040
+ #
3041
+ # # Create a client object. The client can be reused for multiple calls.
3042
+ # client = Google::Cloud::Kms::V1::KeyManagementService::Client.new
3043
+ #
3044
+ # # Create a request. To set request fields, pass in keyword arguments.
3045
+ # request = Google::Cloud::Kms::V1::GenerateRandomBytesRequest.new
3046
+ #
3047
+ # # Call the generate_random_bytes method.
3048
+ # result = client.generate_random_bytes request
3049
+ #
3050
+ # # The returned object is of type Google::Cloud::Kms::V1::GenerateRandomBytesResponse.
3051
+ # p result
3052
+ #
2420
3053
  def generate_random_bytes request, options = nil
2421
3054
  raise ::ArgumentError, "request must be provided" if request.nil?
2422
3055
 
@@ -2434,9 +3067,11 @@ module Google
2434
3067
  gapic_version: ::Google::Cloud::Kms::V1::VERSION
2435
3068
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2436
3069
 
2437
- header_params = {
2438
- "location" => request.location
2439
- }
3070
+ header_params = {}
3071
+ if request.location
3072
+ header_params["location"] = request.location
3073
+ end
3074
+
2440
3075
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2441
3076
  metadata[:"x-goog-request-params"] ||= request_params_header
2442
3077