aws-sdk-mailmanager 1.0.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,134 @@
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
+ module Aws::MailManager
11
+
12
+ # When MailManager returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::MailManager::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all MailManager errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::MailManager::Errors::ServiceError
20
+ # # rescues all MailManager API errors
21
+ # end
22
+ #
23
+ #
24
+ # ## Request Context
25
+ # ServiceError objects have a {Aws::Errors::ServiceError#context #context} method that returns
26
+ # information about the request that generated the error.
27
+ # See {Seahorse::Client::RequestContext} for more information.
28
+ #
29
+ # ## Error Classes
30
+ # * {AccessDeniedException}
31
+ # * {ConflictException}
32
+ # * {ResourceNotFoundException}
33
+ # * {ServiceQuotaExceededException}
34
+ # * {ThrottlingException}
35
+ # * {ValidationException}
36
+ #
37
+ # Additionally, error classes are dynamically generated for service errors based on the error code
38
+ # if they are not defined above.
39
+ module Errors
40
+
41
+ extend Aws::Errors::DynamicErrors
42
+
43
+ class AccessDeniedException < ServiceError
44
+
45
+ # @param [Seahorse::Client::RequestContext] context
46
+ # @param [String] message
47
+ # @param [Aws::MailManager::Types::AccessDeniedException] data
48
+ def initialize(context, message, data = Aws::EmptyStructure.new)
49
+ super(context, message, data)
50
+ end
51
+
52
+ # @return [String]
53
+ def message
54
+ @message || @data[:message]
55
+ end
56
+ end
57
+
58
+ class ConflictException < ServiceError
59
+
60
+ # @param [Seahorse::Client::RequestContext] context
61
+ # @param [String] message
62
+ # @param [Aws::MailManager::Types::ConflictException] data
63
+ def initialize(context, message, data = Aws::EmptyStructure.new)
64
+ super(context, message, data)
65
+ end
66
+
67
+ # @return [String]
68
+ def message
69
+ @message || @data[:message]
70
+ end
71
+ end
72
+
73
+ class ResourceNotFoundException < ServiceError
74
+
75
+ # @param [Seahorse::Client::RequestContext] context
76
+ # @param [String] message
77
+ # @param [Aws::MailManager::Types::ResourceNotFoundException] data
78
+ def initialize(context, message, data = Aws::EmptyStructure.new)
79
+ super(context, message, data)
80
+ end
81
+
82
+ # @return [String]
83
+ def message
84
+ @message || @data[:message]
85
+ end
86
+ end
87
+
88
+ class ServiceQuotaExceededException < ServiceError
89
+
90
+ # @param [Seahorse::Client::RequestContext] context
91
+ # @param [String] message
92
+ # @param [Aws::MailManager::Types::ServiceQuotaExceededException] data
93
+ def initialize(context, message, data = Aws::EmptyStructure.new)
94
+ super(context, message, data)
95
+ end
96
+
97
+ # @return [String]
98
+ def message
99
+ @message || @data[:message]
100
+ end
101
+ end
102
+
103
+ class ThrottlingException < ServiceError
104
+
105
+ # @param [Seahorse::Client::RequestContext] context
106
+ # @param [String] message
107
+ # @param [Aws::MailManager::Types::ThrottlingException] data
108
+ def initialize(context, message, data = Aws::EmptyStructure.new)
109
+ super(context, message, data)
110
+ end
111
+
112
+ # @return [String]
113
+ def message
114
+ @message || @data[:message]
115
+ end
116
+ end
117
+
118
+ class ValidationException < ServiceError
119
+
120
+ # @param [Seahorse::Client::RequestContext] context
121
+ # @param [String] message
122
+ # @param [Aws::MailManager::Types::ValidationException] data
123
+ def initialize(context, message, data = Aws::EmptyStructure.new)
124
+ super(context, message, data)
125
+ end
126
+
127
+ # @return [String]
128
+ def message
129
+ @message || @data[:message]
130
+ end
131
+ end
132
+
133
+ end
134
+ end
@@ -0,0 +1,164 @@
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::MailManager
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::MailManager::EndpointProvider',
17
+ rbs_type: 'untyped',
18
+ docstring: 'The endpoint provider used to resolve endpoints. Any '\
19
+ 'object that responds to `#resolve_endpoint(parameters)` '\
20
+ 'where `parameters` is a Struct similar to '\
21
+ '`Aws::MailManager::EndpointParameters`'
22
+ ) do |cfg|
23
+ Aws::MailManager::EndpointProvider.new
24
+ end
25
+
26
+ # @api private
27
+ class Handler < Seahorse::Client::Handler
28
+ def call(context)
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
+
36
+ context[:endpoint_params] = params
37
+ context[:endpoint_properties] = endpoint.properties
38
+ end
39
+
40
+ context[:auth_scheme] =
41
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
42
+
43
+ @handler.call(context)
44
+ end
45
+
46
+ private
47
+
48
+ def apply_endpoint_headers(context, headers)
49
+ headers.each do |key, values|
50
+ value = values
51
+ .compact
52
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
53
+ .join(',')
54
+
55
+ context.http_request.headers[key] = value
56
+ end
57
+ end
58
+
59
+ def parameters_for_operation(context)
60
+ case context.operation_name
61
+ when :create_addon_instance
62
+ Aws::MailManager::Endpoints::CreateAddonInstance.build(context)
63
+ when :create_addon_subscription
64
+ Aws::MailManager::Endpoints::CreateAddonSubscription.build(context)
65
+ when :create_archive
66
+ Aws::MailManager::Endpoints::CreateArchive.build(context)
67
+ when :create_ingress_point
68
+ Aws::MailManager::Endpoints::CreateIngressPoint.build(context)
69
+ when :create_relay
70
+ Aws::MailManager::Endpoints::CreateRelay.build(context)
71
+ when :create_rule_set
72
+ Aws::MailManager::Endpoints::CreateRuleSet.build(context)
73
+ when :create_traffic_policy
74
+ Aws::MailManager::Endpoints::CreateTrafficPolicy.build(context)
75
+ when :delete_addon_instance
76
+ Aws::MailManager::Endpoints::DeleteAddonInstance.build(context)
77
+ when :delete_addon_subscription
78
+ Aws::MailManager::Endpoints::DeleteAddonSubscription.build(context)
79
+ when :delete_archive
80
+ Aws::MailManager::Endpoints::DeleteArchive.build(context)
81
+ when :delete_ingress_point
82
+ Aws::MailManager::Endpoints::DeleteIngressPoint.build(context)
83
+ when :delete_relay
84
+ Aws::MailManager::Endpoints::DeleteRelay.build(context)
85
+ when :delete_rule_set
86
+ Aws::MailManager::Endpoints::DeleteRuleSet.build(context)
87
+ when :delete_traffic_policy
88
+ Aws::MailManager::Endpoints::DeleteTrafficPolicy.build(context)
89
+ when :get_addon_instance
90
+ Aws::MailManager::Endpoints::GetAddonInstance.build(context)
91
+ when :get_addon_subscription
92
+ Aws::MailManager::Endpoints::GetAddonSubscription.build(context)
93
+ when :get_archive
94
+ Aws::MailManager::Endpoints::GetArchive.build(context)
95
+ when :get_archive_export
96
+ Aws::MailManager::Endpoints::GetArchiveExport.build(context)
97
+ when :get_archive_message
98
+ Aws::MailManager::Endpoints::GetArchiveMessage.build(context)
99
+ when :get_archive_message_content
100
+ Aws::MailManager::Endpoints::GetArchiveMessageContent.build(context)
101
+ when :get_archive_search
102
+ Aws::MailManager::Endpoints::GetArchiveSearch.build(context)
103
+ when :get_archive_search_results
104
+ Aws::MailManager::Endpoints::GetArchiveSearchResults.build(context)
105
+ when :get_ingress_point
106
+ Aws::MailManager::Endpoints::GetIngressPoint.build(context)
107
+ when :get_relay
108
+ Aws::MailManager::Endpoints::GetRelay.build(context)
109
+ when :get_rule_set
110
+ Aws::MailManager::Endpoints::GetRuleSet.build(context)
111
+ when :get_traffic_policy
112
+ Aws::MailManager::Endpoints::GetTrafficPolicy.build(context)
113
+ when :list_addon_instances
114
+ Aws::MailManager::Endpoints::ListAddonInstances.build(context)
115
+ when :list_addon_subscriptions
116
+ Aws::MailManager::Endpoints::ListAddonSubscriptions.build(context)
117
+ when :list_archive_exports
118
+ Aws::MailManager::Endpoints::ListArchiveExports.build(context)
119
+ when :list_archive_searches
120
+ Aws::MailManager::Endpoints::ListArchiveSearches.build(context)
121
+ when :list_archives
122
+ Aws::MailManager::Endpoints::ListArchives.build(context)
123
+ when :list_ingress_points
124
+ Aws::MailManager::Endpoints::ListIngressPoints.build(context)
125
+ when :list_relays
126
+ Aws::MailManager::Endpoints::ListRelays.build(context)
127
+ when :list_rule_sets
128
+ Aws::MailManager::Endpoints::ListRuleSets.build(context)
129
+ when :list_tags_for_resource
130
+ Aws::MailManager::Endpoints::ListTagsForResource.build(context)
131
+ when :list_traffic_policies
132
+ Aws::MailManager::Endpoints::ListTrafficPolicies.build(context)
133
+ when :start_archive_export
134
+ Aws::MailManager::Endpoints::StartArchiveExport.build(context)
135
+ when :start_archive_search
136
+ Aws::MailManager::Endpoints::StartArchiveSearch.build(context)
137
+ when :stop_archive_export
138
+ Aws::MailManager::Endpoints::StopArchiveExport.build(context)
139
+ when :stop_archive_search
140
+ Aws::MailManager::Endpoints::StopArchiveSearch.build(context)
141
+ when :tag_resource
142
+ Aws::MailManager::Endpoints::TagResource.build(context)
143
+ when :untag_resource
144
+ Aws::MailManager::Endpoints::UntagResource.build(context)
145
+ when :update_archive
146
+ Aws::MailManager::Endpoints::UpdateArchive.build(context)
147
+ when :update_ingress_point
148
+ Aws::MailManager::Endpoints::UpdateIngressPoint.build(context)
149
+ when :update_relay
150
+ Aws::MailManager::Endpoints::UpdateRelay.build(context)
151
+ when :update_rule_set
152
+ Aws::MailManager::Endpoints::UpdateRuleSet.build(context)
153
+ when :update_traffic_policy
154
+ Aws::MailManager::Endpoints::UpdateTrafficPolicy.build(context)
155
+ end
156
+ end
157
+ end
158
+
159
+ def add_handlers(handlers, _config)
160
+ handlers.add(Handler, step: :build, priority: 75)
161
+ end
162
+ end
163
+ end
164
+ end
@@ -0,0 +1,26 @@
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
+ module Aws::MailManager
11
+
12
+ class Resource
13
+
14
+ # @param options ({})
15
+ # @option options [Client] :client
16
+ def initialize(options = {})
17
+ @client = options[:client] || Client.new(options)
18
+ end
19
+
20
+ # @return [Client]
21
+ def client
22
+ @client
23
+ end
24
+
25
+ end
26
+ end