aws-sdk-wafregional 1.48.0 → 1.50.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,230 @@
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::WAFRegional
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::WAFRegional::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::WAFRegional::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::WAFRegional::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 :associate_web_acl
60
+ Aws::WAFRegional::Endpoints::AssociateWebACL.build(context)
61
+ when :create_byte_match_set
62
+ Aws::WAFRegional::Endpoints::CreateByteMatchSet.build(context)
63
+ when :create_geo_match_set
64
+ Aws::WAFRegional::Endpoints::CreateGeoMatchSet.build(context)
65
+ when :create_ip_set
66
+ Aws::WAFRegional::Endpoints::CreateIPSet.build(context)
67
+ when :create_rate_based_rule
68
+ Aws::WAFRegional::Endpoints::CreateRateBasedRule.build(context)
69
+ when :create_regex_match_set
70
+ Aws::WAFRegional::Endpoints::CreateRegexMatchSet.build(context)
71
+ when :create_regex_pattern_set
72
+ Aws::WAFRegional::Endpoints::CreateRegexPatternSet.build(context)
73
+ when :create_rule
74
+ Aws::WAFRegional::Endpoints::CreateRule.build(context)
75
+ when :create_rule_group
76
+ Aws::WAFRegional::Endpoints::CreateRuleGroup.build(context)
77
+ when :create_size_constraint_set
78
+ Aws::WAFRegional::Endpoints::CreateSizeConstraintSet.build(context)
79
+ when :create_sql_injection_match_set
80
+ Aws::WAFRegional::Endpoints::CreateSqlInjectionMatchSet.build(context)
81
+ when :create_web_acl
82
+ Aws::WAFRegional::Endpoints::CreateWebACL.build(context)
83
+ when :create_web_acl_migration_stack
84
+ Aws::WAFRegional::Endpoints::CreateWebACLMigrationStack.build(context)
85
+ when :create_xss_match_set
86
+ Aws::WAFRegional::Endpoints::CreateXssMatchSet.build(context)
87
+ when :delete_byte_match_set
88
+ Aws::WAFRegional::Endpoints::DeleteByteMatchSet.build(context)
89
+ when :delete_geo_match_set
90
+ Aws::WAFRegional::Endpoints::DeleteGeoMatchSet.build(context)
91
+ when :delete_ip_set
92
+ Aws::WAFRegional::Endpoints::DeleteIPSet.build(context)
93
+ when :delete_logging_configuration
94
+ Aws::WAFRegional::Endpoints::DeleteLoggingConfiguration.build(context)
95
+ when :delete_permission_policy
96
+ Aws::WAFRegional::Endpoints::DeletePermissionPolicy.build(context)
97
+ when :delete_rate_based_rule
98
+ Aws::WAFRegional::Endpoints::DeleteRateBasedRule.build(context)
99
+ when :delete_regex_match_set
100
+ Aws::WAFRegional::Endpoints::DeleteRegexMatchSet.build(context)
101
+ when :delete_regex_pattern_set
102
+ Aws::WAFRegional::Endpoints::DeleteRegexPatternSet.build(context)
103
+ when :delete_rule
104
+ Aws::WAFRegional::Endpoints::DeleteRule.build(context)
105
+ when :delete_rule_group
106
+ Aws::WAFRegional::Endpoints::DeleteRuleGroup.build(context)
107
+ when :delete_size_constraint_set
108
+ Aws::WAFRegional::Endpoints::DeleteSizeConstraintSet.build(context)
109
+ when :delete_sql_injection_match_set
110
+ Aws::WAFRegional::Endpoints::DeleteSqlInjectionMatchSet.build(context)
111
+ when :delete_web_acl
112
+ Aws::WAFRegional::Endpoints::DeleteWebACL.build(context)
113
+ when :delete_xss_match_set
114
+ Aws::WAFRegional::Endpoints::DeleteXssMatchSet.build(context)
115
+ when :disassociate_web_acl
116
+ Aws::WAFRegional::Endpoints::DisassociateWebACL.build(context)
117
+ when :get_byte_match_set
118
+ Aws::WAFRegional::Endpoints::GetByteMatchSet.build(context)
119
+ when :get_change_token
120
+ Aws::WAFRegional::Endpoints::GetChangeToken.build(context)
121
+ when :get_change_token_status
122
+ Aws::WAFRegional::Endpoints::GetChangeTokenStatus.build(context)
123
+ when :get_geo_match_set
124
+ Aws::WAFRegional::Endpoints::GetGeoMatchSet.build(context)
125
+ when :get_ip_set
126
+ Aws::WAFRegional::Endpoints::GetIPSet.build(context)
127
+ when :get_logging_configuration
128
+ Aws::WAFRegional::Endpoints::GetLoggingConfiguration.build(context)
129
+ when :get_permission_policy
130
+ Aws::WAFRegional::Endpoints::GetPermissionPolicy.build(context)
131
+ when :get_rate_based_rule
132
+ Aws::WAFRegional::Endpoints::GetRateBasedRule.build(context)
133
+ when :get_rate_based_rule_managed_keys
134
+ Aws::WAFRegional::Endpoints::GetRateBasedRuleManagedKeys.build(context)
135
+ when :get_regex_match_set
136
+ Aws::WAFRegional::Endpoints::GetRegexMatchSet.build(context)
137
+ when :get_regex_pattern_set
138
+ Aws::WAFRegional::Endpoints::GetRegexPatternSet.build(context)
139
+ when :get_rule
140
+ Aws::WAFRegional::Endpoints::GetRule.build(context)
141
+ when :get_rule_group
142
+ Aws::WAFRegional::Endpoints::GetRuleGroup.build(context)
143
+ when :get_sampled_requests
144
+ Aws::WAFRegional::Endpoints::GetSampledRequests.build(context)
145
+ when :get_size_constraint_set
146
+ Aws::WAFRegional::Endpoints::GetSizeConstraintSet.build(context)
147
+ when :get_sql_injection_match_set
148
+ Aws::WAFRegional::Endpoints::GetSqlInjectionMatchSet.build(context)
149
+ when :get_web_acl
150
+ Aws::WAFRegional::Endpoints::GetWebACL.build(context)
151
+ when :get_web_acl_for_resource
152
+ Aws::WAFRegional::Endpoints::GetWebACLForResource.build(context)
153
+ when :get_xss_match_set
154
+ Aws::WAFRegional::Endpoints::GetXssMatchSet.build(context)
155
+ when :list_activated_rules_in_rule_group
156
+ Aws::WAFRegional::Endpoints::ListActivatedRulesInRuleGroup.build(context)
157
+ when :list_byte_match_sets
158
+ Aws::WAFRegional::Endpoints::ListByteMatchSets.build(context)
159
+ when :list_geo_match_sets
160
+ Aws::WAFRegional::Endpoints::ListGeoMatchSets.build(context)
161
+ when :list_ip_sets
162
+ Aws::WAFRegional::Endpoints::ListIPSets.build(context)
163
+ when :list_logging_configurations
164
+ Aws::WAFRegional::Endpoints::ListLoggingConfigurations.build(context)
165
+ when :list_rate_based_rules
166
+ Aws::WAFRegional::Endpoints::ListRateBasedRules.build(context)
167
+ when :list_regex_match_sets
168
+ Aws::WAFRegional::Endpoints::ListRegexMatchSets.build(context)
169
+ when :list_regex_pattern_sets
170
+ Aws::WAFRegional::Endpoints::ListRegexPatternSets.build(context)
171
+ when :list_resources_for_web_acl
172
+ Aws::WAFRegional::Endpoints::ListResourcesForWebACL.build(context)
173
+ when :list_rule_groups
174
+ Aws::WAFRegional::Endpoints::ListRuleGroups.build(context)
175
+ when :list_rules
176
+ Aws::WAFRegional::Endpoints::ListRules.build(context)
177
+ when :list_size_constraint_sets
178
+ Aws::WAFRegional::Endpoints::ListSizeConstraintSets.build(context)
179
+ when :list_sql_injection_match_sets
180
+ Aws::WAFRegional::Endpoints::ListSqlInjectionMatchSets.build(context)
181
+ when :list_subscribed_rule_groups
182
+ Aws::WAFRegional::Endpoints::ListSubscribedRuleGroups.build(context)
183
+ when :list_tags_for_resource
184
+ Aws::WAFRegional::Endpoints::ListTagsForResource.build(context)
185
+ when :list_web_acls
186
+ Aws::WAFRegional::Endpoints::ListWebACLs.build(context)
187
+ when :list_xss_match_sets
188
+ Aws::WAFRegional::Endpoints::ListXssMatchSets.build(context)
189
+ when :put_logging_configuration
190
+ Aws::WAFRegional::Endpoints::PutLoggingConfiguration.build(context)
191
+ when :put_permission_policy
192
+ Aws::WAFRegional::Endpoints::PutPermissionPolicy.build(context)
193
+ when :tag_resource
194
+ Aws::WAFRegional::Endpoints::TagResource.build(context)
195
+ when :untag_resource
196
+ Aws::WAFRegional::Endpoints::UntagResource.build(context)
197
+ when :update_byte_match_set
198
+ Aws::WAFRegional::Endpoints::UpdateByteMatchSet.build(context)
199
+ when :update_geo_match_set
200
+ Aws::WAFRegional::Endpoints::UpdateGeoMatchSet.build(context)
201
+ when :update_ip_set
202
+ Aws::WAFRegional::Endpoints::UpdateIPSet.build(context)
203
+ when :update_rate_based_rule
204
+ Aws::WAFRegional::Endpoints::UpdateRateBasedRule.build(context)
205
+ when :update_regex_match_set
206
+ Aws::WAFRegional::Endpoints::UpdateRegexMatchSet.build(context)
207
+ when :update_regex_pattern_set
208
+ Aws::WAFRegional::Endpoints::UpdateRegexPatternSet.build(context)
209
+ when :update_rule
210
+ Aws::WAFRegional::Endpoints::UpdateRule.build(context)
211
+ when :update_rule_group
212
+ Aws::WAFRegional::Endpoints::UpdateRuleGroup.build(context)
213
+ when :update_size_constraint_set
214
+ Aws::WAFRegional::Endpoints::UpdateSizeConstraintSet.build(context)
215
+ when :update_sql_injection_match_set
216
+ Aws::WAFRegional::Endpoints::UpdateSqlInjectionMatchSet.build(context)
217
+ when :update_web_acl
218
+ Aws::WAFRegional::Endpoints::UpdateWebACL.build(context)
219
+ when :update_xss_match_set
220
+ Aws::WAFRegional::Endpoints::UpdateXssMatchSet.build(context)
221
+ end
222
+ end
223
+ end
224
+
225
+ def add_handlers(handlers, _config)
226
+ handlers.add(Handler, step: :build, priority: 75)
227
+ end
228
+ end
229
+ end
230
+ end