Struct aws_sdk_macie::client::Client
source · pub struct Client { /* private fields */ }
Expand description
Client for Amazon Macie
Client for invoking operations on Amazon Macie. Each operation on Amazon Macie is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
Constructing a Client
A Config
is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env()
, since this will resolve an SdkConfig
which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env()
instead, which returns a ConfigLoader
that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_macie::Client::new(&config);
Occasionally, SDKs may have additional service-specific that can be set on the Config
that
is absent from SdkConfig
, or slightly different settings for a specific client may be desired.
The Config
struct implements From<&SdkConfig>
, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_macie::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();
See the aws-config
docs and Config
for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
Using the Client
A client has a function for every operation that can be performed by the service.
For example, the AssociateMemberAccount
operation has
a Client::associate_member_account
, function which returns a builder for that operation.
The fluent builder ultimately has a send()
function that returns an async future that
returns a result, as illustrated below:
let result = client.associate_member_account()
.member_account_id("example")
.send()
.await;
The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize
module for more
information.
Implementations§
source§impl Client
impl Client
sourcepub fn associate_member_account(&self) -> AssociateMemberAccountFluentBuilder
pub fn associate_member_account(&self) -> AssociateMemberAccountFluentBuilder
Constructs a fluent builder for the AssociateMemberAccount
operation.
- The fluent builder is configurable:
member_account_id(impl Into<String>)
/set_member_account_id(Option<String>)
:
required: true(Discontinued) The ID of the Amazon Web Services account that you want to associate with Amazon Macie Classic as a member account.
- On success, responds with
AssociateMemberAccountOutput
- On failure, responds with
SdkError<AssociateMemberAccountError>
source§impl Client
impl Client
sourcepub fn associate_s3_resources(&self) -> AssociateS3ResourcesFluentBuilder
pub fn associate_s3_resources(&self) -> AssociateS3ResourcesFluentBuilder
Constructs a fluent builder for the AssociateS3Resources
operation.
- The fluent builder is configurable:
member_account_id(impl Into<String>)
/set_member_account_id(Option<String>)
:
required: false(Discontinued) The ID of the Amazon Macie Classic member account whose resources you want to associate with Macie Classic.
s3_resources(S3ResourceClassification)
/set_s3_resources(Option<Vec::<S3ResourceClassification>>)
:
required: true(Discontinued) The S3 resources that you want to associate with Amazon Macie Classic for monitoring and data classification.
- On success, responds with
AssociateS3ResourcesOutput
with field(s):failed_s3_resources(Option<Vec::<FailedS3Resource>>)
:(Discontinued) S3 resources that couldn’t be associated with Amazon Macie Classic. An error code and an error message are provided for each failed item.
- On failure, responds with
SdkError<AssociateS3ResourcesError>
source§impl Client
impl Client
sourcepub fn disassociate_member_account(
&self
) -> DisassociateMemberAccountFluentBuilder
pub fn disassociate_member_account( &self ) -> DisassociateMemberAccountFluentBuilder
Constructs a fluent builder for the DisassociateMemberAccount
operation.
- The fluent builder is configurable:
member_account_id(impl Into<String>)
/set_member_account_id(Option<String>)
:
required: true(Discontinued) The ID of the member account that you want to remove from Amazon Macie Classic.
- On success, responds with
DisassociateMemberAccountOutput
- On failure, responds with
SdkError<DisassociateMemberAccountError>
source§impl Client
impl Client
sourcepub fn disassociate_s3_resources(&self) -> DisassociateS3ResourcesFluentBuilder
pub fn disassociate_s3_resources(&self) -> DisassociateS3ResourcesFluentBuilder
Constructs a fluent builder for the DisassociateS3Resources
operation.
- The fluent builder is configurable:
member_account_id(impl Into<String>)
/set_member_account_id(Option<String>)
:
required: false(Discontinued) The ID of the Amazon Macie Classic member account whose resources you want to remove from being monitored by Macie Classic.
associated_s3_resources(S3Resource)
/set_associated_s3_resources(Option<Vec::<S3Resource>>)
:
required: true(Discontinued) The S3 resources (buckets or prefixes) that you want to remove from being monitored and classified by Amazon Macie Classic.
- On success, responds with
DisassociateS3ResourcesOutput
with field(s):failed_s3_resources(Option<Vec::<FailedS3Resource>>)
:(Discontinued) S3 resources that couldn’t be removed from being monitored and classified by Amazon Macie Classic. An error code and an error message are provided for each failed item.
- On failure, responds with
SdkError<DisassociateS3ResourcesError>
source§impl Client
impl Client
sourcepub fn list_member_accounts(&self) -> ListMemberAccountsFluentBuilder
pub fn list_member_accounts(&self) -> ListMemberAccountsFluentBuilder
Constructs a fluent builder for the ListMemberAccounts
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: false(Discontinued) Use this parameter when paginating results. Set the value of this parameter to null on your first call to the
ListMemberAccounts
action. Subsequent calls to the action fillnextToken
in the request with the value ofnextToken
from the previous response to continue listing data.max_results(i32)
/set_max_results(Option<i32>)
:
required: false(Discontinued) Use this parameter to indicate the maximum number of items that you want in the response. The default value is 250.
- On success, responds with
ListMemberAccountsOutput
with field(s):member_accounts(Option<Vec::<MemberAccount>>)
:(Discontinued) A list of the Amazon Macie Classic member accounts returned by the action. The current Macie Classic administrator account is also included in this list.
next_token(Option<String>)
:(Discontinued) When a response is generated, if there is more data to be listed, this parameter is present in the response and contains the value to use for the
nextToken
parameter in a subsequent pagination request. If there is no more data to be listed, this parameter is set to null.
- On failure, responds with
SdkError<ListMemberAccountsError>
source§impl Client
impl Client
sourcepub fn list_s3_resources(&self) -> ListS3ResourcesFluentBuilder
pub fn list_s3_resources(&self) -> ListS3ResourcesFluentBuilder
Constructs a fluent builder for the ListS3Resources
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
member_account_id(impl Into<String>)
/set_member_account_id(Option<String>)
:
required: false(Discontinued) The Amazon Macie Classic member account ID whose associated S3 resources you want to list.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: false(Discontinued) Use this parameter when paginating results. Set its value to null on your first call to the
ListS3Resources
action. Subsequent calls to the action fillnextToken
in the request with the value ofnextToken
from the previous response to continue listing data.max_results(i32)
/set_max_results(Option<i32>)
:
required: false(Discontinued) Use this parameter to indicate the maximum number of items that you want in the response. The default value is 250.
- On success, responds with
ListS3ResourcesOutput
with field(s):s3_resources(Option<Vec::<S3ResourceClassification>>)
:(Discontinued) A list of the associated S3 resources returned by the action.
next_token(Option<String>)
:(Discontinued) When a response is generated, if there is more data to be listed, this parameter is present in the response and contains the value to use for the
nextToken
parameter in a subsequent pagination request. If there is no more data to be listed, this parameter is set to null.
- On failure, responds with
SdkError<ListS3ResourcesError>
source§impl Client
impl Client
sourcepub fn update_s3_resources(&self) -> UpdateS3ResourcesFluentBuilder
pub fn update_s3_resources(&self) -> UpdateS3ResourcesFluentBuilder
Constructs a fluent builder for the UpdateS3Resources
operation.
- The fluent builder is configurable:
member_account_id(impl Into<String>)
/set_member_account_id(Option<String>)
:
required: false(Discontinued) The Amazon Web Services account ID of the Amazon Macie Classic member account whose S3 resources’ classification types you want to update.
s3_resources_update(S3ResourceClassificationUpdate)
/set_s3_resources_update(Option<Vec::<S3ResourceClassificationUpdate>>)
:
required: true(Discontinued) The S3 resources whose classification types you want to update.
- On success, responds with
UpdateS3ResourcesOutput
with field(s):failed_s3_resources(Option<Vec::<FailedS3Resource>>)
:(Discontinued) The S3 resources whose classification types can’t be updated. An error code and an error message are provided for each failed item.
- On failure, responds with
SdkError<UpdateS3ResourcesError>
source§impl Client
impl Client
sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
source§impl Client
impl Client
sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.