aws-sdk-internetmonitor 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,145 @@
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::InternetMonitor
12
+ module Endpoints
13
+
14
+ class CreateMonitor
15
+ def self.build(context)
16
+ unless context.config.regional_endpoint
17
+ endpoint = context.config.endpoint.to_s
18
+ end
19
+ Aws::InternetMonitor::EndpointParameters.new(
20
+ region: context.config.region,
21
+ use_fips: context.config.use_fips_endpoint,
22
+ endpoint: endpoint,
23
+ )
24
+ end
25
+ end
26
+
27
+ class DeleteMonitor
28
+ def self.build(context)
29
+ unless context.config.regional_endpoint
30
+ endpoint = context.config.endpoint.to_s
31
+ end
32
+ Aws::InternetMonitor::EndpointParameters.new(
33
+ region: context.config.region,
34
+ use_fips: context.config.use_fips_endpoint,
35
+ endpoint: endpoint,
36
+ )
37
+ end
38
+ end
39
+
40
+ class GetHealthEvent
41
+ def self.build(context)
42
+ unless context.config.regional_endpoint
43
+ endpoint = context.config.endpoint.to_s
44
+ end
45
+ Aws::InternetMonitor::EndpointParameters.new(
46
+ region: context.config.region,
47
+ use_fips: context.config.use_fips_endpoint,
48
+ endpoint: endpoint,
49
+ )
50
+ end
51
+ end
52
+
53
+ class GetMonitor
54
+ def self.build(context)
55
+ unless context.config.regional_endpoint
56
+ endpoint = context.config.endpoint.to_s
57
+ end
58
+ Aws::InternetMonitor::EndpointParameters.new(
59
+ region: context.config.region,
60
+ use_fips: context.config.use_fips_endpoint,
61
+ endpoint: endpoint,
62
+ )
63
+ end
64
+ end
65
+
66
+ class ListHealthEvents
67
+ def self.build(context)
68
+ unless context.config.regional_endpoint
69
+ endpoint = context.config.endpoint.to_s
70
+ end
71
+ Aws::InternetMonitor::EndpointParameters.new(
72
+ region: context.config.region,
73
+ use_fips: context.config.use_fips_endpoint,
74
+ endpoint: endpoint,
75
+ )
76
+ end
77
+ end
78
+
79
+ class ListMonitors
80
+ def self.build(context)
81
+ unless context.config.regional_endpoint
82
+ endpoint = context.config.endpoint.to_s
83
+ end
84
+ Aws::InternetMonitor::EndpointParameters.new(
85
+ region: context.config.region,
86
+ use_fips: context.config.use_fips_endpoint,
87
+ endpoint: endpoint,
88
+ )
89
+ end
90
+ end
91
+
92
+ class ListTagsForResource
93
+ def self.build(context)
94
+ unless context.config.regional_endpoint
95
+ endpoint = context.config.endpoint.to_s
96
+ end
97
+ Aws::InternetMonitor::EndpointParameters.new(
98
+ region: context.config.region,
99
+ use_fips: context.config.use_fips_endpoint,
100
+ endpoint: endpoint,
101
+ )
102
+ end
103
+ end
104
+
105
+ class TagResource
106
+ def self.build(context)
107
+ unless context.config.regional_endpoint
108
+ endpoint = context.config.endpoint.to_s
109
+ end
110
+ Aws::InternetMonitor::EndpointParameters.new(
111
+ region: context.config.region,
112
+ use_fips: context.config.use_fips_endpoint,
113
+ endpoint: endpoint,
114
+ )
115
+ end
116
+ end
117
+
118
+ class UntagResource
119
+ def self.build(context)
120
+ unless context.config.regional_endpoint
121
+ endpoint = context.config.endpoint.to_s
122
+ end
123
+ Aws::InternetMonitor::EndpointParameters.new(
124
+ region: context.config.region,
125
+ use_fips: context.config.use_fips_endpoint,
126
+ endpoint: endpoint,
127
+ )
128
+ end
129
+ end
130
+
131
+ class UpdateMonitor
132
+ def self.build(context)
133
+ unless context.config.regional_endpoint
134
+ endpoint = context.config.endpoint.to_s
135
+ end
136
+ Aws::InternetMonitor::EndpointParameters.new(
137
+ region: context.config.region,
138
+ use_fips: context.config.use_fips_endpoint,
139
+ endpoint: endpoint,
140
+ )
141
+ end
142
+ end
143
+
144
+ end
145
+ end
@@ -0,0 +1,238 @@
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::InternetMonitor
11
+
12
+ # When InternetMonitor returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::InternetMonitor::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all InternetMonitor errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::InternetMonitor::Errors::ServiceError
20
+ # # rescues all InternetMonitor 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
+ # * {BadRequestException}
32
+ # * {ConflictException}
33
+ # * {InternalServerErrorException}
34
+ # * {InternalServerException}
35
+ # * {LimitExceededException}
36
+ # * {NotFoundException}
37
+ # * {ResourceNotFoundException}
38
+ # * {ThrottlingException}
39
+ # * {TooManyRequestsException}
40
+ # * {ValidationException}
41
+ #
42
+ # Additionally, error classes are dynamically generated for service errors based on the error code
43
+ # if they are not defined above.
44
+ module Errors
45
+
46
+ extend Aws::Errors::DynamicErrors
47
+
48
+ class AccessDeniedException < ServiceError
49
+
50
+ # @param [Seahorse::Client::RequestContext] context
51
+ # @param [String] message
52
+ # @param [Aws::InternetMonitor::Types::AccessDeniedException] data
53
+ def initialize(context, message, data = Aws::EmptyStructure.new)
54
+ super(context, message, data)
55
+ end
56
+
57
+ # @return [String]
58
+ def message
59
+ @message || @data[:message]
60
+ end
61
+ end
62
+
63
+ class BadRequestException < ServiceError
64
+
65
+ # @param [Seahorse::Client::RequestContext] context
66
+ # @param [String] message
67
+ # @param [Aws::InternetMonitor::Types::BadRequestException] data
68
+ def initialize(context, message, data = Aws::EmptyStructure.new)
69
+ super(context, message, data)
70
+ end
71
+
72
+ # @return [String]
73
+ def message
74
+ @message || @data[:message]
75
+ end
76
+ end
77
+
78
+ class ConflictException < ServiceError
79
+
80
+ # @param [Seahorse::Client::RequestContext] context
81
+ # @param [String] message
82
+ # @param [Aws::InternetMonitor::Types::ConflictException] data
83
+ def initialize(context, message, data = Aws::EmptyStructure.new)
84
+ super(context, message, data)
85
+ end
86
+
87
+ # @return [String]
88
+ def message
89
+ @message || @data[:message]
90
+ end
91
+ end
92
+
93
+ class InternalServerErrorException < ServiceError
94
+
95
+ # @param [Seahorse::Client::RequestContext] context
96
+ # @param [String] message
97
+ # @param [Aws::InternetMonitor::Types::InternalServerErrorException] data
98
+ def initialize(context, message, data = Aws::EmptyStructure.new)
99
+ super(context, message, data)
100
+ end
101
+
102
+ # @return [String]
103
+ def message
104
+ @message || @data[:message]
105
+ end
106
+
107
+ def retryable?
108
+ true
109
+ end
110
+ end
111
+
112
+ class InternalServerException < ServiceError
113
+
114
+ # @param [Seahorse::Client::RequestContext] context
115
+ # @param [String] message
116
+ # @param [Aws::InternetMonitor::Types::InternalServerException] data
117
+ def initialize(context, message, data = Aws::EmptyStructure.new)
118
+ super(context, message, data)
119
+ end
120
+
121
+ # @return [String]
122
+ def message
123
+ @message || @data[:message]
124
+ end
125
+
126
+ def retryable?
127
+ true
128
+ end
129
+ end
130
+
131
+ class LimitExceededException < ServiceError
132
+
133
+ # @param [Seahorse::Client::RequestContext] context
134
+ # @param [String] message
135
+ # @param [Aws::InternetMonitor::Types::LimitExceededException] data
136
+ def initialize(context, message, data = Aws::EmptyStructure.new)
137
+ super(context, message, data)
138
+ end
139
+
140
+ # @return [String]
141
+ def message
142
+ @message || @data[:message]
143
+ end
144
+ end
145
+
146
+ class NotFoundException < ServiceError
147
+
148
+ # @param [Seahorse::Client::RequestContext] context
149
+ # @param [String] message
150
+ # @param [Aws::InternetMonitor::Types::NotFoundException] data
151
+ def initialize(context, message, data = Aws::EmptyStructure.new)
152
+ super(context, message, data)
153
+ end
154
+
155
+ # @return [String]
156
+ def message
157
+ @message || @data[:message]
158
+ end
159
+ end
160
+
161
+ class ResourceNotFoundException < ServiceError
162
+
163
+ # @param [Seahorse::Client::RequestContext] context
164
+ # @param [String] message
165
+ # @param [Aws::InternetMonitor::Types::ResourceNotFoundException] data
166
+ def initialize(context, message, data = Aws::EmptyStructure.new)
167
+ super(context, message, data)
168
+ end
169
+
170
+ # @return [String]
171
+ def message
172
+ @message || @data[:message]
173
+ end
174
+ end
175
+
176
+ class ThrottlingException < ServiceError
177
+
178
+ # @param [Seahorse::Client::RequestContext] context
179
+ # @param [String] message
180
+ # @param [Aws::InternetMonitor::Types::ThrottlingException] data
181
+ def initialize(context, message, data = Aws::EmptyStructure.new)
182
+ super(context, message, data)
183
+ end
184
+
185
+ # @return [String]
186
+ def message
187
+ @message || @data[:message]
188
+ end
189
+
190
+ def retryable?
191
+ true
192
+ end
193
+
194
+ def throttling?
195
+ true
196
+ end
197
+ end
198
+
199
+ class TooManyRequestsException < ServiceError
200
+
201
+ # @param [Seahorse::Client::RequestContext] context
202
+ # @param [String] message
203
+ # @param [Aws::InternetMonitor::Types::TooManyRequestsException] data
204
+ def initialize(context, message, data = Aws::EmptyStructure.new)
205
+ super(context, message, data)
206
+ end
207
+
208
+ # @return [String]
209
+ def message
210
+ @message || @data[:message]
211
+ end
212
+
213
+ def retryable?
214
+ true
215
+ end
216
+
217
+ def throttling?
218
+ true
219
+ end
220
+ end
221
+
222
+ class ValidationException < ServiceError
223
+
224
+ # @param [Seahorse::Client::RequestContext] context
225
+ # @param [String] message
226
+ # @param [Aws::InternetMonitor::Types::ValidationException] data
227
+ def initialize(context, message, data = Aws::EmptyStructure.new)
228
+ super(context, message, data)
229
+ end
230
+
231
+ # @return [String]
232
+ def message
233
+ @message || @data[:message]
234
+ end
235
+ end
236
+
237
+ end
238
+ end
@@ -0,0 +1,88 @@
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::InternetMonitor
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::InternetMonitor::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::InternetMonitor::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::InternetMonitor::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 :create_monitor
60
+ Aws::InternetMonitor::Endpoints::CreateMonitor.build(context)
61
+ when :delete_monitor
62
+ Aws::InternetMonitor::Endpoints::DeleteMonitor.build(context)
63
+ when :get_health_event
64
+ Aws::InternetMonitor::Endpoints::GetHealthEvent.build(context)
65
+ when :get_monitor
66
+ Aws::InternetMonitor::Endpoints::GetMonitor.build(context)
67
+ when :list_health_events
68
+ Aws::InternetMonitor::Endpoints::ListHealthEvents.build(context)
69
+ when :list_monitors
70
+ Aws::InternetMonitor::Endpoints::ListMonitors.build(context)
71
+ when :list_tags_for_resource
72
+ Aws::InternetMonitor::Endpoints::ListTagsForResource.build(context)
73
+ when :tag_resource
74
+ Aws::InternetMonitor::Endpoints::TagResource.build(context)
75
+ when :untag_resource
76
+ Aws::InternetMonitor::Endpoints::UntagResource.build(context)
77
+ when :update_monitor
78
+ Aws::InternetMonitor::Endpoints::UpdateMonitor.build(context)
79
+ end
80
+ end
81
+ end
82
+
83
+ def add_handlers(handlers, _config)
84
+ handlers.add(Handler, step: :build, priority: 75)
85
+ end
86
+ end
87
+ end
88
+ 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::InternetMonitor
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