aws-sdk-kms 1.58.0 → 1.60.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -61,6 +61,18 @@ module Aws::KMS
61
61
  # * {NotFoundException}
62
62
  # * {TagException}
63
63
  # * {UnsupportedOperationException}
64
+ # * {XksKeyAlreadyInUseException}
65
+ # * {XksKeyInvalidConfigurationException}
66
+ # * {XksKeyNotFoundException}
67
+ # * {XksProxyIncorrectAuthenticationCredentialException}
68
+ # * {XksProxyInvalidConfigurationException}
69
+ # * {XksProxyInvalidResponseException}
70
+ # * {XksProxyUriEndpointInUseException}
71
+ # * {XksProxyUriInUseException}
72
+ # * {XksProxyUriUnreachableException}
73
+ # * {XksProxyVpcEndpointServiceInUseException}
74
+ # * {XksProxyVpcEndpointServiceInvalidConfigurationException}
75
+ # * {XksProxyVpcEndpointServiceNotFoundException}
64
76
  #
65
77
  # Additionally, error classes are dynamically generated for service errors based on the error code
66
78
  # if they are not defined above.
@@ -578,5 +590,185 @@ module Aws::KMS
578
590
  end
579
591
  end
580
592
 
593
+ class XksKeyAlreadyInUseException < ServiceError
594
+
595
+ # @param [Seahorse::Client::RequestContext] context
596
+ # @param [String] message
597
+ # @param [Aws::KMS::Types::XksKeyAlreadyInUseException] data
598
+ def initialize(context, message, data = Aws::EmptyStructure.new)
599
+ super(context, message, data)
600
+ end
601
+
602
+ # @return [String]
603
+ def message
604
+ @message || @data[:message]
605
+ end
606
+ end
607
+
608
+ class XksKeyInvalidConfigurationException < ServiceError
609
+
610
+ # @param [Seahorse::Client::RequestContext] context
611
+ # @param [String] message
612
+ # @param [Aws::KMS::Types::XksKeyInvalidConfigurationException] data
613
+ def initialize(context, message, data = Aws::EmptyStructure.new)
614
+ super(context, message, data)
615
+ end
616
+
617
+ # @return [String]
618
+ def message
619
+ @message || @data[:message]
620
+ end
621
+ end
622
+
623
+ class XksKeyNotFoundException < ServiceError
624
+
625
+ # @param [Seahorse::Client::RequestContext] context
626
+ # @param [String] message
627
+ # @param [Aws::KMS::Types::XksKeyNotFoundException] data
628
+ def initialize(context, message, data = Aws::EmptyStructure.new)
629
+ super(context, message, data)
630
+ end
631
+
632
+ # @return [String]
633
+ def message
634
+ @message || @data[:message]
635
+ end
636
+ end
637
+
638
+ class XksProxyIncorrectAuthenticationCredentialException < ServiceError
639
+
640
+ # @param [Seahorse::Client::RequestContext] context
641
+ # @param [String] message
642
+ # @param [Aws::KMS::Types::XksProxyIncorrectAuthenticationCredentialException] data
643
+ def initialize(context, message, data = Aws::EmptyStructure.new)
644
+ super(context, message, data)
645
+ end
646
+
647
+ # @return [String]
648
+ def message
649
+ @message || @data[:message]
650
+ end
651
+ end
652
+
653
+ class XksProxyInvalidConfigurationException < ServiceError
654
+
655
+ # @param [Seahorse::Client::RequestContext] context
656
+ # @param [String] message
657
+ # @param [Aws::KMS::Types::XksProxyInvalidConfigurationException] data
658
+ def initialize(context, message, data = Aws::EmptyStructure.new)
659
+ super(context, message, data)
660
+ end
661
+
662
+ # @return [String]
663
+ def message
664
+ @message || @data[:message]
665
+ end
666
+ end
667
+
668
+ class XksProxyInvalidResponseException < ServiceError
669
+
670
+ # @param [Seahorse::Client::RequestContext] context
671
+ # @param [String] message
672
+ # @param [Aws::KMS::Types::XksProxyInvalidResponseException] data
673
+ def initialize(context, message, data = Aws::EmptyStructure.new)
674
+ super(context, message, data)
675
+ end
676
+
677
+ # @return [String]
678
+ def message
679
+ @message || @data[:message]
680
+ end
681
+ end
682
+
683
+ class XksProxyUriEndpointInUseException < ServiceError
684
+
685
+ # @param [Seahorse::Client::RequestContext] context
686
+ # @param [String] message
687
+ # @param [Aws::KMS::Types::XksProxyUriEndpointInUseException] data
688
+ def initialize(context, message, data = Aws::EmptyStructure.new)
689
+ super(context, message, data)
690
+ end
691
+
692
+ # @return [String]
693
+ def message
694
+ @message || @data[:message]
695
+ end
696
+ end
697
+
698
+ class XksProxyUriInUseException < ServiceError
699
+
700
+ # @param [Seahorse::Client::RequestContext] context
701
+ # @param [String] message
702
+ # @param [Aws::KMS::Types::XksProxyUriInUseException] data
703
+ def initialize(context, message, data = Aws::EmptyStructure.new)
704
+ super(context, message, data)
705
+ end
706
+
707
+ # @return [String]
708
+ def message
709
+ @message || @data[:message]
710
+ end
711
+ end
712
+
713
+ class XksProxyUriUnreachableException < ServiceError
714
+
715
+ # @param [Seahorse::Client::RequestContext] context
716
+ # @param [String] message
717
+ # @param [Aws::KMS::Types::XksProxyUriUnreachableException] data
718
+ def initialize(context, message, data = Aws::EmptyStructure.new)
719
+ super(context, message, data)
720
+ end
721
+
722
+ # @return [String]
723
+ def message
724
+ @message || @data[:message]
725
+ end
726
+ end
727
+
728
+ class XksProxyVpcEndpointServiceInUseException < ServiceError
729
+
730
+ # @param [Seahorse::Client::RequestContext] context
731
+ # @param [String] message
732
+ # @param [Aws::KMS::Types::XksProxyVpcEndpointServiceInUseException] data
733
+ def initialize(context, message, data = Aws::EmptyStructure.new)
734
+ super(context, message, data)
735
+ end
736
+
737
+ # @return [String]
738
+ def message
739
+ @message || @data[:message]
740
+ end
741
+ end
742
+
743
+ class XksProxyVpcEndpointServiceInvalidConfigurationException < ServiceError
744
+
745
+ # @param [Seahorse::Client::RequestContext] context
746
+ # @param [String] message
747
+ # @param [Aws::KMS::Types::XksProxyVpcEndpointServiceInvalidConfigurationException] data
748
+ def initialize(context, message, data = Aws::EmptyStructure.new)
749
+ super(context, message, data)
750
+ end
751
+
752
+ # @return [String]
753
+ def message
754
+ @message || @data[:message]
755
+ end
756
+ end
757
+
758
+ class XksProxyVpcEndpointServiceNotFoundException < ServiceError
759
+
760
+ # @param [Seahorse::Client::RequestContext] context
761
+ # @param [String] message
762
+ # @param [Aws::KMS::Types::XksProxyVpcEndpointServiceNotFoundException] data
763
+ def initialize(context, message, data = Aws::EmptyStructure.new)
764
+ super(context, message, data)
765
+ end
766
+
767
+ # @return [String]
768
+ def message
769
+ @message || @data[:message]
770
+ end
771
+ end
772
+
581
773
  end
582
774
  end
@@ -0,0 +1,168 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+
11
+ module Aws::KMS
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::KMS::EndpointProvider',
17
+ docstring: 'The endpoint provider used to resolve endpoints. Any '\
18
+ 'object that responds to `#resolve_endpoint(parameters)` '\
19
+ 'where `parameters` is a Struct similar to '\
20
+ '`Aws::KMS::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::KMS::EndpointProvider.new
23
+ end
24
+
25
+ # @api private
26
+ class Handler < Seahorse::Client::Handler
27
+ def call(context)
28
+ # If endpoint was discovered, do not resolve or apply the endpoint.
29
+ unless context[:discovered_endpoint]
30
+ params = parameters_for_operation(context)
31
+ endpoint = context.config.endpoint_provider.resolve_endpoint(params)
32
+
33
+ context.http_request.endpoint = endpoint.url
34
+ apply_endpoint_headers(context, endpoint.headers)
35
+ end
36
+
37
+ context[:endpoint_params] = params
38
+ context[:auth_scheme] =
39
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
40
+
41
+ @handler.call(context)
42
+ end
43
+
44
+ private
45
+
46
+ def apply_endpoint_headers(context, headers)
47
+ headers.each do |key, values|
48
+ value = values
49
+ .compact
50
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
51
+ .join(',')
52
+
53
+ context.http_request.headers[key] = value
54
+ end
55
+ end
56
+
57
+ def parameters_for_operation(context)
58
+ case context.operation_name
59
+ when :cancel_key_deletion
60
+ Aws::KMS::Endpoints::CancelKeyDeletion.build(context)
61
+ when :connect_custom_key_store
62
+ Aws::KMS::Endpoints::ConnectCustomKeyStore.build(context)
63
+ when :create_alias
64
+ Aws::KMS::Endpoints::CreateAlias.build(context)
65
+ when :create_custom_key_store
66
+ Aws::KMS::Endpoints::CreateCustomKeyStore.build(context)
67
+ when :create_grant
68
+ Aws::KMS::Endpoints::CreateGrant.build(context)
69
+ when :create_key
70
+ Aws::KMS::Endpoints::CreateKey.build(context)
71
+ when :decrypt
72
+ Aws::KMS::Endpoints::Decrypt.build(context)
73
+ when :delete_alias
74
+ Aws::KMS::Endpoints::DeleteAlias.build(context)
75
+ when :delete_custom_key_store
76
+ Aws::KMS::Endpoints::DeleteCustomKeyStore.build(context)
77
+ when :delete_imported_key_material
78
+ Aws::KMS::Endpoints::DeleteImportedKeyMaterial.build(context)
79
+ when :describe_custom_key_stores
80
+ Aws::KMS::Endpoints::DescribeCustomKeyStores.build(context)
81
+ when :describe_key
82
+ Aws::KMS::Endpoints::DescribeKey.build(context)
83
+ when :disable_key
84
+ Aws::KMS::Endpoints::DisableKey.build(context)
85
+ when :disable_key_rotation
86
+ Aws::KMS::Endpoints::DisableKeyRotation.build(context)
87
+ when :disconnect_custom_key_store
88
+ Aws::KMS::Endpoints::DisconnectCustomKeyStore.build(context)
89
+ when :enable_key
90
+ Aws::KMS::Endpoints::EnableKey.build(context)
91
+ when :enable_key_rotation
92
+ Aws::KMS::Endpoints::EnableKeyRotation.build(context)
93
+ when :encrypt
94
+ Aws::KMS::Endpoints::Encrypt.build(context)
95
+ when :generate_data_key
96
+ Aws::KMS::Endpoints::GenerateDataKey.build(context)
97
+ when :generate_data_key_pair
98
+ Aws::KMS::Endpoints::GenerateDataKeyPair.build(context)
99
+ when :generate_data_key_pair_without_plaintext
100
+ Aws::KMS::Endpoints::GenerateDataKeyPairWithoutPlaintext.build(context)
101
+ when :generate_data_key_without_plaintext
102
+ Aws::KMS::Endpoints::GenerateDataKeyWithoutPlaintext.build(context)
103
+ when :generate_mac
104
+ Aws::KMS::Endpoints::GenerateMac.build(context)
105
+ when :generate_random
106
+ Aws::KMS::Endpoints::GenerateRandom.build(context)
107
+ when :get_key_policy
108
+ Aws::KMS::Endpoints::GetKeyPolicy.build(context)
109
+ when :get_key_rotation_status
110
+ Aws::KMS::Endpoints::GetKeyRotationStatus.build(context)
111
+ when :get_parameters_for_import
112
+ Aws::KMS::Endpoints::GetParametersForImport.build(context)
113
+ when :get_public_key
114
+ Aws::KMS::Endpoints::GetPublicKey.build(context)
115
+ when :import_key_material
116
+ Aws::KMS::Endpoints::ImportKeyMaterial.build(context)
117
+ when :list_aliases
118
+ Aws::KMS::Endpoints::ListAliases.build(context)
119
+ when :list_grants
120
+ Aws::KMS::Endpoints::ListGrants.build(context)
121
+ when :list_key_policies
122
+ Aws::KMS::Endpoints::ListKeyPolicies.build(context)
123
+ when :list_keys
124
+ Aws::KMS::Endpoints::ListKeys.build(context)
125
+ when :list_resource_tags
126
+ Aws::KMS::Endpoints::ListResourceTags.build(context)
127
+ when :list_retirable_grants
128
+ Aws::KMS::Endpoints::ListRetirableGrants.build(context)
129
+ when :put_key_policy
130
+ Aws::KMS::Endpoints::PutKeyPolicy.build(context)
131
+ when :re_encrypt
132
+ Aws::KMS::Endpoints::ReEncrypt.build(context)
133
+ when :replicate_key
134
+ Aws::KMS::Endpoints::ReplicateKey.build(context)
135
+ when :retire_grant
136
+ Aws::KMS::Endpoints::RetireGrant.build(context)
137
+ when :revoke_grant
138
+ Aws::KMS::Endpoints::RevokeGrant.build(context)
139
+ when :schedule_key_deletion
140
+ Aws::KMS::Endpoints::ScheduleKeyDeletion.build(context)
141
+ when :sign
142
+ Aws::KMS::Endpoints::Sign.build(context)
143
+ when :tag_resource
144
+ Aws::KMS::Endpoints::TagResource.build(context)
145
+ when :untag_resource
146
+ Aws::KMS::Endpoints::UntagResource.build(context)
147
+ when :update_alias
148
+ Aws::KMS::Endpoints::UpdateAlias.build(context)
149
+ when :update_custom_key_store
150
+ Aws::KMS::Endpoints::UpdateCustomKeyStore.build(context)
151
+ when :update_key_description
152
+ Aws::KMS::Endpoints::UpdateKeyDescription.build(context)
153
+ when :update_primary_region
154
+ Aws::KMS::Endpoints::UpdatePrimaryRegion.build(context)
155
+ when :verify
156
+ Aws::KMS::Endpoints::Verify.build(context)
157
+ when :verify_mac
158
+ Aws::KMS::Endpoints::VerifyMac.build(context)
159
+ end
160
+ end
161
+ end
162
+
163
+ def add_handlers(handlers, _config)
164
+ handlers.add(Handler, step: :build, priority: 75)
165
+ end
166
+ end
167
+ end
168
+ end