aws-sdk-opensearchservice 1.11.0 → 1.13.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,166 @@
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::OpenSearchService
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::OpenSearchService::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::OpenSearchService::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::OpenSearchService::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_connection
60
+ Aws::OpenSearchService::Endpoints::AcceptInboundConnection.build(context)
61
+ when :add_tags
62
+ Aws::OpenSearchService::Endpoints::AddTags.build(context)
63
+ when :associate_package
64
+ Aws::OpenSearchService::Endpoints::AssociatePackage.build(context)
65
+ when :authorize_vpc_endpoint_access
66
+ Aws::OpenSearchService::Endpoints::AuthorizeVpcEndpointAccess.build(context)
67
+ when :cancel_service_software_update
68
+ Aws::OpenSearchService::Endpoints::CancelServiceSoftwareUpdate.build(context)
69
+ when :create_domain
70
+ Aws::OpenSearchService::Endpoints::CreateDomain.build(context)
71
+ when :create_outbound_connection
72
+ Aws::OpenSearchService::Endpoints::CreateOutboundConnection.build(context)
73
+ when :create_package
74
+ Aws::OpenSearchService::Endpoints::CreatePackage.build(context)
75
+ when :create_vpc_endpoint
76
+ Aws::OpenSearchService::Endpoints::CreateVpcEndpoint.build(context)
77
+ when :delete_domain
78
+ Aws::OpenSearchService::Endpoints::DeleteDomain.build(context)
79
+ when :delete_inbound_connection
80
+ Aws::OpenSearchService::Endpoints::DeleteInboundConnection.build(context)
81
+ when :delete_outbound_connection
82
+ Aws::OpenSearchService::Endpoints::DeleteOutboundConnection.build(context)
83
+ when :delete_package
84
+ Aws::OpenSearchService::Endpoints::DeletePackage.build(context)
85
+ when :delete_vpc_endpoint
86
+ Aws::OpenSearchService::Endpoints::DeleteVpcEndpoint.build(context)
87
+ when :describe_domain
88
+ Aws::OpenSearchService::Endpoints::DescribeDomain.build(context)
89
+ when :describe_domain_auto_tunes
90
+ Aws::OpenSearchService::Endpoints::DescribeDomainAutoTunes.build(context)
91
+ when :describe_domain_change_progress
92
+ Aws::OpenSearchService::Endpoints::DescribeDomainChangeProgress.build(context)
93
+ when :describe_domain_config
94
+ Aws::OpenSearchService::Endpoints::DescribeDomainConfig.build(context)
95
+ when :describe_domains
96
+ Aws::OpenSearchService::Endpoints::DescribeDomains.build(context)
97
+ when :describe_inbound_connections
98
+ Aws::OpenSearchService::Endpoints::DescribeInboundConnections.build(context)
99
+ when :describe_instance_type_limits
100
+ Aws::OpenSearchService::Endpoints::DescribeInstanceTypeLimits.build(context)
101
+ when :describe_outbound_connections
102
+ Aws::OpenSearchService::Endpoints::DescribeOutboundConnections.build(context)
103
+ when :describe_packages
104
+ Aws::OpenSearchService::Endpoints::DescribePackages.build(context)
105
+ when :describe_reserved_instance_offerings
106
+ Aws::OpenSearchService::Endpoints::DescribeReservedInstanceOfferings.build(context)
107
+ when :describe_reserved_instances
108
+ Aws::OpenSearchService::Endpoints::DescribeReservedInstances.build(context)
109
+ when :describe_vpc_endpoints
110
+ Aws::OpenSearchService::Endpoints::DescribeVpcEndpoints.build(context)
111
+ when :dissociate_package
112
+ Aws::OpenSearchService::Endpoints::DissociatePackage.build(context)
113
+ when :get_compatible_versions
114
+ Aws::OpenSearchService::Endpoints::GetCompatibleVersions.build(context)
115
+ when :get_package_version_history
116
+ Aws::OpenSearchService::Endpoints::GetPackageVersionHistory.build(context)
117
+ when :get_upgrade_history
118
+ Aws::OpenSearchService::Endpoints::GetUpgradeHistory.build(context)
119
+ when :get_upgrade_status
120
+ Aws::OpenSearchService::Endpoints::GetUpgradeStatus.build(context)
121
+ when :list_domain_names
122
+ Aws::OpenSearchService::Endpoints::ListDomainNames.build(context)
123
+ when :list_domains_for_package
124
+ Aws::OpenSearchService::Endpoints::ListDomainsForPackage.build(context)
125
+ when :list_instance_type_details
126
+ Aws::OpenSearchService::Endpoints::ListInstanceTypeDetails.build(context)
127
+ when :list_packages_for_domain
128
+ Aws::OpenSearchService::Endpoints::ListPackagesForDomain.build(context)
129
+ when :list_tags
130
+ Aws::OpenSearchService::Endpoints::ListTags.build(context)
131
+ when :list_versions
132
+ Aws::OpenSearchService::Endpoints::ListVersions.build(context)
133
+ when :list_vpc_endpoint_access
134
+ Aws::OpenSearchService::Endpoints::ListVpcEndpointAccess.build(context)
135
+ when :list_vpc_endpoints
136
+ Aws::OpenSearchService::Endpoints::ListVpcEndpoints.build(context)
137
+ when :list_vpc_endpoints_for_domain
138
+ Aws::OpenSearchService::Endpoints::ListVpcEndpointsForDomain.build(context)
139
+ when :purchase_reserved_instance_offering
140
+ Aws::OpenSearchService::Endpoints::PurchaseReservedInstanceOffering.build(context)
141
+ when :reject_inbound_connection
142
+ Aws::OpenSearchService::Endpoints::RejectInboundConnection.build(context)
143
+ when :remove_tags
144
+ Aws::OpenSearchService::Endpoints::RemoveTags.build(context)
145
+ when :revoke_vpc_endpoint_access
146
+ Aws::OpenSearchService::Endpoints::RevokeVpcEndpointAccess.build(context)
147
+ when :start_service_software_update
148
+ Aws::OpenSearchService::Endpoints::StartServiceSoftwareUpdate.build(context)
149
+ when :update_domain_config
150
+ Aws::OpenSearchService::Endpoints::UpdateDomainConfig.build(context)
151
+ when :update_package
152
+ Aws::OpenSearchService::Endpoints::UpdatePackage.build(context)
153
+ when :update_vpc_endpoint
154
+ Aws::OpenSearchService::Endpoints::UpdateVpcEndpoint.build(context)
155
+ when :upgrade_domain
156
+ Aws::OpenSearchService::Endpoints::UpgradeDomain.build(context)
157
+ end
158
+ end
159
+ end
160
+
161
+ def add_handlers(handlers, _config)
162
+ handlers.add(Handler, step: :build, priority: 75)
163
+ end
164
+ end
165
+ end
166
+ end