aws-sdk-workmail 1.51.0 → 1.53.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,228 @@
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::WorkMail
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::WorkMail::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::WorkMail::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::WorkMail::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_delegate_to_resource
60
+ Aws::WorkMail::Endpoints::AssociateDelegateToResource.build(context)
61
+ when :associate_member_to_group
62
+ Aws::WorkMail::Endpoints::AssociateMemberToGroup.build(context)
63
+ when :assume_impersonation_role
64
+ Aws::WorkMail::Endpoints::AssumeImpersonationRole.build(context)
65
+ when :cancel_mailbox_export_job
66
+ Aws::WorkMail::Endpoints::CancelMailboxExportJob.build(context)
67
+ when :create_alias
68
+ Aws::WorkMail::Endpoints::CreateAlias.build(context)
69
+ when :create_availability_configuration
70
+ Aws::WorkMail::Endpoints::CreateAvailabilityConfiguration.build(context)
71
+ when :create_group
72
+ Aws::WorkMail::Endpoints::CreateGroup.build(context)
73
+ when :create_impersonation_role
74
+ Aws::WorkMail::Endpoints::CreateImpersonationRole.build(context)
75
+ when :create_mobile_device_access_rule
76
+ Aws::WorkMail::Endpoints::CreateMobileDeviceAccessRule.build(context)
77
+ when :create_organization
78
+ Aws::WorkMail::Endpoints::CreateOrganization.build(context)
79
+ when :create_resource
80
+ Aws::WorkMail::Endpoints::CreateResource.build(context)
81
+ when :create_user
82
+ Aws::WorkMail::Endpoints::CreateUser.build(context)
83
+ when :delete_access_control_rule
84
+ Aws::WorkMail::Endpoints::DeleteAccessControlRule.build(context)
85
+ when :delete_alias
86
+ Aws::WorkMail::Endpoints::DeleteAlias.build(context)
87
+ when :delete_availability_configuration
88
+ Aws::WorkMail::Endpoints::DeleteAvailabilityConfiguration.build(context)
89
+ when :delete_email_monitoring_configuration
90
+ Aws::WorkMail::Endpoints::DeleteEmailMonitoringConfiguration.build(context)
91
+ when :delete_group
92
+ Aws::WorkMail::Endpoints::DeleteGroup.build(context)
93
+ when :delete_impersonation_role
94
+ Aws::WorkMail::Endpoints::DeleteImpersonationRole.build(context)
95
+ when :delete_mailbox_permissions
96
+ Aws::WorkMail::Endpoints::DeleteMailboxPermissions.build(context)
97
+ when :delete_mobile_device_access_override
98
+ Aws::WorkMail::Endpoints::DeleteMobileDeviceAccessOverride.build(context)
99
+ when :delete_mobile_device_access_rule
100
+ Aws::WorkMail::Endpoints::DeleteMobileDeviceAccessRule.build(context)
101
+ when :delete_organization
102
+ Aws::WorkMail::Endpoints::DeleteOrganization.build(context)
103
+ when :delete_resource
104
+ Aws::WorkMail::Endpoints::DeleteResource.build(context)
105
+ when :delete_retention_policy
106
+ Aws::WorkMail::Endpoints::DeleteRetentionPolicy.build(context)
107
+ when :delete_user
108
+ Aws::WorkMail::Endpoints::DeleteUser.build(context)
109
+ when :deregister_from_work_mail
110
+ Aws::WorkMail::Endpoints::DeregisterFromWorkMail.build(context)
111
+ when :deregister_mail_domain
112
+ Aws::WorkMail::Endpoints::DeregisterMailDomain.build(context)
113
+ when :describe_email_monitoring_configuration
114
+ Aws::WorkMail::Endpoints::DescribeEmailMonitoringConfiguration.build(context)
115
+ when :describe_group
116
+ Aws::WorkMail::Endpoints::DescribeGroup.build(context)
117
+ when :describe_inbound_dmarc_settings
118
+ Aws::WorkMail::Endpoints::DescribeInboundDmarcSettings.build(context)
119
+ when :describe_mailbox_export_job
120
+ Aws::WorkMail::Endpoints::DescribeMailboxExportJob.build(context)
121
+ when :describe_organization
122
+ Aws::WorkMail::Endpoints::DescribeOrganization.build(context)
123
+ when :describe_resource
124
+ Aws::WorkMail::Endpoints::DescribeResource.build(context)
125
+ when :describe_user
126
+ Aws::WorkMail::Endpoints::DescribeUser.build(context)
127
+ when :disassociate_delegate_from_resource
128
+ Aws::WorkMail::Endpoints::DisassociateDelegateFromResource.build(context)
129
+ when :disassociate_member_from_group
130
+ Aws::WorkMail::Endpoints::DisassociateMemberFromGroup.build(context)
131
+ when :get_access_control_effect
132
+ Aws::WorkMail::Endpoints::GetAccessControlEffect.build(context)
133
+ when :get_default_retention_policy
134
+ Aws::WorkMail::Endpoints::GetDefaultRetentionPolicy.build(context)
135
+ when :get_impersonation_role
136
+ Aws::WorkMail::Endpoints::GetImpersonationRole.build(context)
137
+ when :get_impersonation_role_effect
138
+ Aws::WorkMail::Endpoints::GetImpersonationRoleEffect.build(context)
139
+ when :get_mail_domain
140
+ Aws::WorkMail::Endpoints::GetMailDomain.build(context)
141
+ when :get_mailbox_details
142
+ Aws::WorkMail::Endpoints::GetMailboxDetails.build(context)
143
+ when :get_mobile_device_access_effect
144
+ Aws::WorkMail::Endpoints::GetMobileDeviceAccessEffect.build(context)
145
+ when :get_mobile_device_access_override
146
+ Aws::WorkMail::Endpoints::GetMobileDeviceAccessOverride.build(context)
147
+ when :list_access_control_rules
148
+ Aws::WorkMail::Endpoints::ListAccessControlRules.build(context)
149
+ when :list_aliases
150
+ Aws::WorkMail::Endpoints::ListAliases.build(context)
151
+ when :list_availability_configurations
152
+ Aws::WorkMail::Endpoints::ListAvailabilityConfigurations.build(context)
153
+ when :list_group_members
154
+ Aws::WorkMail::Endpoints::ListGroupMembers.build(context)
155
+ when :list_groups
156
+ Aws::WorkMail::Endpoints::ListGroups.build(context)
157
+ when :list_impersonation_roles
158
+ Aws::WorkMail::Endpoints::ListImpersonationRoles.build(context)
159
+ when :list_mail_domains
160
+ Aws::WorkMail::Endpoints::ListMailDomains.build(context)
161
+ when :list_mailbox_export_jobs
162
+ Aws::WorkMail::Endpoints::ListMailboxExportJobs.build(context)
163
+ when :list_mailbox_permissions
164
+ Aws::WorkMail::Endpoints::ListMailboxPermissions.build(context)
165
+ when :list_mobile_device_access_overrides
166
+ Aws::WorkMail::Endpoints::ListMobileDeviceAccessOverrides.build(context)
167
+ when :list_mobile_device_access_rules
168
+ Aws::WorkMail::Endpoints::ListMobileDeviceAccessRules.build(context)
169
+ when :list_organizations
170
+ Aws::WorkMail::Endpoints::ListOrganizations.build(context)
171
+ when :list_resource_delegates
172
+ Aws::WorkMail::Endpoints::ListResourceDelegates.build(context)
173
+ when :list_resources
174
+ Aws::WorkMail::Endpoints::ListResources.build(context)
175
+ when :list_tags_for_resource
176
+ Aws::WorkMail::Endpoints::ListTagsForResource.build(context)
177
+ when :list_users
178
+ Aws::WorkMail::Endpoints::ListUsers.build(context)
179
+ when :put_access_control_rule
180
+ Aws::WorkMail::Endpoints::PutAccessControlRule.build(context)
181
+ when :put_email_monitoring_configuration
182
+ Aws::WorkMail::Endpoints::PutEmailMonitoringConfiguration.build(context)
183
+ when :put_inbound_dmarc_settings
184
+ Aws::WorkMail::Endpoints::PutInboundDmarcSettings.build(context)
185
+ when :put_mailbox_permissions
186
+ Aws::WorkMail::Endpoints::PutMailboxPermissions.build(context)
187
+ when :put_mobile_device_access_override
188
+ Aws::WorkMail::Endpoints::PutMobileDeviceAccessOverride.build(context)
189
+ when :put_retention_policy
190
+ Aws::WorkMail::Endpoints::PutRetentionPolicy.build(context)
191
+ when :register_mail_domain
192
+ Aws::WorkMail::Endpoints::RegisterMailDomain.build(context)
193
+ when :register_to_work_mail
194
+ Aws::WorkMail::Endpoints::RegisterToWorkMail.build(context)
195
+ when :reset_password
196
+ Aws::WorkMail::Endpoints::ResetPassword.build(context)
197
+ when :start_mailbox_export_job
198
+ Aws::WorkMail::Endpoints::StartMailboxExportJob.build(context)
199
+ when :tag_resource
200
+ Aws::WorkMail::Endpoints::TagResource.build(context)
201
+ when :test_availability_configuration
202
+ Aws::WorkMail::Endpoints::TestAvailabilityConfiguration.build(context)
203
+ when :untag_resource
204
+ Aws::WorkMail::Endpoints::UntagResource.build(context)
205
+ when :update_availability_configuration
206
+ Aws::WorkMail::Endpoints::UpdateAvailabilityConfiguration.build(context)
207
+ when :update_default_mail_domain
208
+ Aws::WorkMail::Endpoints::UpdateDefaultMailDomain.build(context)
209
+ when :update_impersonation_role
210
+ Aws::WorkMail::Endpoints::UpdateImpersonationRole.build(context)
211
+ when :update_mailbox_quota
212
+ Aws::WorkMail::Endpoints::UpdateMailboxQuota.build(context)
213
+ when :update_mobile_device_access_rule
214
+ Aws::WorkMail::Endpoints::UpdateMobileDeviceAccessRule.build(context)
215
+ when :update_primary_email_address
216
+ Aws::WorkMail::Endpoints::UpdatePrimaryEmailAddress.build(context)
217
+ when :update_resource
218
+ Aws::WorkMail::Endpoints::UpdateResource.build(context)
219
+ end
220
+ end
221
+ end
222
+
223
+ def add_handlers(handlers, _config)
224
+ handlers.add(Handler, step: :build, priority: 75)
225
+ end
226
+ end
227
+ end
228
+ end