aws-sdk-elasticsearchservice 1.60.0 → 1.77.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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::ElasticsearchService
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::ElasticsearchService::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::ElasticsearchService::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::ElasticsearchService::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 :accept_inbound_cross_cluster_search_connection
60
+ Aws::ElasticsearchService::Endpoints::AcceptInboundCrossClusterSearchConnection.build(context)
61
+ when :add_tags
62
+ Aws::ElasticsearchService::Endpoints::AddTags.build(context)
63
+ when :associate_package
64
+ Aws::ElasticsearchService::Endpoints::AssociatePackage.build(context)
65
+ when :authorize_vpc_endpoint_access
66
+ Aws::ElasticsearchService::Endpoints::AuthorizeVpcEndpointAccess.build(context)
67
+ when :cancel_elasticsearch_service_software_update
68
+ Aws::ElasticsearchService::Endpoints::CancelElasticsearchServiceSoftwareUpdate.build(context)
69
+ when :create_elasticsearch_domain
70
+ Aws::ElasticsearchService::Endpoints::CreateElasticsearchDomain.build(context)
71
+ when :create_outbound_cross_cluster_search_connection
72
+ Aws::ElasticsearchService::Endpoints::CreateOutboundCrossClusterSearchConnection.build(context)
73
+ when :create_package
74
+ Aws::ElasticsearchService::Endpoints::CreatePackage.build(context)
75
+ when :create_vpc_endpoint
76
+ Aws::ElasticsearchService::Endpoints::CreateVpcEndpoint.build(context)
77
+ when :delete_elasticsearch_domain
78
+ Aws::ElasticsearchService::Endpoints::DeleteElasticsearchDomain.build(context)
79
+ when :delete_elasticsearch_service_role
80
+ Aws::ElasticsearchService::Endpoints::DeleteElasticsearchServiceRole.build(context)
81
+ when :delete_inbound_cross_cluster_search_connection
82
+ Aws::ElasticsearchService::Endpoints::DeleteInboundCrossClusterSearchConnection.build(context)
83
+ when :delete_outbound_cross_cluster_search_connection
84
+ Aws::ElasticsearchService::Endpoints::DeleteOutboundCrossClusterSearchConnection.build(context)
85
+ when :delete_package
86
+ Aws::ElasticsearchService::Endpoints::DeletePackage.build(context)
87
+ when :delete_vpc_endpoint
88
+ Aws::ElasticsearchService::Endpoints::DeleteVpcEndpoint.build(context)
89
+ when :describe_domain_auto_tunes
90
+ Aws::ElasticsearchService::Endpoints::DescribeDomainAutoTunes.build(context)
91
+ when :describe_domain_change_progress
92
+ Aws::ElasticsearchService::Endpoints::DescribeDomainChangeProgress.build(context)
93
+ when :describe_elasticsearch_domain
94
+ Aws::ElasticsearchService::Endpoints::DescribeElasticsearchDomain.build(context)
95
+ when :describe_elasticsearch_domain_config
96
+ Aws::ElasticsearchService::Endpoints::DescribeElasticsearchDomainConfig.build(context)
97
+ when :describe_elasticsearch_domains
98
+ Aws::ElasticsearchService::Endpoints::DescribeElasticsearchDomains.build(context)
99
+ when :describe_elasticsearch_instance_type_limits
100
+ Aws::ElasticsearchService::Endpoints::DescribeElasticsearchInstanceTypeLimits.build(context)
101
+ when :describe_inbound_cross_cluster_search_connections
102
+ Aws::ElasticsearchService::Endpoints::DescribeInboundCrossClusterSearchConnections.build(context)
103
+ when :describe_outbound_cross_cluster_search_connections
104
+ Aws::ElasticsearchService::Endpoints::DescribeOutboundCrossClusterSearchConnections.build(context)
105
+ when :describe_packages
106
+ Aws::ElasticsearchService::Endpoints::DescribePackages.build(context)
107
+ when :describe_reserved_elasticsearch_instance_offerings
108
+ Aws::ElasticsearchService::Endpoints::DescribeReservedElasticsearchInstanceOfferings.build(context)
109
+ when :describe_reserved_elasticsearch_instances
110
+ Aws::ElasticsearchService::Endpoints::DescribeReservedElasticsearchInstances.build(context)
111
+ when :describe_vpc_endpoints
112
+ Aws::ElasticsearchService::Endpoints::DescribeVpcEndpoints.build(context)
113
+ when :dissociate_package
114
+ Aws::ElasticsearchService::Endpoints::DissociatePackage.build(context)
115
+ when :get_compatible_elasticsearch_versions
116
+ Aws::ElasticsearchService::Endpoints::GetCompatibleElasticsearchVersions.build(context)
117
+ when :get_package_version_history
118
+ Aws::ElasticsearchService::Endpoints::GetPackageVersionHistory.build(context)
119
+ when :get_upgrade_history
120
+ Aws::ElasticsearchService::Endpoints::GetUpgradeHistory.build(context)
121
+ when :get_upgrade_status
122
+ Aws::ElasticsearchService::Endpoints::GetUpgradeStatus.build(context)
123
+ when :list_domain_names
124
+ Aws::ElasticsearchService::Endpoints::ListDomainNames.build(context)
125
+ when :list_domains_for_package
126
+ Aws::ElasticsearchService::Endpoints::ListDomainsForPackage.build(context)
127
+ when :list_elasticsearch_instance_types
128
+ Aws::ElasticsearchService::Endpoints::ListElasticsearchInstanceTypes.build(context)
129
+ when :list_elasticsearch_versions
130
+ Aws::ElasticsearchService::Endpoints::ListElasticsearchVersions.build(context)
131
+ when :list_packages_for_domain
132
+ Aws::ElasticsearchService::Endpoints::ListPackagesForDomain.build(context)
133
+ when :list_tags
134
+ Aws::ElasticsearchService::Endpoints::ListTags.build(context)
135
+ when :list_vpc_endpoint_access
136
+ Aws::ElasticsearchService::Endpoints::ListVpcEndpointAccess.build(context)
137
+ when :list_vpc_endpoints
138
+ Aws::ElasticsearchService::Endpoints::ListVpcEndpoints.build(context)
139
+ when :list_vpc_endpoints_for_domain
140
+ Aws::ElasticsearchService::Endpoints::ListVpcEndpointsForDomain.build(context)
141
+ when :purchase_reserved_elasticsearch_instance_offering
142
+ Aws::ElasticsearchService::Endpoints::PurchaseReservedElasticsearchInstanceOffering.build(context)
143
+ when :reject_inbound_cross_cluster_search_connection
144
+ Aws::ElasticsearchService::Endpoints::RejectInboundCrossClusterSearchConnection.build(context)
145
+ when :remove_tags
146
+ Aws::ElasticsearchService::Endpoints::RemoveTags.build(context)
147
+ when :revoke_vpc_endpoint_access
148
+ Aws::ElasticsearchService::Endpoints::RevokeVpcEndpointAccess.build(context)
149
+ when :start_elasticsearch_service_software_update
150
+ Aws::ElasticsearchService::Endpoints::StartElasticsearchServiceSoftwareUpdate.build(context)
151
+ when :update_elasticsearch_domain_config
152
+ Aws::ElasticsearchService::Endpoints::UpdateElasticsearchDomainConfig.build(context)
153
+ when :update_package
154
+ Aws::ElasticsearchService::Endpoints::UpdatePackage.build(context)
155
+ when :update_vpc_endpoint
156
+ Aws::ElasticsearchService::Endpoints::UpdateVpcEndpoint.build(context)
157
+ when :upgrade_elasticsearch_domain
158
+ Aws::ElasticsearchService::Endpoints::UpgradeElasticsearchDomain.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