aws-sdk-recyclebin 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,761 @@
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
+ require 'seahorse/client/plugins/content_length.rb'
11
+ require 'aws-sdk-core/plugins/credentials_configuration.rb'
12
+ require 'aws-sdk-core/plugins/logging.rb'
13
+ require 'aws-sdk-core/plugins/param_converter.rb'
14
+ require 'aws-sdk-core/plugins/param_validator.rb'
15
+ require 'aws-sdk-core/plugins/user_agent.rb'
16
+ require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
17
+ require 'aws-sdk-core/plugins/retry_errors.rb'
18
+ require 'aws-sdk-core/plugins/global_configuration.rb'
19
+ require 'aws-sdk-core/plugins/regional_endpoint.rb'
20
+ require 'aws-sdk-core/plugins/endpoint_discovery.rb'
21
+ require 'aws-sdk-core/plugins/endpoint_pattern.rb'
22
+ require 'aws-sdk-core/plugins/response_paging.rb'
23
+ require 'aws-sdk-core/plugins/stub_responses.rb'
24
+ require 'aws-sdk-core/plugins/idempotency_token.rb'
25
+ require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
26
+ require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
27
+ require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
28
+ require 'aws-sdk-core/plugins/transfer_encoding.rb'
29
+ require 'aws-sdk-core/plugins/http_checksum.rb'
30
+ require 'aws-sdk-core/plugins/signature_v4.rb'
31
+ require 'aws-sdk-core/plugins/protocols/rest_json.rb'
32
+
33
+ Aws::Plugins::GlobalConfiguration.add_identifier(:recyclebin)
34
+
35
+ module Aws::RecycleBin
36
+ # An API client for RecycleBin. To construct a client, you need to configure a `:region` and `:credentials`.
37
+ #
38
+ # client = Aws::RecycleBin::Client.new(
39
+ # region: region_name,
40
+ # credentials: credentials,
41
+ # # ...
42
+ # )
43
+ #
44
+ # For details on configuring region and credentials see
45
+ # the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
46
+ #
47
+ # See {#initialize} for a full list of supported configuration options.
48
+ class Client < Seahorse::Client::Base
49
+
50
+ include Aws::ClientStubs
51
+
52
+ @identifier = :recyclebin
53
+
54
+ set_api(ClientApi::API)
55
+
56
+ add_plugin(Seahorse::Client::Plugins::ContentLength)
57
+ add_plugin(Aws::Plugins::CredentialsConfiguration)
58
+ add_plugin(Aws::Plugins::Logging)
59
+ add_plugin(Aws::Plugins::ParamConverter)
60
+ add_plugin(Aws::Plugins::ParamValidator)
61
+ add_plugin(Aws::Plugins::UserAgent)
62
+ add_plugin(Aws::Plugins::HelpfulSocketErrors)
63
+ add_plugin(Aws::Plugins::RetryErrors)
64
+ add_plugin(Aws::Plugins::GlobalConfiguration)
65
+ add_plugin(Aws::Plugins::RegionalEndpoint)
66
+ add_plugin(Aws::Plugins::EndpointDiscovery)
67
+ add_plugin(Aws::Plugins::EndpointPattern)
68
+ add_plugin(Aws::Plugins::ResponsePaging)
69
+ add_plugin(Aws::Plugins::StubResponses)
70
+ add_plugin(Aws::Plugins::IdempotencyToken)
71
+ add_plugin(Aws::Plugins::JsonvalueConverter)
72
+ add_plugin(Aws::Plugins::ClientMetricsPlugin)
73
+ add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
74
+ add_plugin(Aws::Plugins::TransferEncoding)
75
+ add_plugin(Aws::Plugins::HttpChecksum)
76
+ add_plugin(Aws::Plugins::SignatureV4)
77
+ add_plugin(Aws::Plugins::Protocols::RestJson)
78
+
79
+ # @overload initialize(options)
80
+ # @param [Hash] options
81
+ # @option options [required, Aws::CredentialProvider] :credentials
82
+ # Your AWS credentials. This can be an instance of any one of the
83
+ # following classes:
84
+ #
85
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
86
+ # credentials.
87
+ #
88
+ # * `Aws::SharedCredentials` - Used for loading static credentials from a
89
+ # shared file, such as `~/.aws/config`.
90
+ #
91
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
92
+ #
93
+ # * `Aws::AssumeRoleWebIdentityCredentials` - Used when you need to
94
+ # assume a role after providing credentials via the web.
95
+ #
96
+ # * `Aws::SSOCredentials` - Used for loading credentials from AWS SSO using an
97
+ # access token generated from `aws login`.
98
+ #
99
+ # * `Aws::ProcessCredentials` - Used for loading credentials from a
100
+ # process that outputs to stdout.
101
+ #
102
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
103
+ # from an EC2 IMDS on an EC2 instance.
104
+ #
105
+ # * `Aws::ECSCredentials` - Used for loading credentials from
106
+ # instances running in ECS.
107
+ #
108
+ # * `Aws::CognitoIdentityCredentials` - Used for loading credentials
109
+ # from the Cognito Identity service.
110
+ #
111
+ # When `:credentials` are not configured directly, the following
112
+ # locations will be searched for credentials:
113
+ #
114
+ # * `Aws.config[:credentials]`
115
+ # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
116
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
117
+ # * `~/.aws/credentials`
118
+ # * `~/.aws/config`
119
+ # * EC2/ECS IMDS instance profile - When used by default, the timeouts
120
+ # are very aggressive. Construct and pass an instance of
121
+ # `Aws::InstanceProfileCredentails` or `Aws::ECSCredentials` to
122
+ # enable retries and extended timeouts.
123
+ #
124
+ # @option options [required, String] :region
125
+ # The AWS region to connect to. The configured `:region` is
126
+ # used to determine the service `:endpoint`. When not passed,
127
+ # a default `:region` is searched for in the following locations:
128
+ #
129
+ # * `Aws.config[:region]`
130
+ # * `ENV['AWS_REGION']`
131
+ # * `ENV['AMAZON_REGION']`
132
+ # * `ENV['AWS_DEFAULT_REGION']`
133
+ # * `~/.aws/credentials`
134
+ # * `~/.aws/config`
135
+ #
136
+ # @option options [String] :access_key_id
137
+ #
138
+ # @option options [Boolean] :active_endpoint_cache (false)
139
+ # When set to `true`, a thread polling for endpoints will be running in
140
+ # the background every 60 secs (default). Defaults to `false`.
141
+ #
142
+ # @option options [Boolean] :adaptive_retry_wait_to_fill (true)
143
+ # Used only in `adaptive` retry mode. When true, the request will sleep
144
+ # until there is sufficent client side capacity to retry the request.
145
+ # When false, the request will raise a `RetryCapacityNotAvailableError` and will
146
+ # not retry instead of sleeping.
147
+ #
148
+ # @option options [Boolean] :client_side_monitoring (false)
149
+ # When `true`, client-side metrics will be collected for all API requests from
150
+ # this client.
151
+ #
152
+ # @option options [String] :client_side_monitoring_client_id ("")
153
+ # Allows you to provide an identifier for this client which will be attached to
154
+ # all generated client side metrics. Defaults to an empty string.
155
+ #
156
+ # @option options [String] :client_side_monitoring_host ("127.0.0.1")
157
+ # Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client
158
+ # side monitoring agent is running on, where client metrics will be published via UDP.
159
+ #
160
+ # @option options [Integer] :client_side_monitoring_port (31000)
161
+ # Required for publishing client metrics. The port that the client side monitoring
162
+ # agent is running on, where client metrics will be published via UDP.
163
+ #
164
+ # @option options [Aws::ClientSideMonitoring::Publisher] :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher)
165
+ # Allows you to provide a custom client-side monitoring publisher class. By default,
166
+ # will use the Client Side Monitoring Agent Publisher.
167
+ #
168
+ # @option options [Boolean] :convert_params (true)
169
+ # When `true`, an attempt is made to coerce request parameters into
170
+ # the required types.
171
+ #
172
+ # @option options [Boolean] :correct_clock_skew (true)
173
+ # Used only in `standard` and adaptive retry modes. Specifies whether to apply
174
+ # a clock skew correction and retry requests with skewed client clocks.
175
+ #
176
+ # @option options [Boolean] :disable_host_prefix_injection (false)
177
+ # Set to true to disable SDK automatically adding host prefix
178
+ # to default service endpoint when available.
179
+ #
180
+ # @option options [String] :endpoint
181
+ # The client endpoint is normally constructed from the `:region`
182
+ # option. You should only configure an `:endpoint` when connecting
183
+ # to test or custom endpoints. This should be a valid HTTP(S) URI.
184
+ #
185
+ # @option options [Integer] :endpoint_cache_max_entries (1000)
186
+ # Used for the maximum size limit of the LRU cache storing endpoints data
187
+ # for endpoint discovery enabled operations. Defaults to 1000.
188
+ #
189
+ # @option options [Integer] :endpoint_cache_max_threads (10)
190
+ # Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.
191
+ #
192
+ # @option options [Integer] :endpoint_cache_poll_interval (60)
193
+ # When :endpoint_discovery and :active_endpoint_cache is enabled,
194
+ # Use this option to config the time interval in seconds for making
195
+ # requests fetching endpoints information. Defaults to 60 sec.
196
+ #
197
+ # @option options [Boolean] :endpoint_discovery (false)
198
+ # When set to `true`, endpoint discovery will be enabled for operations when available.
199
+ #
200
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
201
+ # The log formatter.
202
+ #
203
+ # @option options [Symbol] :log_level (:info)
204
+ # The log level to send messages to the `:logger` at.
205
+ #
206
+ # @option options [Logger] :logger
207
+ # The Logger instance to send log messages to. If this option
208
+ # is not set, logging will be disabled.
209
+ #
210
+ # @option options [Integer] :max_attempts (3)
211
+ # An integer representing the maximum number attempts that will be made for
212
+ # a single request, including the initial attempt. For example,
213
+ # setting this value to 5 will result in a request being retried up to
214
+ # 4 times. Used in `standard` and `adaptive` retry modes.
215
+ #
216
+ # @option options [String] :profile ("default")
217
+ # Used when loading credentials from the shared credentials file
218
+ # at HOME/.aws/credentials. When not specified, 'default' is used.
219
+ #
220
+ # @option options [Proc] :retry_backoff
221
+ # A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
222
+ # This option is only used in the `legacy` retry mode.
223
+ #
224
+ # @option options [Float] :retry_base_delay (0.3)
225
+ # The base delay in seconds used by the default backoff function. This option
226
+ # is only used in the `legacy` retry mode.
227
+ #
228
+ # @option options [Symbol] :retry_jitter (:none)
229
+ # A delay randomiser function used by the default backoff function.
230
+ # Some predefined functions can be referenced by name - :none, :equal, :full,
231
+ # otherwise a Proc that takes and returns a number. This option is only used
232
+ # in the `legacy` retry mode.
233
+ #
234
+ # @see https://www.awsarchitectureblog.com/2015/03/backoff.html
235
+ #
236
+ # @option options [Integer] :retry_limit (3)
237
+ # The maximum number of times to retry failed requests. Only
238
+ # ~ 500 level server errors and certain ~ 400 level client errors
239
+ # are retried. Generally, these are throttling errors, data
240
+ # checksum errors, networking errors, timeout errors, auth errors,
241
+ # endpoint discovery, and errors from expired credentials.
242
+ # This option is only used in the `legacy` retry mode.
243
+ #
244
+ # @option options [Integer] :retry_max_delay (0)
245
+ # The maximum number of seconds to delay between retries (0 for no limit)
246
+ # used by the default backoff function. This option is only used in the
247
+ # `legacy` retry mode.
248
+ #
249
+ # @option options [String] :retry_mode ("legacy")
250
+ # Specifies which retry algorithm to use. Values are:
251
+ #
252
+ # * `legacy` - The pre-existing retry behavior. This is default value if
253
+ # no retry mode is provided.
254
+ #
255
+ # * `standard` - A standardized set of retry rules across the AWS SDKs.
256
+ # This includes support for retry quotas, which limit the number of
257
+ # unsuccessful retries a client can make.
258
+ #
259
+ # * `adaptive` - An experimental retry mode that includes all the
260
+ # functionality of `standard` mode along with automatic client side
261
+ # throttling. This is a provisional mode that may change behavior
262
+ # in the future.
263
+ #
264
+ #
265
+ # @option options [String] :secret_access_key
266
+ #
267
+ # @option options [String] :session_token
268
+ #
269
+ # @option options [Boolean] :stub_responses (false)
270
+ # Causes the client to return stubbed responses. By default
271
+ # fake responses are generated and returned. You can specify
272
+ # the response data to return or errors to raise by calling
273
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
274
+ #
275
+ # ** Please note ** When response stubbing is enabled, no HTTP
276
+ # requests are made, and retries are disabled.
277
+ #
278
+ # @option options [Boolean] :use_dualstack_endpoint
279
+ # When set to `true`, dualstack enabled endpoints (with `.aws` TLD)
280
+ # will be used if available.
281
+ #
282
+ # @option options [Boolean] :use_fips_endpoint
283
+ # When set to `true`, fips compatible endpoints will be used if available.
284
+ # When a `fips` region is used, the region is normalized and this config
285
+ # is set to `true`.
286
+ #
287
+ # @option options [Boolean] :validate_params (true)
288
+ # When `true`, request parameters are validated before
289
+ # sending the request.
290
+ #
291
+ # @option options [URI::HTTP,String] :http_proxy A proxy to send
292
+ # requests through. Formatted like 'http://proxy.com:123'.
293
+ #
294
+ # @option options [Float] :http_open_timeout (15) The number of
295
+ # seconds to wait when opening a HTTP session before raising a
296
+ # `Timeout::Error`.
297
+ #
298
+ # @option options [Integer] :http_read_timeout (60) The default
299
+ # number of seconds to wait for response data. This value can
300
+ # safely be set per-request on the session.
301
+ #
302
+ # @option options [Float] :http_idle_timeout (5) The number of
303
+ # seconds a connection is allowed to sit idle before it is
304
+ # considered stale. Stale connections are closed and removed
305
+ # from the pool before making a request.
306
+ #
307
+ # @option options [Float] :http_continue_timeout (1) The number of
308
+ # seconds to wait for a 100-continue response before sending the
309
+ # request body. This option has no effect unless the request has
310
+ # "Expect" header set to "100-continue". Defaults to `nil` which
311
+ # disables this behaviour. This value can safely be set per
312
+ # request on the session.
313
+ #
314
+ # @option options [Boolean] :http_wire_trace (false) When `true`,
315
+ # HTTP debug output will be sent to the `:logger`.
316
+ #
317
+ # @option options [Boolean] :ssl_verify_peer (true) When `true`,
318
+ # SSL peer certificates are verified when establishing a
319
+ # connection.
320
+ #
321
+ # @option options [String] :ssl_ca_bundle Full path to the SSL
322
+ # certificate authority bundle file that should be used when
323
+ # verifying peer certificates. If you do not pass
324
+ # `:ssl_ca_bundle` or `:ssl_ca_directory` the the system default
325
+ # will be used if available.
326
+ #
327
+ # @option options [String] :ssl_ca_directory Full path of the
328
+ # directory that contains the unbundled SSL certificate
329
+ # authority files for verifying peer certificates. If you do
330
+ # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the
331
+ # system default will be used if available.
332
+ #
333
+ def initialize(*args)
334
+ super
335
+ end
336
+
337
+ # @!group API Operations
338
+
339
+ # Creates a Recycle Bin retention rule. For more information, see [
340
+ # Create Recycle Bin retention rules][1] in the *Amazon EC2 User Guide*.
341
+ #
342
+ #
343
+ #
344
+ # [1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recycle-bin-working-with-rules.html#recycle-bin-create-rule
345
+ #
346
+ # @option params [required, Types::RetentionPeriod] :retention_period
347
+ # Information about the retention period for which the retention rule is
348
+ # to retain resources.
349
+ #
350
+ # @option params [String] :description
351
+ # A brief description for the retention rule.
352
+ #
353
+ # @option params [Array<Types::Tag>] :tags
354
+ # Information about the tags to assign to the retention rule.
355
+ #
356
+ # @option params [required, String] :resource_type
357
+ # The resource type to be retained by the retention rule. Currently,
358
+ # only Amazon EBS snapshots are supported.
359
+ #
360
+ # @option params [Array<Types::ResourceTag>] :resource_tags
361
+ # Information about the resource tags to use to identify resources that
362
+ # are to be retained by the retention rule. The retention rule retains
363
+ # only deleted snapshots that have one or more of the specified tag key
364
+ # and value pairs. If a snapshot is deleted, but it does not have any of
365
+ # the specified tag key and value pairs, it is immediately deleted
366
+ # without being retained by the retention rule.
367
+ #
368
+ # You can add the same tag key and value pair to a maximum or five
369
+ # retention rules.
370
+ #
371
+ # @return [Types::CreateRuleResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
372
+ #
373
+ # * {Types::CreateRuleResponse#identifier #identifier} => String
374
+ # * {Types::CreateRuleResponse#retention_period #retention_period} => Types::RetentionPeriod
375
+ # * {Types::CreateRuleResponse#description #description} => String
376
+ # * {Types::CreateRuleResponse#tags #tags} => Array&lt;Types::Tag&gt;
377
+ # * {Types::CreateRuleResponse#resource_type #resource_type} => String
378
+ # * {Types::CreateRuleResponse#resource_tags #resource_tags} => Array&lt;Types::ResourceTag&gt;
379
+ # * {Types::CreateRuleResponse#status #status} => String
380
+ #
381
+ # @example Request syntax with placeholder values
382
+ #
383
+ # resp = client.create_rule({
384
+ # retention_period: { # required
385
+ # retention_period_value: 1, # required
386
+ # retention_period_unit: "DAYS", # required, accepts DAYS
387
+ # },
388
+ # description: "Description",
389
+ # tags: [
390
+ # {
391
+ # key: "TagKey", # required
392
+ # value: "TagValue", # required
393
+ # },
394
+ # ],
395
+ # resource_type: "EBS_SNAPSHOT", # required, accepts EBS_SNAPSHOT
396
+ # resource_tags: [
397
+ # {
398
+ # resource_tag_key: "ResourceTagKey", # required
399
+ # resource_tag_value: "ResourceTagValue",
400
+ # },
401
+ # ],
402
+ # })
403
+ #
404
+ # @example Response structure
405
+ #
406
+ # resp.identifier #=> String
407
+ # resp.retention_period.retention_period_value #=> Integer
408
+ # resp.retention_period.retention_period_unit #=> String, one of "DAYS"
409
+ # resp.description #=> String
410
+ # resp.tags #=> Array
411
+ # resp.tags[0].key #=> String
412
+ # resp.tags[0].value #=> String
413
+ # resp.resource_type #=> String, one of "EBS_SNAPSHOT"
414
+ # resp.resource_tags #=> Array
415
+ # resp.resource_tags[0].resource_tag_key #=> String
416
+ # resp.resource_tags[0].resource_tag_value #=> String
417
+ # resp.status #=> String, one of "pending", "available"
418
+ #
419
+ # @see http://docs.aws.amazon.com/goto/WebAPI/rbin-2021-06-15/CreateRule AWS API Documentation
420
+ #
421
+ # @overload create_rule(params = {})
422
+ # @param [Hash] params ({})
423
+ def create_rule(params = {}, options = {})
424
+ req = build_request(:create_rule, params)
425
+ req.send_request(options)
426
+ end
427
+
428
+ # Deletes a Recycle Bin retention rule. For more information, see [
429
+ # Delete Recycle Bin retention rules][1] in the *Amazon EC2 User Guide*.
430
+ #
431
+ #
432
+ #
433
+ # [1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recycle-bin-working-with-rules.html#recycle-bin-delete-rule
434
+ #
435
+ # @option params [required, String] :identifier
436
+ # The unique ID of the retention rule to delete.
437
+ #
438
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
439
+ #
440
+ # @example Request syntax with placeholder values
441
+ #
442
+ # resp = client.delete_rule({
443
+ # identifier: "RuleIdentifier", # required
444
+ # })
445
+ #
446
+ # @see http://docs.aws.amazon.com/goto/WebAPI/rbin-2021-06-15/DeleteRule AWS API Documentation
447
+ #
448
+ # @overload delete_rule(params = {})
449
+ # @param [Hash] params ({})
450
+ def delete_rule(params = {}, options = {})
451
+ req = build_request(:delete_rule, params)
452
+ req.send_request(options)
453
+ end
454
+
455
+ # Gets information about a Recycle Bin retention rule.
456
+ #
457
+ # @option params [required, String] :identifier
458
+ # The unique ID of the retention rule.
459
+ #
460
+ # @return [Types::GetRuleResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
461
+ #
462
+ # * {Types::GetRuleResponse#identifier #identifier} => String
463
+ # * {Types::GetRuleResponse#description #description} => String
464
+ # * {Types::GetRuleResponse#resource_type #resource_type} => String
465
+ # * {Types::GetRuleResponse#retention_period #retention_period} => Types::RetentionPeriod
466
+ # * {Types::GetRuleResponse#resource_tags #resource_tags} => Array&lt;Types::ResourceTag&gt;
467
+ # * {Types::GetRuleResponse#status #status} => String
468
+ #
469
+ # @example Request syntax with placeholder values
470
+ #
471
+ # resp = client.get_rule({
472
+ # identifier: "RuleIdentifier", # required
473
+ # })
474
+ #
475
+ # @example Response structure
476
+ #
477
+ # resp.identifier #=> String
478
+ # resp.description #=> String
479
+ # resp.resource_type #=> String, one of "EBS_SNAPSHOT"
480
+ # resp.retention_period.retention_period_value #=> Integer
481
+ # resp.retention_period.retention_period_unit #=> String, one of "DAYS"
482
+ # resp.resource_tags #=> Array
483
+ # resp.resource_tags[0].resource_tag_key #=> String
484
+ # resp.resource_tags[0].resource_tag_value #=> String
485
+ # resp.status #=> String, one of "pending", "available"
486
+ #
487
+ # @see http://docs.aws.amazon.com/goto/WebAPI/rbin-2021-06-15/GetRule AWS API Documentation
488
+ #
489
+ # @overload get_rule(params = {})
490
+ # @param [Hash] params ({})
491
+ def get_rule(params = {}, options = {})
492
+ req = build_request(:get_rule, params)
493
+ req.send_request(options)
494
+ end
495
+
496
+ # Lists the Recycle Bin retention rules in the Region.
497
+ #
498
+ # @option params [Integer] :max_results
499
+ # The maximum number of results to return for the request in a single
500
+ # page. The remaining results can be seen by sending another request
501
+ # with the returned `nextToken` value. This value can be between 5 and
502
+ # 500. If `maxResults` is given a larger value than 500, you receive an
503
+ # error.
504
+ #
505
+ # @option params [String] :next_token
506
+ # The token to use to retrieve the next page of results.
507
+ #
508
+ # @option params [required, String] :resource_type
509
+ # The resource type retained by the retention rule. Only retention rules
510
+ # that retain the specified resource type are listed.
511
+ #
512
+ # @option params [Array<Types::ResourceTag>] :resource_tags
513
+ # The tags used to identify resources that are to be retained by the
514
+ # retention rule.
515
+ #
516
+ # @return [Types::ListRulesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
517
+ #
518
+ # * {Types::ListRulesResponse#rules #rules} => Array&lt;Types::RuleSummary&gt;
519
+ # * {Types::ListRulesResponse#next_token #next_token} => String
520
+ #
521
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
522
+ #
523
+ # @example Request syntax with placeholder values
524
+ #
525
+ # resp = client.list_rules({
526
+ # max_results: 1,
527
+ # next_token: "NextToken",
528
+ # resource_type: "EBS_SNAPSHOT", # required, accepts EBS_SNAPSHOT
529
+ # resource_tags: [
530
+ # {
531
+ # resource_tag_key: "ResourceTagKey", # required
532
+ # resource_tag_value: "ResourceTagValue",
533
+ # },
534
+ # ],
535
+ # })
536
+ #
537
+ # @example Response structure
538
+ #
539
+ # resp.rules #=> Array
540
+ # resp.rules[0].identifier #=> String
541
+ # resp.rules[0].description #=> String
542
+ # resp.rules[0].retention_period.retention_period_value #=> Integer
543
+ # resp.rules[0].retention_period.retention_period_unit #=> String, one of "DAYS"
544
+ # resp.next_token #=> String
545
+ #
546
+ # @see http://docs.aws.amazon.com/goto/WebAPI/rbin-2021-06-15/ListRules AWS API Documentation
547
+ #
548
+ # @overload list_rules(params = {})
549
+ # @param [Hash] params ({})
550
+ def list_rules(params = {}, options = {})
551
+ req = build_request(:list_rules, params)
552
+ req.send_request(options)
553
+ end
554
+
555
+ # Lists the tags assigned a specific resource.
556
+ #
557
+ # @option params [required, String] :resource_arn
558
+ # The Amazon Resource Name (ARN) of the resource for which to list the
559
+ # tags.
560
+ #
561
+ # @return [Types::ListTagsForResourceResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
562
+ #
563
+ # * {Types::ListTagsForResourceResponse#tags #tags} => Array&lt;Types::Tag&gt;
564
+ #
565
+ # @example Request syntax with placeholder values
566
+ #
567
+ # resp = client.list_tags_for_resource({
568
+ # resource_arn: "RuleArn", # required
569
+ # })
570
+ #
571
+ # @example Response structure
572
+ #
573
+ # resp.tags #=> Array
574
+ # resp.tags[0].key #=> String
575
+ # resp.tags[0].value #=> String
576
+ #
577
+ # @see http://docs.aws.amazon.com/goto/WebAPI/rbin-2021-06-15/ListTagsForResource AWS API Documentation
578
+ #
579
+ # @overload list_tags_for_resource(params = {})
580
+ # @param [Hash] params ({})
581
+ def list_tags_for_resource(params = {}, options = {})
582
+ req = build_request(:list_tags_for_resource, params)
583
+ req.send_request(options)
584
+ end
585
+
586
+ # Assigns tags to the specified resource.
587
+ #
588
+ # @option params [required, String] :resource_arn
589
+ # The Amazon Resource Name (ARN) of the resource to which to assign the
590
+ # tags.
591
+ #
592
+ # @option params [required, Array<Types::Tag>] :tags
593
+ # Information about the tags to assign to the resource.
594
+ #
595
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
596
+ #
597
+ # @example Request syntax with placeholder values
598
+ #
599
+ # resp = client.tag_resource({
600
+ # resource_arn: "RuleArn", # required
601
+ # tags: [ # required
602
+ # {
603
+ # key: "TagKey", # required
604
+ # value: "TagValue", # required
605
+ # },
606
+ # ],
607
+ # })
608
+ #
609
+ # @see http://docs.aws.amazon.com/goto/WebAPI/rbin-2021-06-15/TagResource AWS API Documentation
610
+ #
611
+ # @overload tag_resource(params = {})
612
+ # @param [Hash] params ({})
613
+ def tag_resource(params = {}, options = {})
614
+ req = build_request(:tag_resource, params)
615
+ req.send_request(options)
616
+ end
617
+
618
+ # Unassigns a tag from a resource.
619
+ #
620
+ # @option params [required, String] :resource_arn
621
+ # The Amazon Resource Name (ARN) of the resource from which to unassign
622
+ # the tags.
623
+ #
624
+ # @option params [required, Array<String>] :tag_keys
625
+ # Information about the tags to unassign from the resource.
626
+ #
627
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
628
+ #
629
+ # @example Request syntax with placeholder values
630
+ #
631
+ # resp = client.untag_resource({
632
+ # resource_arn: "RuleArn", # required
633
+ # tag_keys: ["TagKey"], # required
634
+ # })
635
+ #
636
+ # @see http://docs.aws.amazon.com/goto/WebAPI/rbin-2021-06-15/UntagResource AWS API Documentation
637
+ #
638
+ # @overload untag_resource(params = {})
639
+ # @param [Hash] params ({})
640
+ def untag_resource(params = {}, options = {})
641
+ req = build_request(:untag_resource, params)
642
+ req.send_request(options)
643
+ end
644
+
645
+ # Updates an existing Recycle Bin retention rule. For more information,
646
+ # see [ Update Recycle Bin retention rules][1] in the *Amazon EC2 User
647
+ # Guide*.
648
+ #
649
+ #
650
+ #
651
+ # [1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recycle-bin-working-with-rules.html#recycle-bin-update-rule
652
+ #
653
+ # @option params [required, String] :identifier
654
+ # The unique ID of the retention rule to update.
655
+ #
656
+ # @option params [Types::RetentionPeriod] :retention_period
657
+ # Information about the retention period for which the retention rule is
658
+ # to retain resources.
659
+ #
660
+ # @option params [String] :description
661
+ # The retention rule description.
662
+ #
663
+ # @option params [String] :resource_type
664
+ # The resource type to be retained by the retention rule. Currently,
665
+ # only Amazon EBS snapshots are supported.
666
+ #
667
+ # @option params [Array<Types::ResourceTag>] :resource_tags
668
+ # Information about the resource tags to use to identify resources that
669
+ # are to be retained by the retention rule. The retention rule retains
670
+ # only deleted snapshots that have one or more of the specified tag key
671
+ # and value pairs. If a snapshot is deleted, but it does not have any of
672
+ # the specified tag key and value pairs, it is immediately deleted
673
+ # without being retained by the retention rule.
674
+ #
675
+ # You can add the same tag key and value pair to a maximum or five
676
+ # retention rules.
677
+ #
678
+ # @return [Types::UpdateRuleResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
679
+ #
680
+ # * {Types::UpdateRuleResponse#identifier #identifier} => String
681
+ # * {Types::UpdateRuleResponse#retention_period #retention_period} => Types::RetentionPeriod
682
+ # * {Types::UpdateRuleResponse#description #description} => String
683
+ # * {Types::UpdateRuleResponse#resource_type #resource_type} => String
684
+ # * {Types::UpdateRuleResponse#resource_tags #resource_tags} => Array&lt;Types::ResourceTag&gt;
685
+ # * {Types::UpdateRuleResponse#status #status} => String
686
+ #
687
+ # @example Request syntax with placeholder values
688
+ #
689
+ # resp = client.update_rule({
690
+ # identifier: "RuleIdentifier", # required
691
+ # retention_period: {
692
+ # retention_period_value: 1, # required
693
+ # retention_period_unit: "DAYS", # required, accepts DAYS
694
+ # },
695
+ # description: "Description",
696
+ # resource_type: "EBS_SNAPSHOT", # accepts EBS_SNAPSHOT
697
+ # resource_tags: [
698
+ # {
699
+ # resource_tag_key: "ResourceTagKey", # required
700
+ # resource_tag_value: "ResourceTagValue",
701
+ # },
702
+ # ],
703
+ # })
704
+ #
705
+ # @example Response structure
706
+ #
707
+ # resp.identifier #=> String
708
+ # resp.retention_period.retention_period_value #=> Integer
709
+ # resp.retention_period.retention_period_unit #=> String, one of "DAYS"
710
+ # resp.description #=> String
711
+ # resp.resource_type #=> String, one of "EBS_SNAPSHOT"
712
+ # resp.resource_tags #=> Array
713
+ # resp.resource_tags[0].resource_tag_key #=> String
714
+ # resp.resource_tags[0].resource_tag_value #=> String
715
+ # resp.status #=> String, one of "pending", "available"
716
+ #
717
+ # @see http://docs.aws.amazon.com/goto/WebAPI/rbin-2021-06-15/UpdateRule AWS API Documentation
718
+ #
719
+ # @overload update_rule(params = {})
720
+ # @param [Hash] params ({})
721
+ def update_rule(params = {}, options = {})
722
+ req = build_request(:update_rule, params)
723
+ req.send_request(options)
724
+ end
725
+
726
+ # @!endgroup
727
+
728
+ # @param params ({})
729
+ # @api private
730
+ def build_request(operation_name, params = {})
731
+ handlers = @handlers.for(operation_name)
732
+ context = Seahorse::Client::RequestContext.new(
733
+ operation_name: operation_name,
734
+ operation: config.api.operation(operation_name),
735
+ client: self,
736
+ params: params,
737
+ config: config)
738
+ context[:gem_name] = 'aws-sdk-recyclebin'
739
+ context[:gem_version] = '1.0.0'
740
+ Seahorse::Client::Request.new(handlers, context)
741
+ end
742
+
743
+ # @api private
744
+ # @deprecated
745
+ def waiter_names
746
+ []
747
+ end
748
+
749
+ class << self
750
+
751
+ # @api private
752
+ attr_reader :identifier
753
+
754
+ # @api private
755
+ def errors_module
756
+ Errors
757
+ end
758
+
759
+ end
760
+ end
761
+ end