// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[derive(Debug)]
pub(crate) struct Handle<
C = aws_smithy_client::erase::DynConnector,
M = aws_hyper::AwsMiddleware,
R = aws_smithy_client::retry::Standard,
> {
client: aws_smithy_client::Client<C, M, R>,
conf: crate::Config,
}
/// An ergonomic service client for `AmazonDetective`.
///
/// This client allows ergonomic access to a `AmazonDetective`-shaped service.
/// Each method corresponds to an endpoint defined in the service's Smithy model,
/// and the request and response shapes are auto-generated from that same model.
///
/// # Using a Client
///
/// Once you have a client set up, you can access the service's endpoints
/// by calling the appropriate method on [`Client`]. Each such method
/// returns a request builder for that endpoint, with methods for setting
/// the various fields of the request. Once your request is complete, use
/// the `send` method to send the request. `send` returns a future, which
/// you then have to `.await` to get the service's response.
///
/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#c-builder
/// [SigV4-signed requests]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html
#[derive(std::fmt::Debug)]
pub struct Client<
C = aws_smithy_client::erase::DynConnector,
M = aws_hyper::AwsMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<Handle<C, M, R>>,
}
impl<C, M, R> std::clone::Clone for Client<C, M, R> {
fn clone(&self) -> Self {
Self {
handle: self.handle.clone(),
}
}
}
#[doc(inline)]
pub use aws_smithy_client::Builder;
impl<C, M, R> From<aws_smithy_client::Client<C, M, R>> for Client<C, M, R> {
fn from(client: aws_smithy_client::Client<C, M, R>) -> Self {
Self::with_config(client, crate::Config::builder().build())
}
}
impl<C, M, R> Client<C, M, R> {
/// Creates a client with the given service configuration.
pub fn with_config(client: aws_smithy_client::Client<C, M, R>, conf: crate::Config) -> Self {
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
/// Returns the client's configuration.
pub fn conf(&self) -> &crate::Config {
&self.handle.conf
}
}
impl<C, M, R> Client<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Constructs a fluent builder for the `AcceptInvitation` operation.
///
/// See [`AcceptInvitation`](crate::client::fluent_builders::AcceptInvitation) for more information about the
/// operation and its arguments.
pub fn accept_invitation(&self) -> fluent_builders::AcceptInvitation<C, M, R> {
fluent_builders::AcceptInvitation::new(self.handle.clone())
}
/// Constructs a fluent builder for the `CreateGraph` operation.
///
/// See [`CreateGraph`](crate::client::fluent_builders::CreateGraph) for more information about the
/// operation and its arguments.
pub fn create_graph(&self) -> fluent_builders::CreateGraph<C, M, R> {
fluent_builders::CreateGraph::new(self.handle.clone())
}
/// Constructs a fluent builder for the `CreateMembers` operation.
///
/// See [`CreateMembers`](crate::client::fluent_builders::CreateMembers) for more information about the
/// operation and its arguments.
pub fn create_members(&self) -> fluent_builders::CreateMembers<C, M, R> {
fluent_builders::CreateMembers::new(self.handle.clone())
}
/// Constructs a fluent builder for the `DeleteGraph` operation.
///
/// See [`DeleteGraph`](crate::client::fluent_builders::DeleteGraph) for more information about the
/// operation and its arguments.
pub fn delete_graph(&self) -> fluent_builders::DeleteGraph<C, M, R> {
fluent_builders::DeleteGraph::new(self.handle.clone())
}
/// Constructs a fluent builder for the `DeleteMembers` operation.
///
/// See [`DeleteMembers`](crate::client::fluent_builders::DeleteMembers) for more information about the
/// operation and its arguments.
pub fn delete_members(&self) -> fluent_builders::DeleteMembers<C, M, R> {
fluent_builders::DeleteMembers::new(self.handle.clone())
}
/// Constructs a fluent builder for the `DisassociateMembership` operation.
///
/// See [`DisassociateMembership`](crate::client::fluent_builders::DisassociateMembership) for more information about the
/// operation and its arguments.
pub fn disassociate_membership(&self) -> fluent_builders::DisassociateMembership<C, M, R> {
fluent_builders::DisassociateMembership::new(self.handle.clone())
}
/// Constructs a fluent builder for the `GetMembers` operation.
///
/// See [`GetMembers`](crate::client::fluent_builders::GetMembers) for more information about the
/// operation and its arguments.
pub fn get_members(&self) -> fluent_builders::GetMembers<C, M, R> {
fluent_builders::GetMembers::new(self.handle.clone())
}
/// Constructs a fluent builder for the `ListGraphs` operation.
///
/// See [`ListGraphs`](crate::client::fluent_builders::ListGraphs) for more information about the
/// operation and its arguments.
pub fn list_graphs(&self) -> fluent_builders::ListGraphs<C, M, R> {
fluent_builders::ListGraphs::new(self.handle.clone())
}
/// Constructs a fluent builder for the `ListInvitations` operation.
///
/// See [`ListInvitations`](crate::client::fluent_builders::ListInvitations) for more information about the
/// operation and its arguments.
pub fn list_invitations(&self) -> fluent_builders::ListInvitations<C, M, R> {
fluent_builders::ListInvitations::new(self.handle.clone())
}
/// Constructs a fluent builder for the `ListMembers` operation.
///
/// See [`ListMembers`](crate::client::fluent_builders::ListMembers) for more information about the
/// operation and its arguments.
pub fn list_members(&self) -> fluent_builders::ListMembers<C, M, R> {
fluent_builders::ListMembers::new(self.handle.clone())
}
/// Constructs a fluent builder for the `ListTagsForResource` operation.
///
/// See [`ListTagsForResource`](crate::client::fluent_builders::ListTagsForResource) for more information about the
/// operation and its arguments.
pub fn list_tags_for_resource(&self) -> fluent_builders::ListTagsForResource<C, M, R> {
fluent_builders::ListTagsForResource::new(self.handle.clone())
}
/// Constructs a fluent builder for the `RejectInvitation` operation.
///
/// See [`RejectInvitation`](crate::client::fluent_builders::RejectInvitation) for more information about the
/// operation and its arguments.
pub fn reject_invitation(&self) -> fluent_builders::RejectInvitation<C, M, R> {
fluent_builders::RejectInvitation::new(self.handle.clone())
}
/// Constructs a fluent builder for the `StartMonitoringMember` operation.
///
/// See [`StartMonitoringMember`](crate::client::fluent_builders::StartMonitoringMember) for more information about the
/// operation and its arguments.
pub fn start_monitoring_member(&self) -> fluent_builders::StartMonitoringMember<C, M, R> {
fluent_builders::StartMonitoringMember::new(self.handle.clone())
}
/// Constructs a fluent builder for the `TagResource` operation.
///
/// See [`TagResource`](crate::client::fluent_builders::TagResource) for more information about the
/// operation and its arguments.
pub fn tag_resource(&self) -> fluent_builders::TagResource<C, M, R> {
fluent_builders::TagResource::new(self.handle.clone())
}
/// Constructs a fluent builder for the `UntagResource` operation.
///
/// See [`UntagResource`](crate::client::fluent_builders::UntagResource) for more information about the
/// operation and its arguments.
pub fn untag_resource(&self) -> fluent_builders::UntagResource<C, M, R> {
fluent_builders::UntagResource::new(self.handle.clone())
}
}
pub mod fluent_builders {
//!
//! Utilities to ergonomically construct a request to the service.
//!
//! Fluent builders are created through the [`Client`](crate::client::Client) by calling
//! one if its operation methods. After parameters are set using the builder methods,
//! the `send` method can be called to initiate the request.
//!
/// Fluent builder constructing a request to `AcceptInvitation`.
///
/// <p>Accepts an invitation for the member account to contribute data to a behavior graph.
/// This operation can only be called by an invited member account. </p>
/// <p>The request provides the ARN of behavior graph.</p>
/// <p>The member account status in the graph must be <code>INVITED</code>.</p>
#[derive(std::fmt::Debug)]
pub struct AcceptInvitation<
C = aws_smithy_client::erase::DynConnector,
M = aws_hyper::AwsMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::accept_invitation_input::Builder,
}
impl<C, M, R> AcceptInvitation<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `AcceptInvitation`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::AcceptInvitationOutput,
aws_smithy_http::result::SdkError<crate::error::AcceptInvitationError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::AcceptInvitationInputOperationOutputAlias,
crate::output::AcceptInvitationOutput,
crate::error::AcceptInvitationError,
crate::input::AcceptInvitationInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the behavior graph that the member account is accepting the invitation
/// for.</p>
/// <p>The member account status in the behavior graph must be <code>INVITED</code>.</p>
pub fn graph_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.graph_arn(inp);
self
}
/// <p>The ARN of the behavior graph that the member account is accepting the invitation
/// for.</p>
/// <p>The member account status in the behavior graph must be <code>INVITED</code>.</p>
pub fn set_graph_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_graph_arn(input);
self
}
}
/// Fluent builder constructing a request to `CreateGraph`.
///
/// <p>Creates a new behavior graph for the calling account, and sets that account as the
/// administrator account. This operation is called by the account that is enabling
/// Detective.</p>
/// <p>Before you try to enable Detective, make sure that your account has been enrolled in
/// Amazon GuardDuty for at least 48 hours. If you do not meet this requirement, you cannot enable
/// Detective. If you do meet the GuardDuty prerequisite, then when you make the request to enable
/// Detective, it checks whether your data volume is within the Detective quota. If it exceeds the
/// quota, then you cannot enable Detective. </p>
/// <p>The operation also enables Detective for the calling account in the currently selected
/// Region. It returns the ARN of the new behavior graph.</p>
/// <p>
/// <code>CreateGraph</code> triggers a process to create the corresponding data tables for
/// the new behavior graph.</p>
/// <p>An account can only be the administrator account for one behavior graph within a Region.
/// If the same account calls <code>CreateGraph</code> with the same administrator account, it
/// always returns the same behavior graph ARN. It does not create a new behavior graph.</p>
#[derive(std::fmt::Debug)]
pub struct CreateGraph<
C = aws_smithy_client::erase::DynConnector,
M = aws_hyper::AwsMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::create_graph_input::Builder,
}
impl<C, M, R> CreateGraph<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `CreateGraph`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::CreateGraphOutput,
aws_smithy_http::result::SdkError<crate::error::CreateGraphError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::CreateGraphInputOperationOutputAlias,
crate::output::CreateGraphOutput,
crate::error::CreateGraphError,
crate::input::CreateGraphInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// Adds a key-value pair to `Tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The tags to assign to the new behavior graph. You can add up to 50 tags. For each tag,
/// you provide the tag key and the tag value. Each tag key can contain up to 128 characters.
/// Each tag value can contain up to 256 characters.</p>
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
self.inner = self.inner.tags(k, v);
self
}
/// <p>The tags to assign to the new behavior graph. You can add up to 50 tags. For each tag,
/// you provide the tag key and the tag value. Each tag key can contain up to 128 characters.
/// Each tag value can contain up to 256 characters.</p>
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
}
/// Fluent builder constructing a request to `CreateMembers`.
///
/// <p>Sends a request to invite the specified AWS accounts to be member accounts in the
/// behavior graph. This operation can only be called by the administrator account for a
/// behavior graph. </p>
/// <p>
/// <code>CreateMembers</code> verifies the accounts and then invites the verified accounts.
/// The administrator can optionally specify to not send invitation emails to the member
/// accounts. This would be used when the administrator manages their member accounts
/// centrally.</p>
/// <p>The request provides the behavior graph ARN and the list of accounts to invite.</p>
/// <p>The response separates the requested accounts into two lists:</p>
/// <ul>
/// <li>
/// <p>The accounts that <code>CreateMembers</code> was able to start the verification
/// for. This list includes member accounts that are being verified, that have passed
/// verification and are to be invited, and that have failed verification.</p>
/// </li>
/// <li>
/// <p>The accounts that <code>CreateMembers</code> was unable to process. This list
/// includes accounts that were already invited to be member accounts in the behavior
/// graph.</p>
/// </li>
/// </ul>
#[derive(std::fmt::Debug)]
pub struct CreateMembers<
C = aws_smithy_client::erase::DynConnector,
M = aws_hyper::AwsMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::create_members_input::Builder,
}
impl<C, M, R> CreateMembers<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `CreateMembers`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::CreateMembersOutput,
aws_smithy_http::result::SdkError<crate::error::CreateMembersError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::CreateMembersInputOperationOutputAlias,
crate::output::CreateMembersOutput,
crate::error::CreateMembersError,
crate::input::CreateMembersInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the behavior graph to invite the member accounts to contribute their data
/// to.</p>
pub fn graph_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.graph_arn(inp);
self
}
/// <p>The ARN of the behavior graph to invite the member accounts to contribute their data
/// to.</p>
pub fn set_graph_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_graph_arn(input);
self
}
/// <p>Customized message text to include in the invitation email message to the invited member
/// accounts.</p>
pub fn message(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.message(inp);
self
}
/// <p>Customized message text to include in the invitation email message to the invited member
/// accounts.</p>
pub fn set_message(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_message(input);
self
}
/// <p>if set to <code>true</code>, then the member accounts do not receive email
/// notifications. By default, this is set to <code>false</code>, and the member accounts
/// receive email notifications.</p>
pub fn disable_email_notification(mut self, inp: bool) -> Self {
self.inner = self.inner.disable_email_notification(inp);
self
}
/// <p>if set to <code>true</code>, then the member accounts do not receive email
/// notifications. By default, this is set to <code>false</code>, and the member accounts
/// receive email notifications.</p>
pub fn set_disable_email_notification(mut self, input: std::option::Option<bool>) -> Self {
self.inner = self.inner.set_disable_email_notification(input);
self
}
/// Appends an item to `Accounts`.
///
/// To override the contents of this collection use [`set_accounts`](Self::set_accounts).
///
/// <p>The list of AWS accounts to invite to become member accounts in the behavior graph.
/// You can invite up to 50 accounts at a time. For each invited account, the account list
/// contains the account identifier and the AWS account root user email address.</p>
pub fn accounts(mut self, inp: impl Into<crate::model::Account>) -> Self {
self.inner = self.inner.accounts(inp);
self
}
/// <p>The list of AWS accounts to invite to become member accounts in the behavior graph.
/// You can invite up to 50 accounts at a time. For each invited account, the account list
/// contains the account identifier and the AWS account root user email address.</p>
pub fn set_accounts(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Account>>,
) -> Self {
self.inner = self.inner.set_accounts(input);
self
}
}
/// Fluent builder constructing a request to `DeleteGraph`.
///
/// <p>Disables the specified behavior graph and queues it to be deleted. This operation
/// removes the graph from each member account's list of behavior graphs.</p>
/// <p>
/// <code>DeleteGraph</code> can only be called by the administrator account for a behavior
/// graph.</p>
#[derive(std::fmt::Debug)]
pub struct DeleteGraph<
C = aws_smithy_client::erase::DynConnector,
M = aws_hyper::AwsMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::delete_graph_input::Builder,
}
impl<C, M, R> DeleteGraph<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DeleteGraph`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DeleteGraphOutput,
aws_smithy_http::result::SdkError<crate::error::DeleteGraphError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DeleteGraphInputOperationOutputAlias,
crate::output::DeleteGraphOutput,
crate::error::DeleteGraphError,
crate::input::DeleteGraphInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the behavior graph to disable.</p>
pub fn graph_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.graph_arn(inp);
self
}
/// <p>The ARN of the behavior graph to disable.</p>
pub fn set_graph_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_graph_arn(input);
self
}
}
/// Fluent builder constructing a request to `DeleteMembers`.
///
/// <p>Deletes one or more member accounts from the administrator account's behavior graph.
/// This operation can only be called by a Detective administrator account. That account cannot use
/// <code>DeleteMembers</code> to delete their own account from the behavior graph. To
/// disable a behavior graph, the administrator account uses the <code>DeleteGraph</code> API
/// method.</p>
#[derive(std::fmt::Debug)]
pub struct DeleteMembers<
C = aws_smithy_client::erase::DynConnector,
M = aws_hyper::AwsMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::delete_members_input::Builder,
}
impl<C, M, R> DeleteMembers<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DeleteMembers`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DeleteMembersOutput,
aws_smithy_http::result::SdkError<crate::error::DeleteMembersError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DeleteMembersInputOperationOutputAlias,
crate::output::DeleteMembersOutput,
crate::error::DeleteMembersError,
crate::input::DeleteMembersInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the behavior graph to delete members from.</p>
pub fn graph_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.graph_arn(inp);
self
}
/// <p>The ARN of the behavior graph to delete members from.</p>
pub fn set_graph_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_graph_arn(input);
self
}
/// Appends an item to `AccountIds`.
///
/// To override the contents of this collection use [`set_account_ids`](Self::set_account_ids).
///
/// <p>The list of AWS account identifiers for the member accounts to delete from the
/// behavior graph. You can delete up to 50 member accounts at a time.</p>
pub fn account_ids(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.account_ids(inp);
self
}
/// <p>The list of AWS account identifiers for the member accounts to delete from the
/// behavior graph. You can delete up to 50 member accounts at a time.</p>
pub fn set_account_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_account_ids(input);
self
}
}
/// Fluent builder constructing a request to `DisassociateMembership`.
///
/// <p>Removes the member account from the specified behavior graph. This operation can only be
/// called by a member account that has the <code>ENABLED</code> status.</p>
#[derive(std::fmt::Debug)]
pub struct DisassociateMembership<
C = aws_smithy_client::erase::DynConnector,
M = aws_hyper::AwsMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::disassociate_membership_input::Builder,
}
impl<C, M, R> DisassociateMembership<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `DisassociateMembership`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::DisassociateMembershipOutput,
aws_smithy_http::result::SdkError<crate::error::DisassociateMembershipError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::DisassociateMembershipInputOperationOutputAlias,
crate::output::DisassociateMembershipOutput,
crate::error::DisassociateMembershipError,
crate::input::DisassociateMembershipInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the behavior graph to remove the member account from.</p>
/// <p>The member account's member status in the behavior graph must be
/// <code>ENABLED</code>.</p>
pub fn graph_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.graph_arn(inp);
self
}
/// <p>The ARN of the behavior graph to remove the member account from.</p>
/// <p>The member account's member status in the behavior graph must be
/// <code>ENABLED</code>.</p>
pub fn set_graph_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_graph_arn(input);
self
}
}
/// Fluent builder constructing a request to `GetMembers`.
///
/// <p>Returns the membership details for specified member accounts for a behavior
/// graph.</p>
#[derive(std::fmt::Debug)]
pub struct GetMembers<
C = aws_smithy_client::erase::DynConnector,
M = aws_hyper::AwsMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::get_members_input::Builder,
}
impl<C, M, R> GetMembers<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `GetMembers`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::GetMembersOutput,
aws_smithy_http::result::SdkError<crate::error::GetMembersError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::GetMembersInputOperationOutputAlias,
crate::output::GetMembersOutput,
crate::error::GetMembersError,
crate::input::GetMembersInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the behavior graph for which to request the member details.</p>
pub fn graph_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.graph_arn(inp);
self
}
/// <p>The ARN of the behavior graph for which to request the member details.</p>
pub fn set_graph_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_graph_arn(input);
self
}
/// Appends an item to `AccountIds`.
///
/// To override the contents of this collection use [`set_account_ids`](Self::set_account_ids).
///
/// <p>The list of AWS account identifiers for the member account for which to return member
/// details. You can request details for up to 50 member accounts at a time.</p>
/// <p>You cannot use <code>GetMembers</code> to retrieve information about member accounts
/// that were removed from the behavior graph.</p>
pub fn account_ids(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.account_ids(inp);
self
}
/// <p>The list of AWS account identifiers for the member account for which to return member
/// details. You can request details for up to 50 member accounts at a time.</p>
/// <p>You cannot use <code>GetMembers</code> to retrieve information about member accounts
/// that were removed from the behavior graph.</p>
pub fn set_account_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_account_ids(input);
self
}
}
/// Fluent builder constructing a request to `ListGraphs`.
///
/// <p>Returns the list of behavior graphs that the calling account is an administrator account
/// of. This operation can only be called by an administrator account.</p>
/// <p>Because an account can currently only be the administrator of one behavior graph within
/// a Region, the results always contain a single behavior graph.</p>
#[derive(std::fmt::Debug)]
pub struct ListGraphs<
C = aws_smithy_client::erase::DynConnector,
M = aws_hyper::AwsMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::list_graphs_input::Builder,
}
impl<C, M, R> ListGraphs<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `ListGraphs`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListGraphsOutput,
aws_smithy_http::result::SdkError<crate::error::ListGraphsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::ListGraphsInputOperationOutputAlias,
crate::output::ListGraphsOutput,
crate::error::ListGraphsError,
crate::input::ListGraphsInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>For requests to get the next page of results, the pagination token that was returned
/// with the previous set of results. The initial request does not include a pagination
/// token.</p>
pub fn next_token(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(inp);
self
}
/// <p>For requests to get the next page of results, the pagination token that was returned
/// with the previous set of results. The initial request does not include a pagination
/// token.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>The maximum number of graphs to return at a time. The total must be less than the
/// overall limit on the number of results to return, which is currently 200.</p>
pub fn max_results(mut self, inp: i32) -> Self {
self.inner = self.inner.max_results(inp);
self
}
/// <p>The maximum number of graphs to return at a time. The total must be less than the
/// overall limit on the number of results to return, which is currently 200.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
}
/// Fluent builder constructing a request to `ListInvitations`.
///
/// <p>Retrieves the list of open and accepted behavior graph invitations for the member
/// account. This operation can only be called by a member account.</p>
/// <p>Open invitations are invitations that the member account has not responded to.</p>
/// <p>The results do not include behavior graphs for which the member account declined the
/// invitation. The results also do not include behavior graphs that the member account
/// resigned from or was removed from.</p>
#[derive(std::fmt::Debug)]
pub struct ListInvitations<
C = aws_smithy_client::erase::DynConnector,
M = aws_hyper::AwsMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::list_invitations_input::Builder,
}
impl<C, M, R> ListInvitations<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `ListInvitations`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListInvitationsOutput,
aws_smithy_http::result::SdkError<crate::error::ListInvitationsError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::ListInvitationsInputOperationOutputAlias,
crate::output::ListInvitationsOutput,
crate::error::ListInvitationsError,
crate::input::ListInvitationsInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>For requests to retrieve the next page of results, the pagination token that was
/// returned with the previous page of results. The initial request does not include a
/// pagination token.</p>
pub fn next_token(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(inp);
self
}
/// <p>For requests to retrieve the next page of results, the pagination token that was
/// returned with the previous page of results. The initial request does not include a
/// pagination token.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>The maximum number of behavior graph invitations to return in the response. The total
/// must be less than the overall limit on the number of results to return, which is currently
/// 200.</p>
pub fn max_results(mut self, inp: i32) -> Self {
self.inner = self.inner.max_results(inp);
self
}
/// <p>The maximum number of behavior graph invitations to return in the response. The total
/// must be less than the overall limit on the number of results to return, which is currently
/// 200.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
}
/// Fluent builder constructing a request to `ListMembers`.
///
/// <p>Retrieves the list of member accounts for a behavior graph. Does not return member
/// accounts that were removed from the behavior graph.</p>
#[derive(std::fmt::Debug)]
pub struct ListMembers<
C = aws_smithy_client::erase::DynConnector,
M = aws_hyper::AwsMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::list_members_input::Builder,
}
impl<C, M, R> ListMembers<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `ListMembers`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListMembersOutput,
aws_smithy_http::result::SdkError<crate::error::ListMembersError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::ListMembersInputOperationOutputAlias,
crate::output::ListMembersOutput,
crate::error::ListMembersError,
crate::input::ListMembersInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the behavior graph for which to retrieve the list of member accounts.</p>
pub fn graph_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.graph_arn(inp);
self
}
/// <p>The ARN of the behavior graph for which to retrieve the list of member accounts.</p>
pub fn set_graph_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_graph_arn(input);
self
}
/// <p>For requests to retrieve the next page of member account results, the pagination token
/// that was returned with the previous page of results. The initial request does not include a
/// pagination token.</p>
pub fn next_token(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.next_token(inp);
self
}
/// <p>For requests to retrieve the next page of member account results, the pagination token
/// that was returned with the previous page of results. The initial request does not include a
/// pagination token.</p>
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <p>The maximum number of member accounts to include in the response. The total must be less
/// than the overall limit on the number of results to return, which is currently 200.</p>
pub fn max_results(mut self, inp: i32) -> Self {
self.inner = self.inner.max_results(inp);
self
}
/// <p>The maximum number of member accounts to include in the response. The total must be less
/// than the overall limit on the number of results to return, which is currently 200.</p>
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_results(input);
self
}
}
/// Fluent builder constructing a request to `ListTagsForResource`.
///
/// <p>Returns the tag values that are assigned to a behavior graph.</p>
#[derive(std::fmt::Debug)]
pub struct ListTagsForResource<
C = aws_smithy_client::erase::DynConnector,
M = aws_hyper::AwsMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::list_tags_for_resource_input::Builder,
}
impl<C, M, R> ListTagsForResource<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `ListTagsForResource`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::ListTagsForResourceOutput,
aws_smithy_http::result::SdkError<crate::error::ListTagsForResourceError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::ListTagsForResourceInputOperationOutputAlias,
crate::output::ListTagsForResourceOutput,
crate::error::ListTagsForResourceError,
crate::input::ListTagsForResourceInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the behavior graph for which to retrieve the tag values.</p>
pub fn resource_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.resource_arn(inp);
self
}
/// <p>The ARN of the behavior graph for which to retrieve the tag values.</p>
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_resource_arn(input);
self
}
}
/// Fluent builder constructing a request to `RejectInvitation`.
///
/// <p>Rejects an invitation to contribute the account data to a behavior graph. This operation
/// must be called by a member account that has the <code>INVITED</code> status.</p>
#[derive(std::fmt::Debug)]
pub struct RejectInvitation<
C = aws_smithy_client::erase::DynConnector,
M = aws_hyper::AwsMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::reject_invitation_input::Builder,
}
impl<C, M, R> RejectInvitation<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `RejectInvitation`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::RejectInvitationOutput,
aws_smithy_http::result::SdkError<crate::error::RejectInvitationError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::RejectInvitationInputOperationOutputAlias,
crate::output::RejectInvitationOutput,
crate::error::RejectInvitationError,
crate::input::RejectInvitationInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the behavior graph to reject the invitation to.</p>
/// <p>The member account's current member status in the behavior graph must be
/// <code>INVITED</code>.</p>
pub fn graph_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.graph_arn(inp);
self
}
/// <p>The ARN of the behavior graph to reject the invitation to.</p>
/// <p>The member account's current member status in the behavior graph must be
/// <code>INVITED</code>.</p>
pub fn set_graph_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_graph_arn(input);
self
}
}
/// Fluent builder constructing a request to `StartMonitoringMember`.
///
/// <p>Sends a request to enable data ingest for a member account that has a status of
/// <code>ACCEPTED_BUT_DISABLED</code>.</p>
/// <p>For valid member accounts, the status is updated as follows.</p>
/// <ul>
/// <li>
/// <p>If Detective enabled the member account, then the new status is
/// <code>ENABLED</code>.</p>
/// </li>
/// <li>
/// <p>If Detective cannot enable the member account, the status remains
/// <code>ACCEPTED_BUT_DISABLED</code>. </p>
/// </li>
/// </ul>
#[derive(std::fmt::Debug)]
pub struct StartMonitoringMember<
C = aws_smithy_client::erase::DynConnector,
M = aws_hyper::AwsMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::start_monitoring_member_input::Builder,
}
impl<C, M, R> StartMonitoringMember<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `StartMonitoringMember`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::StartMonitoringMemberOutput,
aws_smithy_http::result::SdkError<crate::error::StartMonitoringMemberError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::StartMonitoringMemberInputOperationOutputAlias,
crate::output::StartMonitoringMemberOutput,
crate::error::StartMonitoringMemberError,
crate::input::StartMonitoringMemberInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the behavior graph.</p>
pub fn graph_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.graph_arn(inp);
self
}
/// <p>The ARN of the behavior graph.</p>
pub fn set_graph_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_graph_arn(input);
self
}
/// <p>The account ID of the member account to try to enable.</p>
/// <p>The account must be an invited member account with a status of
/// <code>ACCEPTED_BUT_DISABLED</code>. </p>
pub fn account_id(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.account_id(inp);
self
}
/// <p>The account ID of the member account to try to enable.</p>
/// <p>The account must be an invited member account with a status of
/// <code>ACCEPTED_BUT_DISABLED</code>. </p>
pub fn set_account_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_account_id(input);
self
}
}
/// Fluent builder constructing a request to `TagResource`.
///
/// <p>Applies tag values to a behavior graph.</p>
#[derive(std::fmt::Debug)]
pub struct TagResource<
C = aws_smithy_client::erase::DynConnector,
M = aws_hyper::AwsMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::tag_resource_input::Builder,
}
impl<C, M, R> TagResource<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `TagResource`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::TagResourceOutput,
aws_smithy_http::result::SdkError<crate::error::TagResourceError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::TagResourceInputOperationOutputAlias,
crate::output::TagResourceOutput,
crate::error::TagResourceError,
crate::input::TagResourceInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the behavior graph to assign the tags to.</p>
pub fn resource_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.resource_arn(inp);
self
}
/// <p>The ARN of the behavior graph to assign the tags to.</p>
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_resource_arn(input);
self
}
/// Adds a key-value pair to `Tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The tags to assign to the behavior graph. You can add up to 50 tags. For each tag, you
/// provide the tag key and the tag value. Each tag key can contain up to 128 characters. Each
/// tag value can contain up to 256 characters.</p>
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
self.inner = self.inner.tags(k, v);
self
}
/// <p>The tags to assign to the behavior graph. You can add up to 50 tags. For each tag, you
/// provide the tag key and the tag value. Each tag key can contain up to 128 characters. Each
/// tag value can contain up to 256 characters.</p>
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.inner = self.inner.set_tags(input);
self
}
}
/// Fluent builder constructing a request to `UntagResource`.
///
/// <p>Removes tags from a behavior graph.</p>
#[derive(std::fmt::Debug)]
pub struct UntagResource<
C = aws_smithy_client::erase::DynConnector,
M = aws_hyper::AwsMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<super::Handle<C, M, R>>,
inner: crate::input::untag_resource_input::Builder,
}
impl<C, M, R> UntagResource<C, M, R>
where
C: aws_smithy_client::bounds::SmithyConnector,
M: aws_smithy_client::bounds::SmithyMiddleware<C>,
R: aws_smithy_client::retry::NewRequestPolicy,
{
/// Creates a new `UntagResource`.
pub(crate) fn new(handle: std::sync::Arc<super::Handle<C, M, R>>) -> Self {
Self {
handle,
inner: Default::default(),
}
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> std::result::Result<
crate::output::UntagResourceOutput,
aws_smithy_http::result::SdkError<crate::error::UntagResourceError>,
>
where
R::Policy: aws_smithy_client::bounds::SmithyRetryPolicy<
crate::input::UntagResourceInputOperationOutputAlias,
crate::output::UntagResourceOutput,
crate::error::UntagResourceError,
crate::input::UntagResourceInputOperationRetryAlias,
>,
{
let input = self.inner.build().map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
let op = input
.make_operation(&self.handle.conf)
.await
.map_err(|err| {
aws_smithy_http::result::SdkError::ConstructionFailure(err.into())
})?;
self.handle.client.call(op).await
}
/// <p>The ARN of the behavior graph to remove the tags from.</p>
pub fn resource_arn(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.resource_arn(inp);
self
}
/// <p>The ARN of the behavior graph to remove the tags from.</p>
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_resource_arn(input);
self
}
/// Appends an item to `TagKeys`.
///
/// To override the contents of this collection use [`set_tag_keys`](Self::set_tag_keys).
///
/// <p>The tag keys of the tags to remove from the behavior graph. You can remove up to 50 tags
/// at a time.</p>
pub fn tag_keys(mut self, inp: impl Into<std::string::String>) -> Self {
self.inner = self.inner.tag_keys(inp);
self
}
/// <p>The tag keys of the tags to remove from the behavior graph. You can remove up to 50 tags
/// at a time.</p>
pub fn set_tag_keys(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.inner = self.inner.set_tag_keys(input);
self
}
}
}
impl<C> Client<C, aws_hyper::AwsMiddleware, aws_smithy_client::retry::Standard> {
/// Creates a client with the given service config and connector override.
pub fn from_conf_conn(conf: crate::Config, conn: C) -> Self {
let retry_config = conf.retry_config.as_ref().cloned().unwrap_or_default();
let client = aws_hyper::Client::new(conn).with_retry_config(retry_config.into());
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
}
impl
Client<
aws_smithy_client::erase::DynConnector,
aws_hyper::AwsMiddleware,
aws_smithy_client::retry::Standard,
>
{
/// Creates a new client from a shared config.
#[cfg(any(feature = "rustls", feature = "native-tls"))]
pub fn new(config: &aws_types::config::Config) -> Self {
Self::from_conf(config.into())
}
/// Creates a new client from the service [`Config`](crate::Config).
#[cfg(any(feature = "rustls", feature = "native-tls"))]
pub fn from_conf(conf: crate::Config) -> Self {
let retry_config = conf.retry_config.as_ref().cloned().unwrap_or_default();
let client = aws_hyper::Client::https().with_retry_config(retry_config.into());
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
}