aws-sdk-athena 1.44.0 → 1.75.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,6 +31,7 @@ module Aws::Athena
31
31
  # * {InvalidRequestException}
32
32
  # * {MetadataException}
33
33
  # * {ResourceNotFoundException}
34
+ # * {SessionAlreadyExistsException}
34
35
  # * {TooManyRequestsException}
35
36
  #
36
37
  # Additionally, error classes are dynamically generated for service errors based on the error code
@@ -109,6 +110,21 @@ module Aws::Athena
109
110
  end
110
111
  end
111
112
 
113
+ class SessionAlreadyExistsException < ServiceError
114
+
115
+ # @param [Seahorse::Client::RequestContext] context
116
+ # @param [String] message
117
+ # @param [Aws::Athena::Types::SessionAlreadyExistsException] data
118
+ def initialize(context, message, data = Aws::EmptyStructure.new)
119
+ super(context, message, data)
120
+ end
121
+
122
+ # @return [String]
123
+ def message
124
+ @message || @data[:message]
125
+ end
126
+ end
127
+
112
128
  class TooManyRequestsException < ServiceError
113
129
 
114
130
  # @param [Seahorse::Client::RequestContext] context
@@ -0,0 +1,204 @@
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::Athena
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::Athena::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::Athena::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::Athena::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 :batch_get_named_query
60
+ Aws::Athena::Endpoints::BatchGetNamedQuery.build(context)
61
+ when :batch_get_prepared_statement
62
+ Aws::Athena::Endpoints::BatchGetPreparedStatement.build(context)
63
+ when :batch_get_query_execution
64
+ Aws::Athena::Endpoints::BatchGetQueryExecution.build(context)
65
+ when :cancel_capacity_reservation
66
+ Aws::Athena::Endpoints::CancelCapacityReservation.build(context)
67
+ when :create_capacity_reservation
68
+ Aws::Athena::Endpoints::CreateCapacityReservation.build(context)
69
+ when :create_data_catalog
70
+ Aws::Athena::Endpoints::CreateDataCatalog.build(context)
71
+ when :create_named_query
72
+ Aws::Athena::Endpoints::CreateNamedQuery.build(context)
73
+ when :create_notebook
74
+ Aws::Athena::Endpoints::CreateNotebook.build(context)
75
+ when :create_prepared_statement
76
+ Aws::Athena::Endpoints::CreatePreparedStatement.build(context)
77
+ when :create_presigned_notebook_url
78
+ Aws::Athena::Endpoints::CreatePresignedNotebookUrl.build(context)
79
+ when :create_work_group
80
+ Aws::Athena::Endpoints::CreateWorkGroup.build(context)
81
+ when :delete_capacity_reservation
82
+ Aws::Athena::Endpoints::DeleteCapacityReservation.build(context)
83
+ when :delete_data_catalog
84
+ Aws::Athena::Endpoints::DeleteDataCatalog.build(context)
85
+ when :delete_named_query
86
+ Aws::Athena::Endpoints::DeleteNamedQuery.build(context)
87
+ when :delete_notebook
88
+ Aws::Athena::Endpoints::DeleteNotebook.build(context)
89
+ when :delete_prepared_statement
90
+ Aws::Athena::Endpoints::DeletePreparedStatement.build(context)
91
+ when :delete_work_group
92
+ Aws::Athena::Endpoints::DeleteWorkGroup.build(context)
93
+ when :export_notebook
94
+ Aws::Athena::Endpoints::ExportNotebook.build(context)
95
+ when :get_calculation_execution
96
+ Aws::Athena::Endpoints::GetCalculationExecution.build(context)
97
+ when :get_calculation_execution_code
98
+ Aws::Athena::Endpoints::GetCalculationExecutionCode.build(context)
99
+ when :get_calculation_execution_status
100
+ Aws::Athena::Endpoints::GetCalculationExecutionStatus.build(context)
101
+ when :get_capacity_assignment_configuration
102
+ Aws::Athena::Endpoints::GetCapacityAssignmentConfiguration.build(context)
103
+ when :get_capacity_reservation
104
+ Aws::Athena::Endpoints::GetCapacityReservation.build(context)
105
+ when :get_data_catalog
106
+ Aws::Athena::Endpoints::GetDataCatalog.build(context)
107
+ when :get_database
108
+ Aws::Athena::Endpoints::GetDatabase.build(context)
109
+ when :get_named_query
110
+ Aws::Athena::Endpoints::GetNamedQuery.build(context)
111
+ when :get_notebook_metadata
112
+ Aws::Athena::Endpoints::GetNotebookMetadata.build(context)
113
+ when :get_prepared_statement
114
+ Aws::Athena::Endpoints::GetPreparedStatement.build(context)
115
+ when :get_query_execution
116
+ Aws::Athena::Endpoints::GetQueryExecution.build(context)
117
+ when :get_query_results
118
+ Aws::Athena::Endpoints::GetQueryResults.build(context)
119
+ when :get_query_runtime_statistics
120
+ Aws::Athena::Endpoints::GetQueryRuntimeStatistics.build(context)
121
+ when :get_session
122
+ Aws::Athena::Endpoints::GetSession.build(context)
123
+ when :get_session_status
124
+ Aws::Athena::Endpoints::GetSessionStatus.build(context)
125
+ when :get_table_metadata
126
+ Aws::Athena::Endpoints::GetTableMetadata.build(context)
127
+ when :get_work_group
128
+ Aws::Athena::Endpoints::GetWorkGroup.build(context)
129
+ when :import_notebook
130
+ Aws::Athena::Endpoints::ImportNotebook.build(context)
131
+ when :list_application_dpu_sizes
132
+ Aws::Athena::Endpoints::ListApplicationDPUSizes.build(context)
133
+ when :list_calculation_executions
134
+ Aws::Athena::Endpoints::ListCalculationExecutions.build(context)
135
+ when :list_capacity_reservations
136
+ Aws::Athena::Endpoints::ListCapacityReservations.build(context)
137
+ when :list_data_catalogs
138
+ Aws::Athena::Endpoints::ListDataCatalogs.build(context)
139
+ when :list_databases
140
+ Aws::Athena::Endpoints::ListDatabases.build(context)
141
+ when :list_engine_versions
142
+ Aws::Athena::Endpoints::ListEngineVersions.build(context)
143
+ when :list_executors
144
+ Aws::Athena::Endpoints::ListExecutors.build(context)
145
+ when :list_named_queries
146
+ Aws::Athena::Endpoints::ListNamedQueries.build(context)
147
+ when :list_notebook_metadata
148
+ Aws::Athena::Endpoints::ListNotebookMetadata.build(context)
149
+ when :list_notebook_sessions
150
+ Aws::Athena::Endpoints::ListNotebookSessions.build(context)
151
+ when :list_prepared_statements
152
+ Aws::Athena::Endpoints::ListPreparedStatements.build(context)
153
+ when :list_query_executions
154
+ Aws::Athena::Endpoints::ListQueryExecutions.build(context)
155
+ when :list_sessions
156
+ Aws::Athena::Endpoints::ListSessions.build(context)
157
+ when :list_table_metadata
158
+ Aws::Athena::Endpoints::ListTableMetadata.build(context)
159
+ when :list_tags_for_resource
160
+ Aws::Athena::Endpoints::ListTagsForResource.build(context)
161
+ when :list_work_groups
162
+ Aws::Athena::Endpoints::ListWorkGroups.build(context)
163
+ when :put_capacity_assignment_configuration
164
+ Aws::Athena::Endpoints::PutCapacityAssignmentConfiguration.build(context)
165
+ when :start_calculation_execution
166
+ Aws::Athena::Endpoints::StartCalculationExecution.build(context)
167
+ when :start_query_execution
168
+ Aws::Athena::Endpoints::StartQueryExecution.build(context)
169
+ when :start_session
170
+ Aws::Athena::Endpoints::StartSession.build(context)
171
+ when :stop_calculation_execution
172
+ Aws::Athena::Endpoints::StopCalculationExecution.build(context)
173
+ when :stop_query_execution
174
+ Aws::Athena::Endpoints::StopQueryExecution.build(context)
175
+ when :tag_resource
176
+ Aws::Athena::Endpoints::TagResource.build(context)
177
+ when :terminate_session
178
+ Aws::Athena::Endpoints::TerminateSession.build(context)
179
+ when :untag_resource
180
+ Aws::Athena::Endpoints::UntagResource.build(context)
181
+ when :update_capacity_reservation
182
+ Aws::Athena::Endpoints::UpdateCapacityReservation.build(context)
183
+ when :update_data_catalog
184
+ Aws::Athena::Endpoints::UpdateDataCatalog.build(context)
185
+ when :update_named_query
186
+ Aws::Athena::Endpoints::UpdateNamedQuery.build(context)
187
+ when :update_notebook
188
+ Aws::Athena::Endpoints::UpdateNotebook.build(context)
189
+ when :update_notebook_metadata
190
+ Aws::Athena::Endpoints::UpdateNotebookMetadata.build(context)
191
+ when :update_prepared_statement
192
+ Aws::Athena::Endpoints::UpdatePreparedStatement.build(context)
193
+ when :update_work_group
194
+ Aws::Athena::Endpoints::UpdateWorkGroup.build(context)
195
+ end
196
+ end
197
+ end
198
+
199
+ def add_handlers(handlers, _config)
200
+ handlers.add(Handler, step: :build, priority: 75)
201
+ end
202
+ end
203
+ end
204
+ end