aws-sdk-frauddetector 1.35.0 → 1.37.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,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::FraudDetector
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::FraudDetector::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::FraudDetector::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::FraudDetector::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_create_variable
60
+ Aws::FraudDetector::Endpoints::BatchCreateVariable.build(context)
61
+ when :batch_get_variable
62
+ Aws::FraudDetector::Endpoints::BatchGetVariable.build(context)
63
+ when :cancel_batch_import_job
64
+ Aws::FraudDetector::Endpoints::CancelBatchImportJob.build(context)
65
+ when :cancel_batch_prediction_job
66
+ Aws::FraudDetector::Endpoints::CancelBatchPredictionJob.build(context)
67
+ when :create_batch_import_job
68
+ Aws::FraudDetector::Endpoints::CreateBatchImportJob.build(context)
69
+ when :create_batch_prediction_job
70
+ Aws::FraudDetector::Endpoints::CreateBatchPredictionJob.build(context)
71
+ when :create_detector_version
72
+ Aws::FraudDetector::Endpoints::CreateDetectorVersion.build(context)
73
+ when :create_model
74
+ Aws::FraudDetector::Endpoints::CreateModel.build(context)
75
+ when :create_model_version
76
+ Aws::FraudDetector::Endpoints::CreateModelVersion.build(context)
77
+ when :create_rule
78
+ Aws::FraudDetector::Endpoints::CreateRule.build(context)
79
+ when :create_variable
80
+ Aws::FraudDetector::Endpoints::CreateVariable.build(context)
81
+ when :delete_batch_import_job
82
+ Aws::FraudDetector::Endpoints::DeleteBatchImportJob.build(context)
83
+ when :delete_batch_prediction_job
84
+ Aws::FraudDetector::Endpoints::DeleteBatchPredictionJob.build(context)
85
+ when :delete_detector
86
+ Aws::FraudDetector::Endpoints::DeleteDetector.build(context)
87
+ when :delete_detector_version
88
+ Aws::FraudDetector::Endpoints::DeleteDetectorVersion.build(context)
89
+ when :delete_entity_type
90
+ Aws::FraudDetector::Endpoints::DeleteEntityType.build(context)
91
+ when :delete_event
92
+ Aws::FraudDetector::Endpoints::DeleteEvent.build(context)
93
+ when :delete_event_type
94
+ Aws::FraudDetector::Endpoints::DeleteEventType.build(context)
95
+ when :delete_events_by_event_type
96
+ Aws::FraudDetector::Endpoints::DeleteEventsByEventType.build(context)
97
+ when :delete_external_model
98
+ Aws::FraudDetector::Endpoints::DeleteExternalModel.build(context)
99
+ when :delete_label
100
+ Aws::FraudDetector::Endpoints::DeleteLabel.build(context)
101
+ when :delete_model
102
+ Aws::FraudDetector::Endpoints::DeleteModel.build(context)
103
+ when :delete_model_version
104
+ Aws::FraudDetector::Endpoints::DeleteModelVersion.build(context)
105
+ when :delete_outcome
106
+ Aws::FraudDetector::Endpoints::DeleteOutcome.build(context)
107
+ when :delete_rule
108
+ Aws::FraudDetector::Endpoints::DeleteRule.build(context)
109
+ when :delete_variable
110
+ Aws::FraudDetector::Endpoints::DeleteVariable.build(context)
111
+ when :describe_detector
112
+ Aws::FraudDetector::Endpoints::DescribeDetector.build(context)
113
+ when :describe_model_versions
114
+ Aws::FraudDetector::Endpoints::DescribeModelVersions.build(context)
115
+ when :get_batch_import_jobs
116
+ Aws::FraudDetector::Endpoints::GetBatchImportJobs.build(context)
117
+ when :get_batch_prediction_jobs
118
+ Aws::FraudDetector::Endpoints::GetBatchPredictionJobs.build(context)
119
+ when :get_delete_events_by_event_type_status
120
+ Aws::FraudDetector::Endpoints::GetDeleteEventsByEventTypeStatus.build(context)
121
+ when :get_detector_version
122
+ Aws::FraudDetector::Endpoints::GetDetectorVersion.build(context)
123
+ when :get_detectors
124
+ Aws::FraudDetector::Endpoints::GetDetectors.build(context)
125
+ when :get_entity_types
126
+ Aws::FraudDetector::Endpoints::GetEntityTypes.build(context)
127
+ when :get_event
128
+ Aws::FraudDetector::Endpoints::GetEvent.build(context)
129
+ when :get_event_prediction
130
+ Aws::FraudDetector::Endpoints::GetEventPrediction.build(context)
131
+ when :get_event_prediction_metadata
132
+ Aws::FraudDetector::Endpoints::GetEventPredictionMetadata.build(context)
133
+ when :get_event_types
134
+ Aws::FraudDetector::Endpoints::GetEventTypes.build(context)
135
+ when :get_external_models
136
+ Aws::FraudDetector::Endpoints::GetExternalModels.build(context)
137
+ when :get_kms_encryption_key
138
+ Aws::FraudDetector::Endpoints::GetKMSEncryptionKey.build(context)
139
+ when :get_labels
140
+ Aws::FraudDetector::Endpoints::GetLabels.build(context)
141
+ when :get_model_version
142
+ Aws::FraudDetector::Endpoints::GetModelVersion.build(context)
143
+ when :get_models
144
+ Aws::FraudDetector::Endpoints::GetModels.build(context)
145
+ when :get_outcomes
146
+ Aws::FraudDetector::Endpoints::GetOutcomes.build(context)
147
+ when :get_rules
148
+ Aws::FraudDetector::Endpoints::GetRules.build(context)
149
+ when :get_variables
150
+ Aws::FraudDetector::Endpoints::GetVariables.build(context)
151
+ when :list_event_predictions
152
+ Aws::FraudDetector::Endpoints::ListEventPredictions.build(context)
153
+ when :list_tags_for_resource
154
+ Aws::FraudDetector::Endpoints::ListTagsForResource.build(context)
155
+ when :put_detector
156
+ Aws::FraudDetector::Endpoints::PutDetector.build(context)
157
+ when :put_entity_type
158
+ Aws::FraudDetector::Endpoints::PutEntityType.build(context)
159
+ when :put_event_type
160
+ Aws::FraudDetector::Endpoints::PutEventType.build(context)
161
+ when :put_external_model
162
+ Aws::FraudDetector::Endpoints::PutExternalModel.build(context)
163
+ when :put_kms_encryption_key
164
+ Aws::FraudDetector::Endpoints::PutKMSEncryptionKey.build(context)
165
+ when :put_label
166
+ Aws::FraudDetector::Endpoints::PutLabel.build(context)
167
+ when :put_outcome
168
+ Aws::FraudDetector::Endpoints::PutOutcome.build(context)
169
+ when :send_event
170
+ Aws::FraudDetector::Endpoints::SendEvent.build(context)
171
+ when :tag_resource
172
+ Aws::FraudDetector::Endpoints::TagResource.build(context)
173
+ when :untag_resource
174
+ Aws::FraudDetector::Endpoints::UntagResource.build(context)
175
+ when :update_detector_version
176
+ Aws::FraudDetector::Endpoints::UpdateDetectorVersion.build(context)
177
+ when :update_detector_version_metadata
178
+ Aws::FraudDetector::Endpoints::UpdateDetectorVersionMetadata.build(context)
179
+ when :update_detector_version_status
180
+ Aws::FraudDetector::Endpoints::UpdateDetectorVersionStatus.build(context)
181
+ when :update_event_label
182
+ Aws::FraudDetector::Endpoints::UpdateEventLabel.build(context)
183
+ when :update_model
184
+ Aws::FraudDetector::Endpoints::UpdateModel.build(context)
185
+ when :update_model_version
186
+ Aws::FraudDetector::Endpoints::UpdateModelVersion.build(context)
187
+ when :update_model_version_status
188
+ Aws::FraudDetector::Endpoints::UpdateModelVersionStatus.build(context)
189
+ when :update_rule_metadata
190
+ Aws::FraudDetector::Endpoints::UpdateRuleMetadata.build(context)
191
+ when :update_rule_version
192
+ Aws::FraudDetector::Endpoints::UpdateRuleVersion.build(context)
193
+ when :update_variable
194
+ Aws::FraudDetector::Endpoints::UpdateVariable.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