aws-sdk-securitylake 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,364 @@
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::SecurityLake
11
+
12
+ # When SecurityLake returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::SecurityLake::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all SecurityLake errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::SecurityLake::Errors::ServiceError
20
+ # # rescues all SecurityLake 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
+ # * {AccountNotFoundException}
32
+ # * {BucketNotFoundException}
33
+ # * {ConcurrentModificationException}
34
+ # * {ConflictException}
35
+ # * {ConflictSourceNamesException}
36
+ # * {ConflictSubscriptionException}
37
+ # * {EventBridgeException}
38
+ # * {InternalServerException}
39
+ # * {InvalidInputException}
40
+ # * {ResourceNotFoundException}
41
+ # * {S3Exception}
42
+ # * {ServiceQuotaExceededException}
43
+ # * {ThrottlingException}
44
+ # * {ValidationException}
45
+ #
46
+ # Additionally, error classes are dynamically generated for service errors based on the error code
47
+ # if they are not defined above.
48
+ module Errors
49
+
50
+ extend Aws::Errors::DynamicErrors
51
+
52
+ class AccessDeniedException < ServiceError
53
+
54
+ # @param [Seahorse::Client::RequestContext] context
55
+ # @param [String] message
56
+ # @param [Aws::SecurityLake::Types::AccessDeniedException] data
57
+ def initialize(context, message, data = Aws::EmptyStructure.new)
58
+ super(context, message, data)
59
+ end
60
+
61
+ # @return [String]
62
+ def message
63
+ @message || @data[:message]
64
+ end
65
+ end
66
+
67
+ class AccountNotFoundException < ServiceError
68
+
69
+ # @param [Seahorse::Client::RequestContext] context
70
+ # @param [String] message
71
+ # @param [Aws::SecurityLake::Types::AccountNotFoundException] data
72
+ def initialize(context, message, data = Aws::EmptyStructure.new)
73
+ super(context, message, data)
74
+ end
75
+
76
+ # @return [String]
77
+ def message
78
+ @message || @data[:message]
79
+ end
80
+ end
81
+
82
+ class BucketNotFoundException < ServiceError
83
+
84
+ # @param [Seahorse::Client::RequestContext] context
85
+ # @param [String] message
86
+ # @param [Aws::SecurityLake::Types::BucketNotFoundException] data
87
+ def initialize(context, message, data = Aws::EmptyStructure.new)
88
+ super(context, message, data)
89
+ end
90
+
91
+ # @return [String]
92
+ def message
93
+ @message || @data[:message]
94
+ end
95
+ end
96
+
97
+ class ConcurrentModificationException < ServiceError
98
+
99
+ # @param [Seahorse::Client::RequestContext] context
100
+ # @param [String] message
101
+ # @param [Aws::SecurityLake::Types::ConcurrentModificationException] data
102
+ def initialize(context, message, data = Aws::EmptyStructure.new)
103
+ super(context, message, data)
104
+ end
105
+
106
+ # @return [String]
107
+ def message
108
+ @message || @data[:message]
109
+ end
110
+
111
+ def retryable?
112
+ true
113
+ end
114
+ end
115
+
116
+ class ConflictException < ServiceError
117
+
118
+ # @param [Seahorse::Client::RequestContext] context
119
+ # @param [String] message
120
+ # @param [Aws::SecurityLake::Types::ConflictException] data
121
+ def initialize(context, message, data = Aws::EmptyStructure.new)
122
+ super(context, message, data)
123
+ end
124
+
125
+ # @return [String]
126
+ def message
127
+ @message || @data[:message]
128
+ end
129
+
130
+ # @return [String]
131
+ def resource_id
132
+ @data[:resource_id]
133
+ end
134
+
135
+ # @return [String]
136
+ def resource_type
137
+ @data[:resource_type]
138
+ end
139
+ end
140
+
141
+ class ConflictSourceNamesException < ServiceError
142
+
143
+ # @param [Seahorse::Client::RequestContext] context
144
+ # @param [String] message
145
+ # @param [Aws::SecurityLake::Types::ConflictSourceNamesException] data
146
+ def initialize(context, message, data = Aws::EmptyStructure.new)
147
+ super(context, message, data)
148
+ end
149
+
150
+ # @return [String]
151
+ def message
152
+ @message || @data[:message]
153
+ end
154
+ end
155
+
156
+ class ConflictSubscriptionException < ServiceError
157
+
158
+ # @param [Seahorse::Client::RequestContext] context
159
+ # @param [String] message
160
+ # @param [Aws::SecurityLake::Types::ConflictSubscriptionException] data
161
+ def initialize(context, message, data = Aws::EmptyStructure.new)
162
+ super(context, message, data)
163
+ end
164
+
165
+ # @return [String]
166
+ def message
167
+ @message || @data[:message]
168
+ end
169
+ end
170
+
171
+ class EventBridgeException < ServiceError
172
+
173
+ # @param [Seahorse::Client::RequestContext] context
174
+ # @param [String] message
175
+ # @param [Aws::SecurityLake::Types::EventBridgeException] data
176
+ def initialize(context, message, data = Aws::EmptyStructure.new)
177
+ super(context, message, data)
178
+ end
179
+
180
+ # @return [String]
181
+ def message
182
+ @message || @data[:message]
183
+ end
184
+ end
185
+
186
+ class InternalServerException < ServiceError
187
+
188
+ # @param [Seahorse::Client::RequestContext] context
189
+ # @param [String] message
190
+ # @param [Aws::SecurityLake::Types::InternalServerException] data
191
+ def initialize(context, message, data = Aws::EmptyStructure.new)
192
+ super(context, message, data)
193
+ end
194
+
195
+ # @return [String]
196
+ def message
197
+ @message || @data[:message]
198
+ end
199
+
200
+ # @return [String]
201
+ def retry_after_seconds
202
+ @data[:retry_after_seconds]
203
+ end
204
+
205
+ def retryable?
206
+ true
207
+ end
208
+ end
209
+
210
+ class InvalidInputException < ServiceError
211
+
212
+ # @param [Seahorse::Client::RequestContext] context
213
+ # @param [String] message
214
+ # @param [Aws::SecurityLake::Types::InvalidInputException] data
215
+ def initialize(context, message, data = Aws::EmptyStructure.new)
216
+ super(context, message, data)
217
+ end
218
+
219
+ # @return [String]
220
+ def message
221
+ @message || @data[:message]
222
+ end
223
+ end
224
+
225
+ class ResourceNotFoundException < ServiceError
226
+
227
+ # @param [Seahorse::Client::RequestContext] context
228
+ # @param [String] message
229
+ # @param [Aws::SecurityLake::Types::ResourceNotFoundException] data
230
+ def initialize(context, message, data = Aws::EmptyStructure.new)
231
+ super(context, message, data)
232
+ end
233
+
234
+ # @return [String]
235
+ def message
236
+ @message || @data[:message]
237
+ end
238
+
239
+ # @return [String]
240
+ def resource_id
241
+ @data[:resource_id]
242
+ end
243
+
244
+ # @return [String]
245
+ def resource_type
246
+ @data[:resource_type]
247
+ end
248
+ end
249
+
250
+ class S3Exception < ServiceError
251
+
252
+ # @param [Seahorse::Client::RequestContext] context
253
+ # @param [String] message
254
+ # @param [Aws::SecurityLake::Types::S3Exception] data
255
+ def initialize(context, message, data = Aws::EmptyStructure.new)
256
+ super(context, message, data)
257
+ end
258
+
259
+ # @return [String]
260
+ def message
261
+ @message || @data[:message]
262
+ end
263
+ end
264
+
265
+ class ServiceQuotaExceededException < ServiceError
266
+
267
+ # @param [Seahorse::Client::RequestContext] context
268
+ # @param [String] message
269
+ # @param [Aws::SecurityLake::Types::ServiceQuotaExceededException] data
270
+ def initialize(context, message, data = Aws::EmptyStructure.new)
271
+ super(context, message, data)
272
+ end
273
+
274
+ # @return [String]
275
+ def message
276
+ @message || @data[:message]
277
+ end
278
+
279
+ # @return [String]
280
+ def quota_code
281
+ @data[:quota_code]
282
+ end
283
+
284
+ # @return [String]
285
+ def resource_id
286
+ @data[:resource_id]
287
+ end
288
+
289
+ # @return [String]
290
+ def resource_type
291
+ @data[:resource_type]
292
+ end
293
+
294
+ # @return [String]
295
+ def service_code
296
+ @data[:service_code]
297
+ end
298
+ end
299
+
300
+ class ThrottlingException < ServiceError
301
+
302
+ # @param [Seahorse::Client::RequestContext] context
303
+ # @param [String] message
304
+ # @param [Aws::SecurityLake::Types::ThrottlingException] data
305
+ def initialize(context, message, data = Aws::EmptyStructure.new)
306
+ super(context, message, data)
307
+ end
308
+
309
+ # @return [String]
310
+ def message
311
+ @message || @data[:message]
312
+ end
313
+
314
+ # @return [String]
315
+ def quota_code
316
+ @data[:quota_code]
317
+ end
318
+
319
+ # @return [String]
320
+ def retry_after_seconds
321
+ @data[:retry_after_seconds]
322
+ end
323
+
324
+ # @return [String]
325
+ def service_code
326
+ @data[:service_code]
327
+ end
328
+
329
+ def retryable?
330
+ true
331
+ end
332
+
333
+ def throttling?
334
+ true
335
+ end
336
+ end
337
+
338
+ class ValidationException < ServiceError
339
+
340
+ # @param [Seahorse::Client::RequestContext] context
341
+ # @param [String] message
342
+ # @param [Aws::SecurityLake::Types::ValidationException] data
343
+ def initialize(context, message, data = Aws::EmptyStructure.new)
344
+ super(context, message, data)
345
+ end
346
+
347
+ # @return [String]
348
+ def field_list
349
+ @data[:field_list]
350
+ end
351
+
352
+ # @return [String]
353
+ def message
354
+ @message || @data[:message]
355
+ end
356
+
357
+ # @return [String]
358
+ def reason
359
+ @data[:reason]
360
+ end
361
+ end
362
+
363
+ end
364
+ end
@@ -0,0 +1,128 @@
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::SecurityLake
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::SecurityLake::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::SecurityLake::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::SecurityLake::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_aws_log_source
60
+ Aws::SecurityLake::Endpoints::CreateAwsLogSource.build(context)
61
+ when :create_custom_log_source
62
+ Aws::SecurityLake::Endpoints::CreateCustomLogSource.build(context)
63
+ when :create_datalake
64
+ Aws::SecurityLake::Endpoints::CreateDatalake.build(context)
65
+ when :create_datalake_auto_enable
66
+ Aws::SecurityLake::Endpoints::CreateDatalakeAutoEnable.build(context)
67
+ when :create_datalake_delegated_admin
68
+ Aws::SecurityLake::Endpoints::CreateDatalakeDelegatedAdmin.build(context)
69
+ when :create_datalake_exceptions_subscription
70
+ Aws::SecurityLake::Endpoints::CreateDatalakeExceptionsSubscription.build(context)
71
+ when :create_subscriber
72
+ Aws::SecurityLake::Endpoints::CreateSubscriber.build(context)
73
+ when :create_subscription_notification_configuration
74
+ Aws::SecurityLake::Endpoints::CreateSubscriptionNotificationConfiguration.build(context)
75
+ when :delete_aws_log_source
76
+ Aws::SecurityLake::Endpoints::DeleteAwsLogSource.build(context)
77
+ when :delete_custom_log_source
78
+ Aws::SecurityLake::Endpoints::DeleteCustomLogSource.build(context)
79
+ when :delete_datalake
80
+ Aws::SecurityLake::Endpoints::DeleteDatalake.build(context)
81
+ when :delete_datalake_auto_enable
82
+ Aws::SecurityLake::Endpoints::DeleteDatalakeAutoEnable.build(context)
83
+ when :delete_datalake_delegated_admin
84
+ Aws::SecurityLake::Endpoints::DeleteDatalakeDelegatedAdmin.build(context)
85
+ when :delete_datalake_exceptions_subscription
86
+ Aws::SecurityLake::Endpoints::DeleteDatalakeExceptionsSubscription.build(context)
87
+ when :delete_subscriber
88
+ Aws::SecurityLake::Endpoints::DeleteSubscriber.build(context)
89
+ when :delete_subscription_notification_configuration
90
+ Aws::SecurityLake::Endpoints::DeleteSubscriptionNotificationConfiguration.build(context)
91
+ when :get_datalake
92
+ Aws::SecurityLake::Endpoints::GetDatalake.build(context)
93
+ when :get_datalake_auto_enable
94
+ Aws::SecurityLake::Endpoints::GetDatalakeAutoEnable.build(context)
95
+ when :get_datalake_exceptions_expiry
96
+ Aws::SecurityLake::Endpoints::GetDatalakeExceptionsExpiry.build(context)
97
+ when :get_datalake_exceptions_subscription
98
+ Aws::SecurityLake::Endpoints::GetDatalakeExceptionsSubscription.build(context)
99
+ when :get_datalake_status
100
+ Aws::SecurityLake::Endpoints::GetDatalakeStatus.build(context)
101
+ when :get_subscriber
102
+ Aws::SecurityLake::Endpoints::GetSubscriber.build(context)
103
+ when :list_datalake_exceptions
104
+ Aws::SecurityLake::Endpoints::ListDatalakeExceptions.build(context)
105
+ when :list_log_sources
106
+ Aws::SecurityLake::Endpoints::ListLogSources.build(context)
107
+ when :list_subscribers
108
+ Aws::SecurityLake::Endpoints::ListSubscribers.build(context)
109
+ when :update_datalake
110
+ Aws::SecurityLake::Endpoints::UpdateDatalake.build(context)
111
+ when :update_datalake_exceptions_expiry
112
+ Aws::SecurityLake::Endpoints::UpdateDatalakeExceptionsExpiry.build(context)
113
+ when :update_datalake_exceptions_subscription
114
+ Aws::SecurityLake::Endpoints::UpdateDatalakeExceptionsSubscription.build(context)
115
+ when :update_subscriber
116
+ Aws::SecurityLake::Endpoints::UpdateSubscriber.build(context)
117
+ when :update_subscription_notification_configuration
118
+ Aws::SecurityLake::Endpoints::UpdateSubscriptionNotificationConfiguration.build(context)
119
+ end
120
+ end
121
+ end
122
+
123
+ def add_handlers(handlers, _config)
124
+ handlers.add(Handler, step: :build, priority: 75)
125
+ end
126
+ end
127
+ end
128
+ 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::SecurityLake
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