aws-sdk-emr 1.62.0 → 1.64.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,174 @@
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::EMR
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::EMR::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::EMR::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::EMR::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 :add_instance_fleet
60
+ Aws::EMR::Endpoints::AddInstanceFleet.build(context)
61
+ when :add_instance_groups
62
+ Aws::EMR::Endpoints::AddInstanceGroups.build(context)
63
+ when :add_job_flow_steps
64
+ Aws::EMR::Endpoints::AddJobFlowSteps.build(context)
65
+ when :add_tags
66
+ Aws::EMR::Endpoints::AddTags.build(context)
67
+ when :cancel_steps
68
+ Aws::EMR::Endpoints::CancelSteps.build(context)
69
+ when :create_security_configuration
70
+ Aws::EMR::Endpoints::CreateSecurityConfiguration.build(context)
71
+ when :create_studio
72
+ Aws::EMR::Endpoints::CreateStudio.build(context)
73
+ when :create_studio_session_mapping
74
+ Aws::EMR::Endpoints::CreateStudioSessionMapping.build(context)
75
+ when :delete_security_configuration
76
+ Aws::EMR::Endpoints::DeleteSecurityConfiguration.build(context)
77
+ when :delete_studio
78
+ Aws::EMR::Endpoints::DeleteStudio.build(context)
79
+ when :delete_studio_session_mapping
80
+ Aws::EMR::Endpoints::DeleteStudioSessionMapping.build(context)
81
+ when :describe_cluster
82
+ Aws::EMR::Endpoints::DescribeCluster.build(context)
83
+ when :describe_job_flows
84
+ Aws::EMR::Endpoints::DescribeJobFlows.build(context)
85
+ when :describe_notebook_execution
86
+ Aws::EMR::Endpoints::DescribeNotebookExecution.build(context)
87
+ when :describe_release_label
88
+ Aws::EMR::Endpoints::DescribeReleaseLabel.build(context)
89
+ when :describe_security_configuration
90
+ Aws::EMR::Endpoints::DescribeSecurityConfiguration.build(context)
91
+ when :describe_step
92
+ Aws::EMR::Endpoints::DescribeStep.build(context)
93
+ when :describe_studio
94
+ Aws::EMR::Endpoints::DescribeStudio.build(context)
95
+ when :get_auto_termination_policy
96
+ Aws::EMR::Endpoints::GetAutoTerminationPolicy.build(context)
97
+ when :get_block_public_access_configuration
98
+ Aws::EMR::Endpoints::GetBlockPublicAccessConfiguration.build(context)
99
+ when :get_cluster_session_credentials
100
+ Aws::EMR::Endpoints::GetClusterSessionCredentials.build(context)
101
+ when :get_managed_scaling_policy
102
+ Aws::EMR::Endpoints::GetManagedScalingPolicy.build(context)
103
+ when :get_studio_session_mapping
104
+ Aws::EMR::Endpoints::GetStudioSessionMapping.build(context)
105
+ when :list_bootstrap_actions
106
+ Aws::EMR::Endpoints::ListBootstrapActions.build(context)
107
+ when :list_clusters
108
+ Aws::EMR::Endpoints::ListClusters.build(context)
109
+ when :list_instance_fleets
110
+ Aws::EMR::Endpoints::ListInstanceFleets.build(context)
111
+ when :list_instance_groups
112
+ Aws::EMR::Endpoints::ListInstanceGroups.build(context)
113
+ when :list_instances
114
+ Aws::EMR::Endpoints::ListInstances.build(context)
115
+ when :list_notebook_executions
116
+ Aws::EMR::Endpoints::ListNotebookExecutions.build(context)
117
+ when :list_release_labels
118
+ Aws::EMR::Endpoints::ListReleaseLabels.build(context)
119
+ when :list_security_configurations
120
+ Aws::EMR::Endpoints::ListSecurityConfigurations.build(context)
121
+ when :list_steps
122
+ Aws::EMR::Endpoints::ListSteps.build(context)
123
+ when :list_studio_session_mappings
124
+ Aws::EMR::Endpoints::ListStudioSessionMappings.build(context)
125
+ when :list_studios
126
+ Aws::EMR::Endpoints::ListStudios.build(context)
127
+ when :modify_cluster
128
+ Aws::EMR::Endpoints::ModifyCluster.build(context)
129
+ when :modify_instance_fleet
130
+ Aws::EMR::Endpoints::ModifyInstanceFleet.build(context)
131
+ when :modify_instance_groups
132
+ Aws::EMR::Endpoints::ModifyInstanceGroups.build(context)
133
+ when :put_auto_scaling_policy
134
+ Aws::EMR::Endpoints::PutAutoScalingPolicy.build(context)
135
+ when :put_auto_termination_policy
136
+ Aws::EMR::Endpoints::PutAutoTerminationPolicy.build(context)
137
+ when :put_block_public_access_configuration
138
+ Aws::EMR::Endpoints::PutBlockPublicAccessConfiguration.build(context)
139
+ when :put_managed_scaling_policy
140
+ Aws::EMR::Endpoints::PutManagedScalingPolicy.build(context)
141
+ when :remove_auto_scaling_policy
142
+ Aws::EMR::Endpoints::RemoveAutoScalingPolicy.build(context)
143
+ when :remove_auto_termination_policy
144
+ Aws::EMR::Endpoints::RemoveAutoTerminationPolicy.build(context)
145
+ when :remove_managed_scaling_policy
146
+ Aws::EMR::Endpoints::RemoveManagedScalingPolicy.build(context)
147
+ when :remove_tags
148
+ Aws::EMR::Endpoints::RemoveTags.build(context)
149
+ when :run_job_flow
150
+ Aws::EMR::Endpoints::RunJobFlow.build(context)
151
+ when :set_termination_protection
152
+ Aws::EMR::Endpoints::SetTerminationProtection.build(context)
153
+ when :set_visible_to_all_users
154
+ Aws::EMR::Endpoints::SetVisibleToAllUsers.build(context)
155
+ when :start_notebook_execution
156
+ Aws::EMR::Endpoints::StartNotebookExecution.build(context)
157
+ when :stop_notebook_execution
158
+ Aws::EMR::Endpoints::StopNotebookExecution.build(context)
159
+ when :terminate_job_flows
160
+ Aws::EMR::Endpoints::TerminateJobFlows.build(context)
161
+ when :update_studio
162
+ Aws::EMR::Endpoints::UpdateStudio.build(context)
163
+ when :update_studio_session_mapping
164
+ Aws::EMR::Endpoints::UpdateStudioSessionMapping.build(context)
165
+ end
166
+ end
167
+ end
168
+
169
+ def add_handlers(handlers, _config)
170
+ handlers.add(Handler, step: :build, priority: 75)
171
+ end
172
+ end
173
+ end
174
+ end