aws-sdk-appconfig 1.25.0 → 1.27.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,154 @@
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::AppConfig
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::AppConfig::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::AppConfig::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::AppConfig::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 :create_application
60
+ Aws::AppConfig::Endpoints::CreateApplication.build(context)
61
+ when :create_configuration_profile
62
+ Aws::AppConfig::Endpoints::CreateConfigurationProfile.build(context)
63
+ when :create_deployment_strategy
64
+ Aws::AppConfig::Endpoints::CreateDeploymentStrategy.build(context)
65
+ when :create_environment
66
+ Aws::AppConfig::Endpoints::CreateEnvironment.build(context)
67
+ when :create_extension
68
+ Aws::AppConfig::Endpoints::CreateExtension.build(context)
69
+ when :create_extension_association
70
+ Aws::AppConfig::Endpoints::CreateExtensionAssociation.build(context)
71
+ when :create_hosted_configuration_version
72
+ Aws::AppConfig::Endpoints::CreateHostedConfigurationVersion.build(context)
73
+ when :delete_application
74
+ Aws::AppConfig::Endpoints::DeleteApplication.build(context)
75
+ when :delete_configuration_profile
76
+ Aws::AppConfig::Endpoints::DeleteConfigurationProfile.build(context)
77
+ when :delete_deployment_strategy
78
+ Aws::AppConfig::Endpoints::DeleteDeploymentStrategy.build(context)
79
+ when :delete_environment
80
+ Aws::AppConfig::Endpoints::DeleteEnvironment.build(context)
81
+ when :delete_extension
82
+ Aws::AppConfig::Endpoints::DeleteExtension.build(context)
83
+ when :delete_extension_association
84
+ Aws::AppConfig::Endpoints::DeleteExtensionAssociation.build(context)
85
+ when :delete_hosted_configuration_version
86
+ Aws::AppConfig::Endpoints::DeleteHostedConfigurationVersion.build(context)
87
+ when :get_application
88
+ Aws::AppConfig::Endpoints::GetApplication.build(context)
89
+ when :get_configuration
90
+ Aws::AppConfig::Endpoints::GetConfiguration.build(context)
91
+ when :get_configuration_profile
92
+ Aws::AppConfig::Endpoints::GetConfigurationProfile.build(context)
93
+ when :get_deployment
94
+ Aws::AppConfig::Endpoints::GetDeployment.build(context)
95
+ when :get_deployment_strategy
96
+ Aws::AppConfig::Endpoints::GetDeploymentStrategy.build(context)
97
+ when :get_environment
98
+ Aws::AppConfig::Endpoints::GetEnvironment.build(context)
99
+ when :get_extension
100
+ Aws::AppConfig::Endpoints::GetExtension.build(context)
101
+ when :get_extension_association
102
+ Aws::AppConfig::Endpoints::GetExtensionAssociation.build(context)
103
+ when :get_hosted_configuration_version
104
+ Aws::AppConfig::Endpoints::GetHostedConfigurationVersion.build(context)
105
+ when :list_applications
106
+ Aws::AppConfig::Endpoints::ListApplications.build(context)
107
+ when :list_configuration_profiles
108
+ Aws::AppConfig::Endpoints::ListConfigurationProfiles.build(context)
109
+ when :list_deployment_strategies
110
+ Aws::AppConfig::Endpoints::ListDeploymentStrategies.build(context)
111
+ when :list_deployments
112
+ Aws::AppConfig::Endpoints::ListDeployments.build(context)
113
+ when :list_environments
114
+ Aws::AppConfig::Endpoints::ListEnvironments.build(context)
115
+ when :list_extension_associations
116
+ Aws::AppConfig::Endpoints::ListExtensionAssociations.build(context)
117
+ when :list_extensions
118
+ Aws::AppConfig::Endpoints::ListExtensions.build(context)
119
+ when :list_hosted_configuration_versions
120
+ Aws::AppConfig::Endpoints::ListHostedConfigurationVersions.build(context)
121
+ when :list_tags_for_resource
122
+ Aws::AppConfig::Endpoints::ListTagsForResource.build(context)
123
+ when :start_deployment
124
+ Aws::AppConfig::Endpoints::StartDeployment.build(context)
125
+ when :stop_deployment
126
+ Aws::AppConfig::Endpoints::StopDeployment.build(context)
127
+ when :tag_resource
128
+ Aws::AppConfig::Endpoints::TagResource.build(context)
129
+ when :untag_resource
130
+ Aws::AppConfig::Endpoints::UntagResource.build(context)
131
+ when :update_application
132
+ Aws::AppConfig::Endpoints::UpdateApplication.build(context)
133
+ when :update_configuration_profile
134
+ Aws::AppConfig::Endpoints::UpdateConfigurationProfile.build(context)
135
+ when :update_deployment_strategy
136
+ Aws::AppConfig::Endpoints::UpdateDeploymentStrategy.build(context)
137
+ when :update_environment
138
+ Aws::AppConfig::Endpoints::UpdateEnvironment.build(context)
139
+ when :update_extension
140
+ Aws::AppConfig::Endpoints::UpdateExtension.build(context)
141
+ when :update_extension_association
142
+ Aws::AppConfig::Endpoints::UpdateExtensionAssociation.build(context)
143
+ when :validate_configuration
144
+ Aws::AppConfig::Endpoints::ValidateConfiguration.build(context)
145
+ end
146
+ end
147
+ end
148
+
149
+ def add_handlers(handlers, _config)
150
+ handlers.add(Handler, step: :build, priority: 75)
151
+ end
152
+ end
153
+ end
154
+ end