aws-sdk-proton 1.16.0 → 1.18.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,218 @@
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::Proton
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::Proton::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::Proton::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::Proton::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_environment_account_connection
60
+ Aws::Proton::Endpoints::AcceptEnvironmentAccountConnection.build(context)
61
+ when :cancel_component_deployment
62
+ Aws::Proton::Endpoints::CancelComponentDeployment.build(context)
63
+ when :cancel_environment_deployment
64
+ Aws::Proton::Endpoints::CancelEnvironmentDeployment.build(context)
65
+ when :cancel_service_instance_deployment
66
+ Aws::Proton::Endpoints::CancelServiceInstanceDeployment.build(context)
67
+ when :cancel_service_pipeline_deployment
68
+ Aws::Proton::Endpoints::CancelServicePipelineDeployment.build(context)
69
+ when :create_component
70
+ Aws::Proton::Endpoints::CreateComponent.build(context)
71
+ when :create_environment
72
+ Aws::Proton::Endpoints::CreateEnvironment.build(context)
73
+ when :create_environment_account_connection
74
+ Aws::Proton::Endpoints::CreateEnvironmentAccountConnection.build(context)
75
+ when :create_environment_template
76
+ Aws::Proton::Endpoints::CreateEnvironmentTemplate.build(context)
77
+ when :create_environment_template_version
78
+ Aws::Proton::Endpoints::CreateEnvironmentTemplateVersion.build(context)
79
+ when :create_repository
80
+ Aws::Proton::Endpoints::CreateRepository.build(context)
81
+ when :create_service
82
+ Aws::Proton::Endpoints::CreateService.build(context)
83
+ when :create_service_template
84
+ Aws::Proton::Endpoints::CreateServiceTemplate.build(context)
85
+ when :create_service_template_version
86
+ Aws::Proton::Endpoints::CreateServiceTemplateVersion.build(context)
87
+ when :create_template_sync_config
88
+ Aws::Proton::Endpoints::CreateTemplateSyncConfig.build(context)
89
+ when :delete_component
90
+ Aws::Proton::Endpoints::DeleteComponent.build(context)
91
+ when :delete_environment
92
+ Aws::Proton::Endpoints::DeleteEnvironment.build(context)
93
+ when :delete_environment_account_connection
94
+ Aws::Proton::Endpoints::DeleteEnvironmentAccountConnection.build(context)
95
+ when :delete_environment_template
96
+ Aws::Proton::Endpoints::DeleteEnvironmentTemplate.build(context)
97
+ when :delete_environment_template_version
98
+ Aws::Proton::Endpoints::DeleteEnvironmentTemplateVersion.build(context)
99
+ when :delete_repository
100
+ Aws::Proton::Endpoints::DeleteRepository.build(context)
101
+ when :delete_service
102
+ Aws::Proton::Endpoints::DeleteService.build(context)
103
+ when :delete_service_template
104
+ Aws::Proton::Endpoints::DeleteServiceTemplate.build(context)
105
+ when :delete_service_template_version
106
+ Aws::Proton::Endpoints::DeleteServiceTemplateVersion.build(context)
107
+ when :delete_template_sync_config
108
+ Aws::Proton::Endpoints::DeleteTemplateSyncConfig.build(context)
109
+ when :get_account_settings
110
+ Aws::Proton::Endpoints::GetAccountSettings.build(context)
111
+ when :get_component
112
+ Aws::Proton::Endpoints::GetComponent.build(context)
113
+ when :get_environment
114
+ Aws::Proton::Endpoints::GetEnvironment.build(context)
115
+ when :get_environment_account_connection
116
+ Aws::Proton::Endpoints::GetEnvironmentAccountConnection.build(context)
117
+ when :get_environment_template
118
+ Aws::Proton::Endpoints::GetEnvironmentTemplate.build(context)
119
+ when :get_environment_template_version
120
+ Aws::Proton::Endpoints::GetEnvironmentTemplateVersion.build(context)
121
+ when :get_repository
122
+ Aws::Proton::Endpoints::GetRepository.build(context)
123
+ when :get_repository_sync_status
124
+ Aws::Proton::Endpoints::GetRepositorySyncStatus.build(context)
125
+ when :get_service
126
+ Aws::Proton::Endpoints::GetService.build(context)
127
+ when :get_service_instance
128
+ Aws::Proton::Endpoints::GetServiceInstance.build(context)
129
+ when :get_service_template
130
+ Aws::Proton::Endpoints::GetServiceTemplate.build(context)
131
+ when :get_service_template_version
132
+ Aws::Proton::Endpoints::GetServiceTemplateVersion.build(context)
133
+ when :get_template_sync_config
134
+ Aws::Proton::Endpoints::GetTemplateSyncConfig.build(context)
135
+ when :get_template_sync_status
136
+ Aws::Proton::Endpoints::GetTemplateSyncStatus.build(context)
137
+ when :list_component_outputs
138
+ Aws::Proton::Endpoints::ListComponentOutputs.build(context)
139
+ when :list_component_provisioned_resources
140
+ Aws::Proton::Endpoints::ListComponentProvisionedResources.build(context)
141
+ when :list_components
142
+ Aws::Proton::Endpoints::ListComponents.build(context)
143
+ when :list_environment_account_connections
144
+ Aws::Proton::Endpoints::ListEnvironmentAccountConnections.build(context)
145
+ when :list_environment_outputs
146
+ Aws::Proton::Endpoints::ListEnvironmentOutputs.build(context)
147
+ when :list_environment_provisioned_resources
148
+ Aws::Proton::Endpoints::ListEnvironmentProvisionedResources.build(context)
149
+ when :list_environment_template_versions
150
+ Aws::Proton::Endpoints::ListEnvironmentTemplateVersions.build(context)
151
+ when :list_environment_templates
152
+ Aws::Proton::Endpoints::ListEnvironmentTemplates.build(context)
153
+ when :list_environments
154
+ Aws::Proton::Endpoints::ListEnvironments.build(context)
155
+ when :list_repositories
156
+ Aws::Proton::Endpoints::ListRepositories.build(context)
157
+ when :list_repository_sync_definitions
158
+ Aws::Proton::Endpoints::ListRepositorySyncDefinitions.build(context)
159
+ when :list_service_instance_outputs
160
+ Aws::Proton::Endpoints::ListServiceInstanceOutputs.build(context)
161
+ when :list_service_instance_provisioned_resources
162
+ Aws::Proton::Endpoints::ListServiceInstanceProvisionedResources.build(context)
163
+ when :list_service_instances
164
+ Aws::Proton::Endpoints::ListServiceInstances.build(context)
165
+ when :list_service_pipeline_outputs
166
+ Aws::Proton::Endpoints::ListServicePipelineOutputs.build(context)
167
+ when :list_service_pipeline_provisioned_resources
168
+ Aws::Proton::Endpoints::ListServicePipelineProvisionedResources.build(context)
169
+ when :list_service_template_versions
170
+ Aws::Proton::Endpoints::ListServiceTemplateVersions.build(context)
171
+ when :list_service_templates
172
+ Aws::Proton::Endpoints::ListServiceTemplates.build(context)
173
+ when :list_services
174
+ Aws::Proton::Endpoints::ListServices.build(context)
175
+ when :list_tags_for_resource
176
+ Aws::Proton::Endpoints::ListTagsForResource.build(context)
177
+ when :notify_resource_deployment_status_change
178
+ Aws::Proton::Endpoints::NotifyResourceDeploymentStatusChange.build(context)
179
+ when :reject_environment_account_connection
180
+ Aws::Proton::Endpoints::RejectEnvironmentAccountConnection.build(context)
181
+ when :tag_resource
182
+ Aws::Proton::Endpoints::TagResource.build(context)
183
+ when :untag_resource
184
+ Aws::Proton::Endpoints::UntagResource.build(context)
185
+ when :update_account_settings
186
+ Aws::Proton::Endpoints::UpdateAccountSettings.build(context)
187
+ when :update_component
188
+ Aws::Proton::Endpoints::UpdateComponent.build(context)
189
+ when :update_environment
190
+ Aws::Proton::Endpoints::UpdateEnvironment.build(context)
191
+ when :update_environment_account_connection
192
+ Aws::Proton::Endpoints::UpdateEnvironmentAccountConnection.build(context)
193
+ when :update_environment_template
194
+ Aws::Proton::Endpoints::UpdateEnvironmentTemplate.build(context)
195
+ when :update_environment_template_version
196
+ Aws::Proton::Endpoints::UpdateEnvironmentTemplateVersion.build(context)
197
+ when :update_service
198
+ Aws::Proton::Endpoints::UpdateService.build(context)
199
+ when :update_service_instance
200
+ Aws::Proton::Endpoints::UpdateServiceInstance.build(context)
201
+ when :update_service_pipeline
202
+ Aws::Proton::Endpoints::UpdateServicePipeline.build(context)
203
+ when :update_service_template
204
+ Aws::Proton::Endpoints::UpdateServiceTemplate.build(context)
205
+ when :update_service_template_version
206
+ Aws::Proton::Endpoints::UpdateServiceTemplateVersion.build(context)
207
+ when :update_template_sync_config
208
+ Aws::Proton::Endpoints::UpdateTemplateSyncConfig.build(context)
209
+ end
210
+ end
211
+ end
212
+
213
+ def add_handlers(handlers, _config)
214
+ handlers.add(Handler, step: :build, priority: 75)
215
+ end
216
+ end
217
+ end
218
+ end