aws-sdk-kafka 1.45.0 → 1.64.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,172 @@
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::Kafka
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::Kafka::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::Kafka::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::Kafka::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 :batch_associate_scram_secret
60
+ Aws::Kafka::Endpoints::BatchAssociateScramSecret.build(context)
61
+ when :create_cluster
62
+ Aws::Kafka::Endpoints::CreateCluster.build(context)
63
+ when :create_cluster_v2
64
+ Aws::Kafka::Endpoints::CreateClusterV2.build(context)
65
+ when :create_configuration
66
+ Aws::Kafka::Endpoints::CreateConfiguration.build(context)
67
+ when :create_replicator
68
+ Aws::Kafka::Endpoints::CreateReplicator.build(context)
69
+ when :create_vpc_connection
70
+ Aws::Kafka::Endpoints::CreateVpcConnection.build(context)
71
+ when :delete_cluster
72
+ Aws::Kafka::Endpoints::DeleteCluster.build(context)
73
+ when :delete_configuration
74
+ Aws::Kafka::Endpoints::DeleteConfiguration.build(context)
75
+ when :delete_replicator
76
+ Aws::Kafka::Endpoints::DeleteReplicator.build(context)
77
+ when :delete_vpc_connection
78
+ Aws::Kafka::Endpoints::DeleteVpcConnection.build(context)
79
+ when :describe_cluster
80
+ Aws::Kafka::Endpoints::DescribeCluster.build(context)
81
+ when :describe_cluster_v2
82
+ Aws::Kafka::Endpoints::DescribeClusterV2.build(context)
83
+ when :describe_cluster_operation
84
+ Aws::Kafka::Endpoints::DescribeClusterOperation.build(context)
85
+ when :describe_cluster_operation_v2
86
+ Aws::Kafka::Endpoints::DescribeClusterOperationV2.build(context)
87
+ when :describe_configuration
88
+ Aws::Kafka::Endpoints::DescribeConfiguration.build(context)
89
+ when :describe_configuration_revision
90
+ Aws::Kafka::Endpoints::DescribeConfigurationRevision.build(context)
91
+ when :describe_replicator
92
+ Aws::Kafka::Endpoints::DescribeReplicator.build(context)
93
+ when :describe_vpc_connection
94
+ Aws::Kafka::Endpoints::DescribeVpcConnection.build(context)
95
+ when :batch_disassociate_scram_secret
96
+ Aws::Kafka::Endpoints::BatchDisassociateScramSecret.build(context)
97
+ when :get_bootstrap_brokers
98
+ Aws::Kafka::Endpoints::GetBootstrapBrokers.build(context)
99
+ when :get_compatible_kafka_versions
100
+ Aws::Kafka::Endpoints::GetCompatibleKafkaVersions.build(context)
101
+ when :list_cluster_operations
102
+ Aws::Kafka::Endpoints::ListClusterOperations.build(context)
103
+ when :list_cluster_operations_v2
104
+ Aws::Kafka::Endpoints::ListClusterOperationsV2.build(context)
105
+ when :list_clusters
106
+ Aws::Kafka::Endpoints::ListClusters.build(context)
107
+ when :list_clusters_v2
108
+ Aws::Kafka::Endpoints::ListClustersV2.build(context)
109
+ when :list_configuration_revisions
110
+ Aws::Kafka::Endpoints::ListConfigurationRevisions.build(context)
111
+ when :list_configurations
112
+ Aws::Kafka::Endpoints::ListConfigurations.build(context)
113
+ when :list_kafka_versions
114
+ Aws::Kafka::Endpoints::ListKafkaVersions.build(context)
115
+ when :list_nodes
116
+ Aws::Kafka::Endpoints::ListNodes.build(context)
117
+ when :list_replicators
118
+ Aws::Kafka::Endpoints::ListReplicators.build(context)
119
+ when :list_scram_secrets
120
+ Aws::Kafka::Endpoints::ListScramSecrets.build(context)
121
+ when :list_tags_for_resource
122
+ Aws::Kafka::Endpoints::ListTagsForResource.build(context)
123
+ when :list_client_vpc_connections
124
+ Aws::Kafka::Endpoints::ListClientVpcConnections.build(context)
125
+ when :list_vpc_connections
126
+ Aws::Kafka::Endpoints::ListVpcConnections.build(context)
127
+ when :reject_client_vpc_connection
128
+ Aws::Kafka::Endpoints::RejectClientVpcConnection.build(context)
129
+ when :delete_cluster_policy
130
+ Aws::Kafka::Endpoints::DeleteClusterPolicy.build(context)
131
+ when :get_cluster_policy
132
+ Aws::Kafka::Endpoints::GetClusterPolicy.build(context)
133
+ when :put_cluster_policy
134
+ Aws::Kafka::Endpoints::PutClusterPolicy.build(context)
135
+ when :reboot_broker
136
+ Aws::Kafka::Endpoints::RebootBroker.build(context)
137
+ when :tag_resource
138
+ Aws::Kafka::Endpoints::TagResource.build(context)
139
+ when :untag_resource
140
+ Aws::Kafka::Endpoints::UntagResource.build(context)
141
+ when :update_broker_count
142
+ Aws::Kafka::Endpoints::UpdateBrokerCount.build(context)
143
+ when :update_broker_type
144
+ Aws::Kafka::Endpoints::UpdateBrokerType.build(context)
145
+ when :update_broker_storage
146
+ Aws::Kafka::Endpoints::UpdateBrokerStorage.build(context)
147
+ when :update_configuration
148
+ Aws::Kafka::Endpoints::UpdateConfiguration.build(context)
149
+ when :update_cluster_configuration
150
+ Aws::Kafka::Endpoints::UpdateClusterConfiguration.build(context)
151
+ when :update_cluster_kafka_version
152
+ Aws::Kafka::Endpoints::UpdateClusterKafkaVersion.build(context)
153
+ when :update_connectivity
154
+ Aws::Kafka::Endpoints::UpdateConnectivity.build(context)
155
+ when :update_monitoring
156
+ Aws::Kafka::Endpoints::UpdateMonitoring.build(context)
157
+ when :update_replication_info
158
+ Aws::Kafka::Endpoints::UpdateReplicationInfo.build(context)
159
+ when :update_security
160
+ Aws::Kafka::Endpoints::UpdateSecurity.build(context)
161
+ when :update_storage
162
+ Aws::Kafka::Endpoints::UpdateStorage.build(context)
163
+ end
164
+ end
165
+ end
166
+
167
+ def add_handlers(handlers, _config)
168
+ handlers.add(Handler, step: :build, priority: 75)
169
+ end
170
+ end
171
+ end
172
+ end