aws-sdk-accountaccess 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,1057 @@
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'
11
+ require 'aws-sdk-core/plugins/credentials_configuration'
12
+ require 'aws-sdk-core/plugins/logging'
13
+ require 'aws-sdk-core/plugins/param_converter'
14
+ require 'aws-sdk-core/plugins/param_validator'
15
+ require 'aws-sdk-core/plugins/user_agent'
16
+ require 'aws-sdk-core/plugins/helpful_socket_errors'
17
+ require 'aws-sdk-core/plugins/retry_errors'
18
+ require 'aws-sdk-core/plugins/global_configuration'
19
+ require 'aws-sdk-core/plugins/regional_endpoint'
20
+ require 'aws-sdk-core/plugins/endpoint_discovery'
21
+ require 'aws-sdk-core/plugins/endpoint_pattern'
22
+ require 'aws-sdk-core/plugins/response_paging'
23
+ require 'aws-sdk-core/plugins/stub_responses'
24
+ require 'aws-sdk-core/plugins/idempotency_token'
25
+ require 'aws-sdk-core/plugins/invocation_id'
26
+ require 'aws-sdk-core/plugins/jsonvalue_converter'
27
+ require 'aws-sdk-core/plugins/client_metrics_plugin'
28
+ require 'aws-sdk-core/plugins/client_metrics_send_plugin'
29
+ require 'aws-sdk-core/plugins/transfer_encoding'
30
+ require 'aws-sdk-core/plugins/http_checksum'
31
+ require 'aws-sdk-core/plugins/checksum_algorithm'
32
+ require 'aws-sdk-core/plugins/request_compression'
33
+ require 'aws-sdk-core/plugins/defaults_mode'
34
+ require 'aws-sdk-core/plugins/recursion_detection'
35
+ require 'aws-sdk-core/plugins/telemetry'
36
+ require 'aws-sdk-core/plugins/sign'
37
+ require 'aws-sdk-core/plugins/protocols/rest_json'
38
+
39
+ module Aws::AccountAccess
40
+ # An API client for AccountAccess. To construct a client, you need to configure a `:region` and `:credentials`.
41
+ #
42
+ # client = Aws::AccountAccess::Client.new(
43
+ # region: region_name,
44
+ # credentials: credentials,
45
+ # # ...
46
+ # )
47
+ #
48
+ # For details on configuring region and credentials see
49
+ # the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
50
+ #
51
+ # See {#initialize} for a full list of supported configuration options.
52
+ class Client < Seahorse::Client::Base
53
+
54
+ include Aws::ClientStubs
55
+
56
+ @identifier = :accountaccess
57
+
58
+ set_api(ClientApi::API)
59
+
60
+ add_plugin(Seahorse::Client::Plugins::ContentLength)
61
+ add_plugin(Aws::Plugins::CredentialsConfiguration)
62
+ add_plugin(Aws::Plugins::Logging)
63
+ add_plugin(Aws::Plugins::ParamConverter)
64
+ add_plugin(Aws::Plugins::ParamValidator)
65
+ add_plugin(Aws::Plugins::UserAgent)
66
+ add_plugin(Aws::Plugins::HelpfulSocketErrors)
67
+ add_plugin(Aws::Plugins::RetryErrors)
68
+ add_plugin(Aws::Plugins::GlobalConfiguration)
69
+ add_plugin(Aws::Plugins::RegionalEndpoint)
70
+ add_plugin(Aws::Plugins::EndpointDiscovery)
71
+ add_plugin(Aws::Plugins::EndpointPattern)
72
+ add_plugin(Aws::Plugins::ResponsePaging)
73
+ add_plugin(Aws::Plugins::StubResponses)
74
+ add_plugin(Aws::Plugins::IdempotencyToken)
75
+ add_plugin(Aws::Plugins::InvocationId)
76
+ add_plugin(Aws::Plugins::JsonvalueConverter)
77
+ add_plugin(Aws::Plugins::ClientMetricsPlugin)
78
+ add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
79
+ add_plugin(Aws::Plugins::TransferEncoding)
80
+ add_plugin(Aws::Plugins::HttpChecksum)
81
+ add_plugin(Aws::Plugins::ChecksumAlgorithm)
82
+ add_plugin(Aws::Plugins::RequestCompression)
83
+ add_plugin(Aws::Plugins::DefaultsMode)
84
+ add_plugin(Aws::Plugins::RecursionDetection)
85
+ add_plugin(Aws::Plugins::Telemetry)
86
+ add_plugin(Aws::Plugins::Sign)
87
+ add_plugin(Aws::Plugins::Protocols::RestJson)
88
+ add_plugin(Aws::AccountAccess::Plugins::Endpoints)
89
+
90
+ # @overload initialize(options)
91
+ # @param [Hash] options
92
+ #
93
+ # @option options [Array<Seahorse::Client::Plugin>] :plugins ([]])
94
+ # A list of plugins to apply to the client. Each plugin is either a
95
+ # class name or an instance of a plugin class.
96
+ #
97
+ # @option options [required, Aws::CredentialProvider] :credentials
98
+ # Your AWS credentials used for authentication. This can be any class that includes and implements
99
+ # `Aws::CredentialProvider`, or instance of any one of the following classes:
100
+ #
101
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
102
+ # credentials.
103
+ #
104
+ # * `Aws::SharedCredentials` - Used for loading static credentials from a
105
+ # shared file, such as `~/.aws/config`.
106
+ #
107
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
108
+ #
109
+ # * `Aws::AssumeRoleWebIdentityCredentials` - Used when you need to
110
+ # assume a role after providing credentials via the web.
111
+ #
112
+ # * `Aws::SSOCredentials` - Used for loading credentials from AWS SSO using an
113
+ # access token generated from `aws login`.
114
+ #
115
+ # * `Aws::ProcessCredentials` - Used for loading credentials from a
116
+ # process that outputs to stdout.
117
+ #
118
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
119
+ # from an EC2 IMDS on an EC2 instance.
120
+ #
121
+ # * `Aws::ECSCredentials` - Used for loading credentials from
122
+ # instances running in ECS.
123
+ #
124
+ # * `Aws::CognitoIdentityCredentials` - Used for loading credentials
125
+ # from the Cognito Identity service.
126
+ #
127
+ # When `:credentials` are not configured directly, the following locations will be searched for credentials:
128
+ #
129
+ # * `Aws.config[:credentials]`
130
+ #
131
+ # * The `:access_key_id`, `:secret_access_key`, `:session_token`, and
132
+ # `:account_id` options.
133
+ #
134
+ # * `ENV['AWS_ACCESS_KEY_ID']`, `ENV['AWS_SECRET_ACCESS_KEY']`,
135
+ # `ENV['AWS_SESSION_TOKEN']`, and `ENV['AWS_ACCOUNT_ID']`.
136
+ #
137
+ # * `~/.aws/credentials`
138
+ #
139
+ # * `~/.aws/config`
140
+ #
141
+ # * EC2/ECS IMDS instance profile - When used by default, the timeouts are very aggressive.
142
+ # Construct and pass an instance of `Aws::InstanceProfileCredentials` or `Aws::ECSCredentials` to
143
+ # enable retries and extended timeouts. Instance profile credential fetching can be disabled by
144
+ # setting `ENV['AWS_EC2_METADATA_DISABLED']` to `true`.
145
+ #
146
+ # @option options [required, String] :region
147
+ # The AWS region to connect to. The configured `:region` is
148
+ # used to determine the service `:endpoint`. When not passed,
149
+ # a default `:region` is searched for in the following locations:
150
+ #
151
+ # * `Aws.config[:region]`
152
+ # * `ENV['AWS_REGION']`
153
+ # * `ENV['AMAZON_REGION']`
154
+ # * `ENV['AWS_DEFAULT_REGION']`
155
+ # * `~/.aws/credentials`
156
+ # * `~/.aws/config`
157
+ #
158
+ # @option options [String] :access_key_id
159
+ #
160
+ # @option options [String] :account_id
161
+ #
162
+ # @option options [Boolean] :active_endpoint_cache (false)
163
+ # When set to `true`, a thread polling for endpoints will be running in
164
+ # the background every 60 secs (default). Defaults to `false`.
165
+ #
166
+ # @option options [Boolean] :adaptive_retry_wait_to_fill (true)
167
+ # Used only in `adaptive` retry mode. When true, the request will sleep
168
+ # until there is sufficent client side capacity to retry the request.
169
+ # When false, the request will raise a `RetryCapacityNotAvailableError` and will
170
+ # not retry instead of sleeping.
171
+ #
172
+ # @option options [Array<String>] :auth_scheme_preference
173
+ # A list of preferred authentication schemes to use when making a request. Supported values are:
174
+ # `sigv4`, `sigv4a`, `httpBearerAuth`, and `noAuth`. When set using `ENV['AWS_AUTH_SCHEME_PREFERENCE']` or in
175
+ # shared config as `auth_scheme_preference`, the value should be a comma-separated list.
176
+ #
177
+ # @option options [Boolean] :client_side_monitoring (false)
178
+ # When `true`, client-side metrics will be collected for all API requests from
179
+ # this client.
180
+ #
181
+ # @option options [String] :client_side_monitoring_client_id ("")
182
+ # Allows you to provide an identifier for this client which will be attached to
183
+ # all generated client side metrics. Defaults to an empty string.
184
+ #
185
+ # @option options [String] :client_side_monitoring_host ("127.0.0.1")
186
+ # Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client
187
+ # side monitoring agent is running on, where client metrics will be published via UDP.
188
+ #
189
+ # @option options [Integer] :client_side_monitoring_port (31000)
190
+ # Required for publishing client metrics. The port that the client side monitoring
191
+ # agent is running on, where client metrics will be published via UDP.
192
+ #
193
+ # @option options [Aws::ClientSideMonitoring::Publisher] :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher)
194
+ # Allows you to provide a custom client-side monitoring publisher class. By default,
195
+ # will use the Client Side Monitoring Agent Publisher.
196
+ #
197
+ # @option options [Boolean] :convert_params (true)
198
+ # When `true`, an attempt is made to coerce request parameters into
199
+ # the required types.
200
+ #
201
+ # @option options [Boolean] :correct_clock_skew (true)
202
+ # Used only in `standard` and `adaptive` retry modes. Specifies whether to apply
203
+ # a clock skew correction and retry requests with skewed client clocks.
204
+ #
205
+ # @option options [String] :defaults_mode ("legacy")
206
+ # See {Aws::DefaultsModeConfiguration} for a list of the
207
+ # accepted modes and the configuration defaults that are included.
208
+ #
209
+ # @option options [Boolean] :disable_host_prefix_injection (false)
210
+ # When `true`, the SDK will not prepend the modeled host prefix to the endpoint.
211
+ #
212
+ # @option options [Boolean] :disable_request_compression (false)
213
+ # When set to 'true' the request body will not be compressed
214
+ # for supported operations.
215
+ #
216
+ # @option options [String, URI::HTTPS, URI::HTTP] :endpoint
217
+ # Normally you should not configure the `:endpoint` option
218
+ # directly. This is normally constructed from the `:region`
219
+ # option. Configuring `:endpoint` is normally reserved for
220
+ # connecting to test or custom endpoints. The endpoint should
221
+ # be a URI formatted like:
222
+ #
223
+ # 'http://example.com'
224
+ # 'https://example.com'
225
+ # 'http://example.com:123'
226
+ #
227
+ # @option options [Integer] :endpoint_cache_max_entries (1000)
228
+ # Used for the maximum size limit of the LRU cache storing endpoints data
229
+ # for endpoint discovery enabled operations. Defaults to 1000.
230
+ #
231
+ # @option options [Integer] :endpoint_cache_max_threads (10)
232
+ # Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.
233
+ #
234
+ # @option options [Integer] :endpoint_cache_poll_interval (60)
235
+ # When :endpoint_discovery and :active_endpoint_cache is enabled,
236
+ # Use this option to config the time interval in seconds for making
237
+ # requests fetching endpoints information. Defaults to 60 sec.
238
+ #
239
+ # @option options [Boolean] :endpoint_discovery (false)
240
+ # When set to `true`, endpoint discovery will be enabled for operations when available.
241
+ #
242
+ # @option options [Boolean] :ignore_configured_endpoint_urls
243
+ # Setting to true disables use of endpoint URLs provided via environment
244
+ # variables and the shared configuration file.
245
+ #
246
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
247
+ # The log formatter.
248
+ #
249
+ # @option options [Symbol] :log_level (:info)
250
+ # The log level to send messages to the `:logger` at.
251
+ #
252
+ # @option options [Logger] :logger
253
+ # The Logger instance to send log messages to. If this option
254
+ # is not set, logging will be disabled.
255
+ #
256
+ # @option options [Integer] :max_attempts (3)
257
+ # An integer representing the maximum number attempts that will be made for
258
+ # a single request, including the initial attempt. For example,
259
+ # setting this value to 5 will result in a request being retried up to
260
+ # 4 times. Used in `standard` and `adaptive` retry modes.
261
+ #
262
+ # @option options [String] :profile ("default")
263
+ # Used when loading credentials from the shared credentials file at `HOME/.aws/credentials`.
264
+ # When not specified, 'default' is used.
265
+ #
266
+ # @option options [String] :request_checksum_calculation ("when_supported")
267
+ # Determines when a checksum will be calculated for request payloads. Values are:
268
+ #
269
+ # * `when_supported` - (default) When set, a checksum will be
270
+ # calculated for all request payloads of operations modeled with the
271
+ # `httpChecksum` trait where `requestChecksumRequired` is `true` and/or a
272
+ # `requestAlgorithmMember` is modeled.
273
+ # * `when_required` - When set, a checksum will only be calculated for
274
+ # request payloads of operations modeled with the `httpChecksum` trait where
275
+ # `requestChecksumRequired` is `true` or where a `requestAlgorithmMember`
276
+ # is modeled and supplied.
277
+ #
278
+ # @option options [Integer] :request_min_compression_size_bytes (10240)
279
+ # The minimum size in bytes that triggers compression for request
280
+ # bodies. The value must be non-negative integer value between 0
281
+ # and 10485780 bytes inclusive.
282
+ #
283
+ # @option options [String] :response_checksum_validation ("when_supported")
284
+ # Determines when checksum validation will be performed on response payloads. Values are:
285
+ #
286
+ # * `when_supported` - (default) When set, checksum validation is performed on all
287
+ # response payloads of operations modeled with the `httpChecksum` trait where
288
+ # `responseAlgorithms` is modeled, except when no modeled checksum algorithms
289
+ # are supported.
290
+ # * `when_required` - When set, checksum validation is not performed on
291
+ # response payloads of operations unless the checksum algorithm is supported and
292
+ # the `requestValidationModeMember` member is set to `ENABLED`.
293
+ #
294
+ # @option options [Proc] :retry_backoff
295
+ # A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay.
296
+ # This option is only used in the `legacy` retry mode.
297
+ #
298
+ # @option options [Float] :retry_base_delay (0.3)
299
+ # The base delay in seconds used by the default backoff function. This option
300
+ # is only used in the `legacy` retry mode.
301
+ #
302
+ # @option options [Symbol] :retry_jitter (:none)
303
+ # A delay randomiser function used by the default backoff function.
304
+ # Some predefined functions can be referenced by name - :none, :equal, :full,
305
+ # otherwise a Proc that takes and returns a number. This option is only used
306
+ # in the `legacy` retry mode.
307
+ #
308
+ # @see https://www.awsarchitectureblog.com/2015/03/backoff.html
309
+ #
310
+ # @option options [Integer] :retry_limit (3)
311
+ # The maximum number of times to retry failed requests. Only
312
+ # ~ 500 level server errors and certain ~ 400 level client errors
313
+ # are retried. Generally, these are throttling errors, data
314
+ # checksum errors, networking errors, timeout errors, auth errors,
315
+ # endpoint discovery, and errors from expired credentials.
316
+ # This option is only used in the `legacy` retry mode.
317
+ #
318
+ # @option options [Integer] :retry_max_delay (0)
319
+ # The maximum number of seconds to delay between retries (0 for no limit)
320
+ # used by the default backoff function. This option is only used in the
321
+ # `legacy` retry mode.
322
+ #
323
+ # @option options [String] :retry_mode ("legacy")
324
+ # Specifies which retry algorithm to use. Values are:
325
+ #
326
+ # * `legacy` - The pre-existing retry behavior. This is the default
327
+ # value if no retry mode is provided.
328
+ #
329
+ # * `standard` - A standardized set of retry rules across the AWS SDKs.
330
+ # This includes support for retry quotas, which limit the number of
331
+ # unsuccessful retries a client can make.
332
+ #
333
+ # * `adaptive` - A retry mode that includes all the functionality of
334
+ # `standard` mode along with automatic client side throttling.
335
+ #
336
+ # @option options [String] :sdk_ua_app_id
337
+ # A unique and opaque application ID that is appended to the
338
+ # User-Agent header as app/sdk_ua_app_id. It should have a
339
+ # maximum length of 50. This variable is sourced from environment
340
+ # variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.
341
+ #
342
+ # @option options [String] :secret_access_key
343
+ #
344
+ # @option options [String] :session_token
345
+ #
346
+ # @option options [Array] :sigv4a_signing_region_set
347
+ # A list of regions that should be signed with SigV4a signing. When
348
+ # not passed, a default `:sigv4a_signing_region_set` is searched for
349
+ # in the following locations:
350
+ #
351
+ # * `Aws.config[:sigv4a_signing_region_set]`
352
+ # * `ENV['AWS_SIGV4A_SIGNING_REGION_SET']`
353
+ # * `~/.aws/config`
354
+ #
355
+ # @option options [Boolean] :stub_responses (false)
356
+ # Causes the client to return stubbed responses. By default
357
+ # fake responses are generated and returned. You can specify
358
+ # the response data to return or errors to raise by calling
359
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
360
+ #
361
+ # ** Please note ** When response stubbing is enabled, no HTTP
362
+ # requests are made, and retries are disabled.
363
+ #
364
+ # @option options [Aws::Telemetry::TelemetryProviderBase] :telemetry_provider (Aws::Telemetry::NoOpTelemetryProvider)
365
+ # Allows you to provide a telemetry provider, which is used to
366
+ # emit telemetry data. By default, uses `NoOpTelemetryProvider` which
367
+ # will not record or emit any telemetry data. The SDK supports the
368
+ # following telemetry providers:
369
+ #
370
+ # * OpenTelemetry (OTel) - To use the OTel provider, install and require the
371
+ # `opentelemetry-sdk` gem and then, pass in an instance of a
372
+ # `Aws::Telemetry::OTelProvider` for telemetry provider.
373
+ #
374
+ # @option options [Aws::TokenProvider] :token_provider
375
+ # Your Bearer token used for authentication. This can be any class that includes and implements
376
+ # `Aws::TokenProvider`, or instance of any one of the following classes:
377
+ #
378
+ # * `Aws::StaticTokenProvider` - Used for configuring static, non-refreshing
379
+ # tokens.
380
+ #
381
+ # * `Aws::SSOTokenProvider` - Used for loading tokens from AWS SSO using an
382
+ # access token generated from `aws login`.
383
+ #
384
+ # When `:token_provider` is not configured directly, the `Aws::TokenProviderChain`
385
+ # will be used to search for tokens configured for your profile in shared configuration files.
386
+ #
387
+ # @option options [Boolean] :use_dualstack_endpoint
388
+ # When set to `true`, dualstack enabled endpoints (with `.aws` TLD)
389
+ # will be used if available.
390
+ #
391
+ # @option options [Boolean] :use_fips_endpoint
392
+ # When set to `true`, fips compatible endpoints will be used if available.
393
+ # When a `fips` region is used, the region is normalized and this config
394
+ # is set to `true`.
395
+ #
396
+ # @option options [Boolean] :validate_params (true)
397
+ # When `true`, request parameters are validated before
398
+ # sending the request.
399
+ #
400
+ # @option options [Aws::AccountAccess::EndpointProvider] :endpoint_provider
401
+ # The endpoint provider used to resolve endpoints. Any object that responds to
402
+ # `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
403
+ # `Aws::AccountAccess::EndpointParameters`.
404
+ #
405
+ # @option options [Float] :http_continue_timeout (1)
406
+ # The number of seconds to wait for a 100-continue response before sending the
407
+ # request body. This option has no effect unless the request has "Expect"
408
+ # header set to "100-continue". Defaults to `nil` which disables this
409
+ # behaviour. This value can safely be set per request on the session.
410
+ #
411
+ # @option options [Float] :http_idle_timeout (5)
412
+ # The number of seconds a connection is allowed to sit idle before it
413
+ # is considered stale. Stale connections are closed and removed from the
414
+ # pool before making a request.
415
+ #
416
+ # @option options [Float] :http_open_timeout (15)
417
+ # The default number of seconds to wait for response data.
418
+ # This value can safely be set per-request on the session.
419
+ #
420
+ # @option options [URI::HTTP,String] :http_proxy
421
+ # A proxy to send requests through. Formatted like 'http://proxy.com:123'.
422
+ #
423
+ # @option options [Float] :http_read_timeout (60)
424
+ # The default number of seconds to wait for response data.
425
+ # This value can safely be set per-request on the session.
426
+ #
427
+ # @option options [Boolean] :http_wire_trace (false)
428
+ # When `true`, HTTP debug output will be sent to the `:logger`.
429
+ #
430
+ # @option options [Proc] :on_chunk_received
431
+ # When a Proc object is provided, it will be used as callback when each chunk
432
+ # of the response body is received. It provides three arguments: the chunk,
433
+ # the number of bytes received, and the total number of
434
+ # bytes in the response (or nil if the server did not send a `content-length`).
435
+ #
436
+ # @option options [Proc] :on_chunk_sent
437
+ # When a Proc object is provided, it will be used as callback when each chunk
438
+ # of the request body is sent. It provides three arguments: the chunk,
439
+ # the number of bytes read from the body, and the total number of
440
+ # bytes in the body.
441
+ #
442
+ # @option options [Boolean] :raise_response_errors (true)
443
+ # When `true`, response errors are raised.
444
+ #
445
+ # @option options [String] :ssl_ca_bundle
446
+ # Full path to the SSL certificate authority bundle file that should be used when
447
+ # verifying peer certificates. If you do not pass `:ssl_ca_bundle` or
448
+ # `:ssl_ca_directory` the the system default will be used if available.
449
+ #
450
+ # @option options [String] :ssl_ca_directory
451
+ # Full path of the directory that contains the unbundled SSL certificate
452
+ # authority files for verifying peer certificates. If you do
453
+ # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the system
454
+ # default will be used if available.
455
+ #
456
+ # @option options [String] :ssl_ca_store
457
+ # Sets the X509::Store to verify peer certificate.
458
+ #
459
+ # @option options [OpenSSL::X509::Certificate] :ssl_cert
460
+ # Sets a client certificate when creating http connections.
461
+ #
462
+ # @option options [OpenSSL::PKey] :ssl_key
463
+ # Sets a client key when creating http connections.
464
+ #
465
+ # @option options [Float] :ssl_timeout
466
+ # Sets the SSL timeout in seconds
467
+ #
468
+ # @option options [Boolean] :ssl_verify_peer (true)
469
+ # When `true`, SSL peer certificates are verified when establishing a connection.
470
+ #
471
+ def initialize(*args)
472
+ super
473
+ end
474
+
475
+ # @!group API Operations
476
+
477
+ # Creates an account access manager instance and its Amazon Web Services
478
+ # account access application in the associated IAM Identity Center
479
+ # instance. This operation is idempotent; calling it multiple times with
480
+ # the same parameters returns the existing application.
481
+ #
482
+ # @option params [required, Types::IdentitySource] :identity_source
483
+ # Specifies the identity source for the application. The identity source
484
+ # defines the IAM Identity Center instance that provides principals for
485
+ # entitlements.
486
+ #
487
+ # @option params [Hash<String,String>] :tags
488
+ # Specifies the tags to assign to the application.
489
+ #
490
+ # @return [Types::CreateApplicationResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
491
+ #
492
+ # * {Types::CreateApplicationResponse#application_arn #application_arn} => String
493
+ #
494
+ # @example Request syntax with placeholder values
495
+ #
496
+ # resp = client.create_application({
497
+ # identity_source: { # required
498
+ # identity_center: {
499
+ # instance_arn: "IdentityCenterInstanceArn", # required
500
+ # },
501
+ # },
502
+ # tags: {
503
+ # "String" => "String",
504
+ # },
505
+ # })
506
+ #
507
+ # @example Response structure
508
+ #
509
+ # resp.application_arn #=> String
510
+ #
511
+ # @see http://docs.aws.amazon.com/goto/WebAPI/account-access-2018-05-10/CreateApplication AWS API Documentation
512
+ #
513
+ # @overload create_application(params = {})
514
+ # @param [Hash] params ({})
515
+ def create_application(params = {}, options = {})
516
+ req = build_request(:create_application, params)
517
+ req.send_request(options)
518
+ end
519
+
520
+ # Creates an entitlement (assignment) in account access manager. An
521
+ # entitlement (assignment) grants a principal (IAM Identity Center user
522
+ # or group) permission to assume a specified IAM role in an Amazon Web
523
+ # Services account. This operation is idempotent.
524
+ #
525
+ # @option params [required, String] :application_arn
526
+ # Specifies the ARN of the application to create the entitlement for.
527
+ #
528
+ # @option params [required, Types::Entitlement] :entitlement
529
+ # Specifies the entitlement configuration, including the principal and
530
+ # the IAM role to grant access to.
531
+ #
532
+ # @return [Types::CreateEntitlementResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
533
+ #
534
+ # * {Types::CreateEntitlementResponse#entitlement_id #entitlement_id} => String
535
+ #
536
+ # @example Request syntax with placeholder values
537
+ #
538
+ # resp = client.create_entitlement({
539
+ # application_arn: "ApplicationArn", # required
540
+ # entitlement: { # required
541
+ # principal_role: {
542
+ # principal: { # required
543
+ # identity_center: {
544
+ # user_id: "UserId",
545
+ # group_id: "GroupId",
546
+ # },
547
+ # },
548
+ # role_arn: "RoleArn", # required
549
+ # },
550
+ # },
551
+ # })
552
+ #
553
+ # @example Response structure
554
+ #
555
+ # resp.entitlement_id #=> String
556
+ #
557
+ # @see http://docs.aws.amazon.com/goto/WebAPI/account-access-2018-05-10/CreateEntitlement AWS API Documentation
558
+ #
559
+ # @overload create_entitlement(params = {})
560
+ # @param [Hash] params ({})
561
+ def create_entitlement(params = {}, options = {})
562
+ req = build_request(:create_entitlement, params)
563
+ req.send_request(options)
564
+ end
565
+
566
+ # Deletes an account access manager application. This operation is
567
+ # idempotent; deleting an application that has already been deleted does
568
+ # not return an error.
569
+ #
570
+ # @option params [required, String] :application_arn
571
+ # Specifies the ARN of the application to delete.
572
+ #
573
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
574
+ #
575
+ # @example Request syntax with placeholder values
576
+ #
577
+ # resp = client.delete_application({
578
+ # application_arn: "ApplicationArn", # required
579
+ # })
580
+ #
581
+ # @see http://docs.aws.amazon.com/goto/WebAPI/account-access-2018-05-10/DeleteApplication AWS API Documentation
582
+ #
583
+ # @overload delete_application(params = {})
584
+ # @param [Hash] params ({})
585
+ def delete_application(params = {}, options = {})
586
+ req = build_request(:delete_application, params)
587
+ req.send_request(options)
588
+ end
589
+
590
+ # Deletes an entitlement from an account access manager application.
591
+ # This operation is idempotent; deleting an entitlement that has already
592
+ # been deleted does not return an error.
593
+ #
594
+ # @option params [required, String] :application_arn
595
+ # Specifies the ARN of the application that the entitlement belongs to.
596
+ #
597
+ # @option params [required, String] :entitlement_id
598
+ # Specifies the unique identifier of the entitlement to delete.
599
+ #
600
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
601
+ #
602
+ # @example Request syntax with placeholder values
603
+ #
604
+ # resp = client.delete_entitlement({
605
+ # application_arn: "ApplicationArn", # required
606
+ # entitlement_id: "String", # required
607
+ # })
608
+ #
609
+ # @see http://docs.aws.amazon.com/goto/WebAPI/account-access-2018-05-10/DeleteEntitlement AWS API Documentation
610
+ #
611
+ # @overload delete_entitlement(params = {})
612
+ # @param [Hash] params ({})
613
+ def delete_entitlement(params = {}, options = {})
614
+ req = build_request(:delete_entitlement, params)
615
+ req.send_request(options)
616
+ end
617
+
618
+ # Retrieves details about an account access manager application,
619
+ # including its status, identity source, and tags.
620
+ #
621
+ # @option params [required, String] :application_arn
622
+ # Specifies the ARN of the application to retrieve.
623
+ #
624
+ # @return [Types::GetApplicationResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
625
+ #
626
+ # * {Types::GetApplicationResponse#identity_source #identity_source} => Types::IdentitySourceDetails
627
+ # * {Types::GetApplicationResponse#status #status} => String
628
+ # * {Types::GetApplicationResponse#tenant_id #tenant_id} => String
629
+ # * {Types::GetApplicationResponse#created_at #created_at} => Time
630
+ # * {Types::GetApplicationResponse#updated_at #updated_at} => Time
631
+ # * {Types::GetApplicationResponse#tags #tags} => Hash&lt;String,String&gt;
632
+ # * {Types::GetApplicationResponse#error #error} => Types::ErrorDetails
633
+ #
634
+ # @example Request syntax with placeholder values
635
+ #
636
+ # resp = client.get_application({
637
+ # application_arn: "ApplicationArn", # required
638
+ # })
639
+ #
640
+ # @example Response structure
641
+ #
642
+ # resp.identity_source.identity_center.instance_arn #=> String
643
+ # resp.identity_source.identity_center.application_arn #=> String
644
+ # resp.status #=> String, one of "CREATE_IN_PROGRESS", "ACTIVE", "DELETE_IN_PROGRESS", "CREATE_FAILED", "DELETE_FAILED"
645
+ # resp.tenant_id #=> String
646
+ # resp.created_at #=> Time
647
+ # resp.updated_at #=> Time
648
+ # resp.tags #=> Hash
649
+ # resp.tags["String"] #=> String
650
+ # resp.error.code #=> String, one of "AUTHORIZATION_ERROR", "RESOURCE_NOT_FOUND_ERROR", "SERVICE_QUOTA_EXCEEDED_ERROR", "INTERNAL_SERVICE_ERROR"
651
+ # resp.error.message #=> String
652
+ #
653
+ #
654
+ # The following waiters are defined for this operation (see {Client#wait_until} for detailed usage):
655
+ #
656
+ # * application_active
657
+ #
658
+ # @see http://docs.aws.amazon.com/goto/WebAPI/account-access-2018-05-10/GetApplication AWS API Documentation
659
+ #
660
+ # @overload get_application(params = {})
661
+ # @param [Hash] params ({})
662
+ def get_application(params = {}, options = {})
663
+ req = build_request(:get_application, params)
664
+ req.send_request(options)
665
+ end
666
+
667
+ # Retrieves details about a specific entitlement for an account access
668
+ # manager application, including the principal, IAM role, and target
669
+ # account.
670
+ #
671
+ # @option params [required, String] :application_arn
672
+ # Specifies the ARN of the application that the entitlement belongs to.
673
+ #
674
+ # @option params [required, String] :entitlement_id
675
+ # Specifies the unique identifier of the entitlement to retrieve.
676
+ #
677
+ # @return [Types::GetEntitlementResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
678
+ #
679
+ # * {Types::GetEntitlementResponse#application_arn #application_arn} => String
680
+ # * {Types::GetEntitlementResponse#entitlement_id #entitlement_id} => String
681
+ # * {Types::GetEntitlementResponse#entitlement #entitlement} => Types::EntitlementDetails
682
+ # * {Types::GetEntitlementResponse#created_at #created_at} => Time
683
+ #
684
+ # @example Request syntax with placeholder values
685
+ #
686
+ # resp = client.get_entitlement({
687
+ # application_arn: "ApplicationArn", # required
688
+ # entitlement_id: "String", # required
689
+ # })
690
+ #
691
+ # @example Response structure
692
+ #
693
+ # resp.application_arn #=> String
694
+ # resp.entitlement_id #=> String
695
+ # resp.entitlement.principal_role.principal.identity_center.user_id #=> String
696
+ # resp.entitlement.principal_role.principal.identity_center.group_id #=> String
697
+ # resp.entitlement.principal_role.role_arn #=> String
698
+ # resp.entitlement.principal_role.account #=> String
699
+ # resp.entitlement.principal_role.account_name #=> String
700
+ # resp.created_at #=> Time
701
+ #
702
+ # @see http://docs.aws.amazon.com/goto/WebAPI/account-access-2018-05-10/GetEntitlement AWS API Documentation
703
+ #
704
+ # @overload get_entitlement(params = {})
705
+ # @param [Hash] params ({})
706
+ def get_entitlement(params = {}, options = {})
707
+ req = build_request(:get_entitlement, params)
708
+ req.send_request(options)
709
+ end
710
+
711
+ # Lists the account access manager applications in your account. Use
712
+ # pagination to ensure that the operation returns quickly and
713
+ # successfully.
714
+ #
715
+ # @option params [Integer] :max_results
716
+ # Specifies the maximum number of results to return in a single call.
717
+ #
718
+ # @option params [String] :next_token
719
+ # Specifies the pagination token from a previous call to retrieve the
720
+ # next set of results.
721
+ #
722
+ # @return [Types::ListApplicationsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
723
+ #
724
+ # * {Types::ListApplicationsResponse#applications #applications} => Array&lt;Types::ApplicationSummary&gt;
725
+ # * {Types::ListApplicationsResponse#next_token #next_token} => String
726
+ #
727
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
728
+ #
729
+ # @example Request syntax with placeholder values
730
+ #
731
+ # resp = client.list_applications({
732
+ # max_results: 1,
733
+ # next_token: "String",
734
+ # })
735
+ #
736
+ # @example Response structure
737
+ #
738
+ # resp.applications #=> Array
739
+ # resp.applications[0].application_arn #=> String
740
+ # resp.applications[0].tenant_id #=> String
741
+ # resp.applications[0].created_at #=> Time
742
+ # resp.applications[0].updated_at #=> Time
743
+ # resp.next_token #=> String
744
+ #
745
+ # @see http://docs.aws.amazon.com/goto/WebAPI/account-access-2018-05-10/ListApplications AWS API Documentation
746
+ #
747
+ # @overload list_applications(params = {})
748
+ # @param [Hash] params ({})
749
+ def list_applications(params = {}, options = {})
750
+ req = build_request(:list_applications, params)
751
+ req.send_request(options)
752
+ end
753
+
754
+ # Lists the entitlements for a specified account access manager
755
+ # application. You can filter results by principal, IAM role, or
756
+ # account. Use pagination to ensure that the operation returns quickly
757
+ # and successfully.
758
+ #
759
+ # @option params [required, String] :application_arn
760
+ # Specifies the ARN of the application to list entitlements for.
761
+ #
762
+ # @option params [required, Types::EntitlementFilter] :filter
763
+ # Specifies filter criteria to narrow the entitlements returned. You can
764
+ # filter by principal, IAM role, or account.
765
+ #
766
+ # @option params [String] :next_token
767
+ # Specifies the pagination token from a previous call to retrieve the
768
+ # next set of results.
769
+ #
770
+ # @option params [Integer] :max_results
771
+ # Specifies the maximum number of results to return in a single call.
772
+ #
773
+ # @return [Types::ListEntitlementsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
774
+ #
775
+ # * {Types::ListEntitlementsResponse#entitlements #entitlements} => Array&lt;Types::EntitlementsListMember&gt;
776
+ # * {Types::ListEntitlementsResponse#next_token #next_token} => String
777
+ #
778
+ # The returned {Seahorse::Client::Response response} is a pageable response and is Enumerable. For details on usage see {Aws::PageableResponse PageableResponse}.
779
+ #
780
+ # @example Request syntax with placeholder values
781
+ #
782
+ # resp = client.list_entitlements({
783
+ # application_arn: "ApplicationArn", # required
784
+ # filter: { # required
785
+ # principal_role: {
786
+ # principal: {
787
+ # identity_center: {
788
+ # user_id: "UserId",
789
+ # group_id: "GroupId",
790
+ # },
791
+ # },
792
+ # role_arn: "RoleArn",
793
+ # account: "Account",
794
+ # },
795
+ # },
796
+ # next_token: "String",
797
+ # max_results: 1,
798
+ # })
799
+ #
800
+ # @example Response structure
801
+ #
802
+ # resp.entitlements #=> Array
803
+ # resp.entitlements[0].entitlement_id #=> String
804
+ # resp.entitlements[0].entitlement.principal_role.principal.identity_center.user_id #=> String
805
+ # resp.entitlements[0].entitlement.principal_role.principal.identity_center.group_id #=> String
806
+ # resp.entitlements[0].entitlement.principal_role.role_arn #=> String
807
+ # resp.entitlements[0].entitlement.principal_role.account #=> String
808
+ # resp.entitlements[0].entitlement.principal_role.account_name #=> String
809
+ # resp.entitlements[0].created_at #=> Time
810
+ # resp.next_token #=> String
811
+ #
812
+ # @see http://docs.aws.amazon.com/goto/WebAPI/account-access-2018-05-10/ListEntitlements AWS API Documentation
813
+ #
814
+ # @overload list_entitlements(params = {})
815
+ # @param [Hash] params ({})
816
+ def list_entitlements(params = {}, options = {})
817
+ req = build_request(:list_entitlements, params)
818
+ req.send_request(options)
819
+ end
820
+
821
+ # Lists the tags associated with an account access manager resource.
822
+ #
823
+ # @option params [required, String] :resource_arn
824
+ # Specifies the ARN of the resource to list tags for.
825
+ #
826
+ # @return [Types::ListTagsForResourceResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
827
+ #
828
+ # * {Types::ListTagsForResourceResponse#tags #tags} => Hash&lt;String,String&gt;
829
+ #
830
+ # @example Request syntax with placeholder values
831
+ #
832
+ # resp = client.list_tags_for_resource({
833
+ # resource_arn: "ApplicationArn", # required
834
+ # })
835
+ #
836
+ # @example Response structure
837
+ #
838
+ # resp.tags #=> Hash
839
+ # resp.tags["String"] #=> String
840
+ #
841
+ # @see http://docs.aws.amazon.com/goto/WebAPI/account-access-2018-05-10/ListTagsForResource AWS API Documentation
842
+ #
843
+ # @overload list_tags_for_resource(params = {})
844
+ # @param [Hash] params ({})
845
+ def list_tags_for_resource(params = {}, options = {})
846
+ req = build_request(:list_tags_for_resource, params)
847
+ req.send_request(options)
848
+ end
849
+
850
+ # Adds tags to an account access manager resource.
851
+ #
852
+ # @option params [required, String] :resource_arn
853
+ # Specifies the ARN of the resource to add tags to.
854
+ #
855
+ # @option params [required, Hash<String,String>] :tags
856
+ # Specifies the tags to add to the resource.
857
+ #
858
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
859
+ #
860
+ # @example Request syntax with placeholder values
861
+ #
862
+ # resp = client.tag_resource({
863
+ # resource_arn: "ApplicationArn", # required
864
+ # tags: { # required
865
+ # "String" => "String",
866
+ # },
867
+ # })
868
+ #
869
+ # @see http://docs.aws.amazon.com/goto/WebAPI/account-access-2018-05-10/TagResource AWS API Documentation
870
+ #
871
+ # @overload tag_resource(params = {})
872
+ # @param [Hash] params ({})
873
+ def tag_resource(params = {}, options = {})
874
+ req = build_request(:tag_resource, params)
875
+ req.send_request(options)
876
+ end
877
+
878
+ # Removes tags from an account access manager resource.
879
+ #
880
+ # @option params [required, String] :resource_arn
881
+ # Specifies the ARN of the resource to remove tags from.
882
+ #
883
+ # @option params [required, Array<String>] :tag_keys
884
+ # Specifies the tag keys to remove from the resource.
885
+ #
886
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
887
+ #
888
+ # @example Request syntax with placeholder values
889
+ #
890
+ # resp = client.untag_resource({
891
+ # resource_arn: "ApplicationArn", # required
892
+ # tag_keys: ["String"], # required
893
+ # })
894
+ #
895
+ # @see http://docs.aws.amazon.com/goto/WebAPI/account-access-2018-05-10/UntagResource AWS API Documentation
896
+ #
897
+ # @overload untag_resource(params = {})
898
+ # @param [Hash] params ({})
899
+ def untag_resource(params = {}, options = {})
900
+ req = build_request(:untag_resource, params)
901
+ req.send_request(options)
902
+ end
903
+
904
+ # @!endgroup
905
+
906
+ # @param params ({})
907
+ # @api private
908
+ def build_request(operation_name, params = {})
909
+ handlers = @handlers.for(operation_name)
910
+ tracer = config.telemetry_provider.tracer_provider.tracer(
911
+ Aws::Telemetry.module_to_tracer_name('Aws::AccountAccess')
912
+ )
913
+ context = Seahorse::Client::RequestContext.new(
914
+ operation_name: operation_name,
915
+ operation: config.api.operation(operation_name),
916
+ client: self,
917
+ params: params,
918
+ config: config,
919
+ tracer: tracer
920
+ )
921
+ context[:gem_name] = 'aws-sdk-accountaccess'
922
+ context[:gem_version] = '1.0.0'
923
+ Seahorse::Client::Request.new(handlers, context)
924
+ end
925
+
926
+ # Polls an API operation until a resource enters a desired state.
927
+ #
928
+ # ## Basic Usage
929
+ #
930
+ # A waiter will call an API operation until:
931
+ #
932
+ # * It is successful
933
+ # * It enters a terminal state
934
+ # * It makes the maximum number of attempts
935
+ #
936
+ # In between attempts, the waiter will sleep.
937
+ #
938
+ # # polls in a loop, sleeping between attempts
939
+ # client.wait_until(waiter_name, params)
940
+ #
941
+ # ## Configuration
942
+ #
943
+ # You can configure the maximum number of polling attempts, and the
944
+ # delay (in seconds) between each polling attempt. You can pass
945
+ # configuration as the final arguments hash.
946
+ #
947
+ # # poll for ~25 seconds
948
+ # client.wait_until(waiter_name, params, {
949
+ # max_attempts: 5,
950
+ # delay: 5,
951
+ # })
952
+ #
953
+ # ## Callbacks
954
+ #
955
+ # You can be notified before each polling attempt and before each
956
+ # delay. If you throw `:success` or `:failure` from these callbacks,
957
+ # it will terminate the waiter.
958
+ #
959
+ # started_at = Time.now
960
+ # client.wait_until(waiter_name, params, {
961
+ #
962
+ # # disable max attempts
963
+ # max_attempts: nil,
964
+ #
965
+ # # poll for 1 hour, instead of a number of attempts
966
+ # before_wait: -> (attempts, response) do
967
+ # throw :failure if Time.now - started_at > 3600
968
+ # end
969
+ # })
970
+ #
971
+ # ## Handling Errors
972
+ #
973
+ # When a waiter is unsuccessful, it will raise an error.
974
+ # All of the failure errors extend from
975
+ # {Aws::Waiters::Errors::WaiterFailed}.
976
+ #
977
+ # begin
978
+ # client.wait_until(...)
979
+ # rescue Aws::Waiters::Errors::WaiterFailed
980
+ # # resource did not enter the desired state in time
981
+ # end
982
+ #
983
+ # ## Valid Waiters
984
+ #
985
+ # The following table lists the valid waiter names, the operations they call,
986
+ # and the default `:delay` and `:max_attempts` values.
987
+ #
988
+ # | waiter_name | params | :delay | :max_attempts |
989
+ # | ------------------ | ------------------------ | -------- | ------------- |
990
+ # | application_active | {Client#get_application} | 5 | 24 |
991
+ #
992
+ # @raise [Errors::FailureStateError] Raised when the waiter terminates
993
+ # because the waiter has entered a state that it will not transition
994
+ # out of, preventing success.
995
+ #
996
+ # @raise [Errors::TooManyAttemptsError] Raised when the configured
997
+ # maximum number of attempts have been made, and the waiter is not
998
+ # yet successful.
999
+ #
1000
+ # @raise [Errors::UnexpectedError] Raised when an error is encounted
1001
+ # while polling for a resource that is not expected.
1002
+ #
1003
+ # @raise [Errors::NoSuchWaiterError] Raised when you request to wait
1004
+ # for an unknown state.
1005
+ #
1006
+ # @return [Boolean] Returns `true` if the waiter was successful.
1007
+ # @param [Symbol] waiter_name
1008
+ # @param [Hash] params ({})
1009
+ # @param [Hash] options ({})
1010
+ # @option options [Integer] :max_attempts
1011
+ # @option options [Integer] :delay
1012
+ # @option options [Proc] :before_attempt
1013
+ # @option options [Proc] :before_wait
1014
+ def wait_until(waiter_name, params = {}, options = {})
1015
+ w = waiter(waiter_name, options)
1016
+ yield(w.waiter) if block_given? # deprecated
1017
+ w.wait(params)
1018
+ end
1019
+
1020
+ # @api private
1021
+ # @deprecated
1022
+ def waiter_names
1023
+ waiters.keys
1024
+ end
1025
+
1026
+ private
1027
+
1028
+ # @param [Symbol] waiter_name
1029
+ # @param [Hash] options ({})
1030
+ def waiter(waiter_name, options = {})
1031
+ waiter_class = waiters[waiter_name]
1032
+ if waiter_class
1033
+ waiter_class.new(options.merge(client: self))
1034
+ else
1035
+ raise Aws::Waiters::Errors::NoSuchWaiterError.new(waiter_name, waiters.keys)
1036
+ end
1037
+ end
1038
+
1039
+ def waiters
1040
+ {
1041
+ application_active: Waiters::ApplicationActive
1042
+ }
1043
+ end
1044
+
1045
+ class << self
1046
+
1047
+ # @api private
1048
+ attr_reader :identifier
1049
+
1050
+ # @api private
1051
+ def errors_module
1052
+ Errors
1053
+ end
1054
+
1055
+ end
1056
+ end
1057
+ end