aws-sdk-comprehend 1.61.0 → 1.63.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,214 @@
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::Comprehend
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::Comprehend::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::Comprehend::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::Comprehend::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_detect_dominant_language
60
+ Aws::Comprehend::Endpoints::BatchDetectDominantLanguage.build(context)
61
+ when :batch_detect_entities
62
+ Aws::Comprehend::Endpoints::BatchDetectEntities.build(context)
63
+ when :batch_detect_key_phrases
64
+ Aws::Comprehend::Endpoints::BatchDetectKeyPhrases.build(context)
65
+ when :batch_detect_sentiment
66
+ Aws::Comprehend::Endpoints::BatchDetectSentiment.build(context)
67
+ when :batch_detect_syntax
68
+ Aws::Comprehend::Endpoints::BatchDetectSyntax.build(context)
69
+ when :batch_detect_targeted_sentiment
70
+ Aws::Comprehend::Endpoints::BatchDetectTargetedSentiment.build(context)
71
+ when :classify_document
72
+ Aws::Comprehend::Endpoints::ClassifyDocument.build(context)
73
+ when :contains_pii_entities
74
+ Aws::Comprehend::Endpoints::ContainsPiiEntities.build(context)
75
+ when :create_document_classifier
76
+ Aws::Comprehend::Endpoints::CreateDocumentClassifier.build(context)
77
+ when :create_endpoint
78
+ Aws::Comprehend::Endpoints::CreateEndpoint.build(context)
79
+ when :create_entity_recognizer
80
+ Aws::Comprehend::Endpoints::CreateEntityRecognizer.build(context)
81
+ when :delete_document_classifier
82
+ Aws::Comprehend::Endpoints::DeleteDocumentClassifier.build(context)
83
+ when :delete_endpoint
84
+ Aws::Comprehend::Endpoints::DeleteEndpoint.build(context)
85
+ when :delete_entity_recognizer
86
+ Aws::Comprehend::Endpoints::DeleteEntityRecognizer.build(context)
87
+ when :delete_resource_policy
88
+ Aws::Comprehend::Endpoints::DeleteResourcePolicy.build(context)
89
+ when :describe_document_classification_job
90
+ Aws::Comprehend::Endpoints::DescribeDocumentClassificationJob.build(context)
91
+ when :describe_document_classifier
92
+ Aws::Comprehend::Endpoints::DescribeDocumentClassifier.build(context)
93
+ when :describe_dominant_language_detection_job
94
+ Aws::Comprehend::Endpoints::DescribeDominantLanguageDetectionJob.build(context)
95
+ when :describe_endpoint
96
+ Aws::Comprehend::Endpoints::DescribeEndpoint.build(context)
97
+ when :describe_entities_detection_job
98
+ Aws::Comprehend::Endpoints::DescribeEntitiesDetectionJob.build(context)
99
+ when :describe_entity_recognizer
100
+ Aws::Comprehend::Endpoints::DescribeEntityRecognizer.build(context)
101
+ when :describe_events_detection_job
102
+ Aws::Comprehend::Endpoints::DescribeEventsDetectionJob.build(context)
103
+ when :describe_key_phrases_detection_job
104
+ Aws::Comprehend::Endpoints::DescribeKeyPhrasesDetectionJob.build(context)
105
+ when :describe_pii_entities_detection_job
106
+ Aws::Comprehend::Endpoints::DescribePiiEntitiesDetectionJob.build(context)
107
+ when :describe_resource_policy
108
+ Aws::Comprehend::Endpoints::DescribeResourcePolicy.build(context)
109
+ when :describe_sentiment_detection_job
110
+ Aws::Comprehend::Endpoints::DescribeSentimentDetectionJob.build(context)
111
+ when :describe_targeted_sentiment_detection_job
112
+ Aws::Comprehend::Endpoints::DescribeTargetedSentimentDetectionJob.build(context)
113
+ when :describe_topics_detection_job
114
+ Aws::Comprehend::Endpoints::DescribeTopicsDetectionJob.build(context)
115
+ when :detect_dominant_language
116
+ Aws::Comprehend::Endpoints::DetectDominantLanguage.build(context)
117
+ when :detect_entities
118
+ Aws::Comprehend::Endpoints::DetectEntities.build(context)
119
+ when :detect_key_phrases
120
+ Aws::Comprehend::Endpoints::DetectKeyPhrases.build(context)
121
+ when :detect_pii_entities
122
+ Aws::Comprehend::Endpoints::DetectPiiEntities.build(context)
123
+ when :detect_sentiment
124
+ Aws::Comprehend::Endpoints::DetectSentiment.build(context)
125
+ when :detect_syntax
126
+ Aws::Comprehend::Endpoints::DetectSyntax.build(context)
127
+ when :detect_targeted_sentiment
128
+ Aws::Comprehend::Endpoints::DetectTargetedSentiment.build(context)
129
+ when :import_model
130
+ Aws::Comprehend::Endpoints::ImportModel.build(context)
131
+ when :list_document_classification_jobs
132
+ Aws::Comprehend::Endpoints::ListDocumentClassificationJobs.build(context)
133
+ when :list_document_classifier_summaries
134
+ Aws::Comprehend::Endpoints::ListDocumentClassifierSummaries.build(context)
135
+ when :list_document_classifiers
136
+ Aws::Comprehend::Endpoints::ListDocumentClassifiers.build(context)
137
+ when :list_dominant_language_detection_jobs
138
+ Aws::Comprehend::Endpoints::ListDominantLanguageDetectionJobs.build(context)
139
+ when :list_endpoints
140
+ Aws::Comprehend::Endpoints::ListEndpoints.build(context)
141
+ when :list_entities_detection_jobs
142
+ Aws::Comprehend::Endpoints::ListEntitiesDetectionJobs.build(context)
143
+ when :list_entity_recognizer_summaries
144
+ Aws::Comprehend::Endpoints::ListEntityRecognizerSummaries.build(context)
145
+ when :list_entity_recognizers
146
+ Aws::Comprehend::Endpoints::ListEntityRecognizers.build(context)
147
+ when :list_events_detection_jobs
148
+ Aws::Comprehend::Endpoints::ListEventsDetectionJobs.build(context)
149
+ when :list_key_phrases_detection_jobs
150
+ Aws::Comprehend::Endpoints::ListKeyPhrasesDetectionJobs.build(context)
151
+ when :list_pii_entities_detection_jobs
152
+ Aws::Comprehend::Endpoints::ListPiiEntitiesDetectionJobs.build(context)
153
+ when :list_sentiment_detection_jobs
154
+ Aws::Comprehend::Endpoints::ListSentimentDetectionJobs.build(context)
155
+ when :list_tags_for_resource
156
+ Aws::Comprehend::Endpoints::ListTagsForResource.build(context)
157
+ when :list_targeted_sentiment_detection_jobs
158
+ Aws::Comprehend::Endpoints::ListTargetedSentimentDetectionJobs.build(context)
159
+ when :list_topics_detection_jobs
160
+ Aws::Comprehend::Endpoints::ListTopicsDetectionJobs.build(context)
161
+ when :put_resource_policy
162
+ Aws::Comprehend::Endpoints::PutResourcePolicy.build(context)
163
+ when :start_document_classification_job
164
+ Aws::Comprehend::Endpoints::StartDocumentClassificationJob.build(context)
165
+ when :start_dominant_language_detection_job
166
+ Aws::Comprehend::Endpoints::StartDominantLanguageDetectionJob.build(context)
167
+ when :start_entities_detection_job
168
+ Aws::Comprehend::Endpoints::StartEntitiesDetectionJob.build(context)
169
+ when :start_events_detection_job
170
+ Aws::Comprehend::Endpoints::StartEventsDetectionJob.build(context)
171
+ when :start_key_phrases_detection_job
172
+ Aws::Comprehend::Endpoints::StartKeyPhrasesDetectionJob.build(context)
173
+ when :start_pii_entities_detection_job
174
+ Aws::Comprehend::Endpoints::StartPiiEntitiesDetectionJob.build(context)
175
+ when :start_sentiment_detection_job
176
+ Aws::Comprehend::Endpoints::StartSentimentDetectionJob.build(context)
177
+ when :start_targeted_sentiment_detection_job
178
+ Aws::Comprehend::Endpoints::StartTargetedSentimentDetectionJob.build(context)
179
+ when :start_topics_detection_job
180
+ Aws::Comprehend::Endpoints::StartTopicsDetectionJob.build(context)
181
+ when :stop_dominant_language_detection_job
182
+ Aws::Comprehend::Endpoints::StopDominantLanguageDetectionJob.build(context)
183
+ when :stop_entities_detection_job
184
+ Aws::Comprehend::Endpoints::StopEntitiesDetectionJob.build(context)
185
+ when :stop_events_detection_job
186
+ Aws::Comprehend::Endpoints::StopEventsDetectionJob.build(context)
187
+ when :stop_key_phrases_detection_job
188
+ Aws::Comprehend::Endpoints::StopKeyPhrasesDetectionJob.build(context)
189
+ when :stop_pii_entities_detection_job
190
+ Aws::Comprehend::Endpoints::StopPiiEntitiesDetectionJob.build(context)
191
+ when :stop_sentiment_detection_job
192
+ Aws::Comprehend::Endpoints::StopSentimentDetectionJob.build(context)
193
+ when :stop_targeted_sentiment_detection_job
194
+ Aws::Comprehend::Endpoints::StopTargetedSentimentDetectionJob.build(context)
195
+ when :stop_training_document_classifier
196
+ Aws::Comprehend::Endpoints::StopTrainingDocumentClassifier.build(context)
197
+ when :stop_training_entity_recognizer
198
+ Aws::Comprehend::Endpoints::StopTrainingEntityRecognizer.build(context)
199
+ when :tag_resource
200
+ Aws::Comprehend::Endpoints::TagResource.build(context)
201
+ when :untag_resource
202
+ Aws::Comprehend::Endpoints::UntagResource.build(context)
203
+ when :update_endpoint
204
+ Aws::Comprehend::Endpoints::UpdateEndpoint.build(context)
205
+ end
206
+ end
207
+ end
208
+
209
+ def add_handlers(handlers, _config)
210
+ handlers.add(Handler, step: :build, priority: 75)
211
+ end
212
+ end
213
+ end
214
+ end