aws-sdk-mgn 1.14.0 → 1.16.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,178 @@
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::Mgn
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::Mgn::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::Mgn::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::Mgn::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 :archive_application
60
+ Aws::Mgn::Endpoints::ArchiveApplication.build(context)
61
+ when :archive_wave
62
+ Aws::Mgn::Endpoints::ArchiveWave.build(context)
63
+ when :associate_applications
64
+ Aws::Mgn::Endpoints::AssociateApplications.build(context)
65
+ when :associate_source_servers
66
+ Aws::Mgn::Endpoints::AssociateSourceServers.build(context)
67
+ when :change_server_life_cycle_state
68
+ Aws::Mgn::Endpoints::ChangeServerLifeCycleState.build(context)
69
+ when :create_application
70
+ Aws::Mgn::Endpoints::CreateApplication.build(context)
71
+ when :create_launch_configuration_template
72
+ Aws::Mgn::Endpoints::CreateLaunchConfigurationTemplate.build(context)
73
+ when :create_replication_configuration_template
74
+ Aws::Mgn::Endpoints::CreateReplicationConfigurationTemplate.build(context)
75
+ when :create_wave
76
+ Aws::Mgn::Endpoints::CreateWave.build(context)
77
+ when :delete_application
78
+ Aws::Mgn::Endpoints::DeleteApplication.build(context)
79
+ when :delete_job
80
+ Aws::Mgn::Endpoints::DeleteJob.build(context)
81
+ when :delete_launch_configuration_template
82
+ Aws::Mgn::Endpoints::DeleteLaunchConfigurationTemplate.build(context)
83
+ when :delete_replication_configuration_template
84
+ Aws::Mgn::Endpoints::DeleteReplicationConfigurationTemplate.build(context)
85
+ when :delete_source_server
86
+ Aws::Mgn::Endpoints::DeleteSourceServer.build(context)
87
+ when :delete_vcenter_client
88
+ Aws::Mgn::Endpoints::DeleteVcenterClient.build(context)
89
+ when :delete_wave
90
+ Aws::Mgn::Endpoints::DeleteWave.build(context)
91
+ when :describe_job_log_items
92
+ Aws::Mgn::Endpoints::DescribeJobLogItems.build(context)
93
+ when :describe_jobs
94
+ Aws::Mgn::Endpoints::DescribeJobs.build(context)
95
+ when :describe_launch_configuration_templates
96
+ Aws::Mgn::Endpoints::DescribeLaunchConfigurationTemplates.build(context)
97
+ when :describe_replication_configuration_templates
98
+ Aws::Mgn::Endpoints::DescribeReplicationConfigurationTemplates.build(context)
99
+ when :describe_source_servers
100
+ Aws::Mgn::Endpoints::DescribeSourceServers.build(context)
101
+ when :describe_vcenter_clients
102
+ Aws::Mgn::Endpoints::DescribeVcenterClients.build(context)
103
+ when :disassociate_applications
104
+ Aws::Mgn::Endpoints::DisassociateApplications.build(context)
105
+ when :disassociate_source_servers
106
+ Aws::Mgn::Endpoints::DisassociateSourceServers.build(context)
107
+ when :disconnect_from_service
108
+ Aws::Mgn::Endpoints::DisconnectFromService.build(context)
109
+ when :finalize_cutover
110
+ Aws::Mgn::Endpoints::FinalizeCutover.build(context)
111
+ when :get_launch_configuration
112
+ Aws::Mgn::Endpoints::GetLaunchConfiguration.build(context)
113
+ when :get_replication_configuration
114
+ Aws::Mgn::Endpoints::GetReplicationConfiguration.build(context)
115
+ when :initialize_service
116
+ Aws::Mgn::Endpoints::InitializeService.build(context)
117
+ when :list_applications
118
+ Aws::Mgn::Endpoints::ListApplications.build(context)
119
+ when :list_source_server_actions
120
+ Aws::Mgn::Endpoints::ListSourceServerActions.build(context)
121
+ when :list_tags_for_resource
122
+ Aws::Mgn::Endpoints::ListTagsForResource.build(context)
123
+ when :list_template_actions
124
+ Aws::Mgn::Endpoints::ListTemplateActions.build(context)
125
+ when :list_waves
126
+ Aws::Mgn::Endpoints::ListWaves.build(context)
127
+ when :mark_as_archived
128
+ Aws::Mgn::Endpoints::MarkAsArchived.build(context)
129
+ when :put_source_server_action
130
+ Aws::Mgn::Endpoints::PutSourceServerAction.build(context)
131
+ when :put_template_action
132
+ Aws::Mgn::Endpoints::PutTemplateAction.build(context)
133
+ when :remove_source_server_action
134
+ Aws::Mgn::Endpoints::RemoveSourceServerAction.build(context)
135
+ when :remove_template_action
136
+ Aws::Mgn::Endpoints::RemoveTemplateAction.build(context)
137
+ when :retry_data_replication
138
+ Aws::Mgn::Endpoints::RetryDataReplication.build(context)
139
+ when :start_cutover
140
+ Aws::Mgn::Endpoints::StartCutover.build(context)
141
+ when :start_replication
142
+ Aws::Mgn::Endpoints::StartReplication.build(context)
143
+ when :start_test
144
+ Aws::Mgn::Endpoints::StartTest.build(context)
145
+ when :tag_resource
146
+ Aws::Mgn::Endpoints::TagResource.build(context)
147
+ when :terminate_target_instances
148
+ Aws::Mgn::Endpoints::TerminateTargetInstances.build(context)
149
+ when :unarchive_application
150
+ Aws::Mgn::Endpoints::UnarchiveApplication.build(context)
151
+ when :unarchive_wave
152
+ Aws::Mgn::Endpoints::UnarchiveWave.build(context)
153
+ when :untag_resource
154
+ Aws::Mgn::Endpoints::UntagResource.build(context)
155
+ when :update_application
156
+ Aws::Mgn::Endpoints::UpdateApplication.build(context)
157
+ when :update_launch_configuration
158
+ Aws::Mgn::Endpoints::UpdateLaunchConfiguration.build(context)
159
+ when :update_launch_configuration_template
160
+ Aws::Mgn::Endpoints::UpdateLaunchConfigurationTemplate.build(context)
161
+ when :update_replication_configuration
162
+ Aws::Mgn::Endpoints::UpdateReplicationConfiguration.build(context)
163
+ when :update_replication_configuration_template
164
+ Aws::Mgn::Endpoints::UpdateReplicationConfigurationTemplate.build(context)
165
+ when :update_source_server_replication_type
166
+ Aws::Mgn::Endpoints::UpdateSourceServerReplicationType.build(context)
167
+ when :update_wave
168
+ Aws::Mgn::Endpoints::UpdateWave.build(context)
169
+ end
170
+ end
171
+ end
172
+
173
+ def add_handlers(handlers, _config)
174
+ handlers.add(Handler, step: :build, priority: 75)
175
+ end
176
+ end
177
+ end
178
+ end