aws-sdk-detective 1.76.0

AWS SDK for Amazon Detective
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>An Amazon Web Services account that is the administrator account of or a member of a behavior graph.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Account {
    /// <p>The account identifier of the Amazon Web Services account.</p>
    pub account_id: ::std::string::String,
    /// <p>The Amazon Web Services account root user email address for the Amazon Web Services account.</p>
    pub email_address: ::std::string::String,
}
impl Account {
    /// <p>The account identifier of the Amazon Web Services account.</p>
    pub fn account_id(&self) -> &str {
        use std::ops::Deref;
        self.account_id.deref()
    }
    /// <p>The Amazon Web Services account root user email address for the Amazon Web Services account.</p>
    pub fn email_address(&self) -> &str {
        use std::ops::Deref;
        self.email_address.deref()
    }
}
impl ::std::fmt::Debug for Account {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("Account");
        formatter.field("account_id", &self.account_id);
        formatter.field("email_address", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl Account {
    /// Creates a new builder-style object to manufacture [`Account`](crate::types::Account).
    pub fn builder() -> crate::types::builders::AccountBuilder {
        crate::types::builders::AccountBuilder::default()
    }
}

/// A builder for [`Account`](crate::types::Account).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct AccountBuilder {
    pub(crate) account_id: ::std::option::Option<::std::string::String>,
    pub(crate) email_address: ::std::option::Option<::std::string::String>,
}
impl AccountBuilder {
    /// <p>The account identifier of the Amazon Web Services account.</p>
    /// This field is required.
    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.account_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The account identifier of the Amazon Web Services account.</p>
    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.account_id = input;
        self
    }
    /// <p>The account identifier of the Amazon Web Services account.</p>
    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.account_id
    }
    /// <p>The Amazon Web Services account root user email address for the Amazon Web Services account.</p>
    /// This field is required.
    pub fn email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.email_address = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Web Services account root user email address for the Amazon Web Services account.</p>
    pub fn set_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.email_address = input;
        self
    }
    /// <p>The Amazon Web Services account root user email address for the Amazon Web Services account.</p>
    pub fn get_email_address(&self) -> &::std::option::Option<::std::string::String> {
        &self.email_address
    }
    /// Consumes the builder and constructs a [`Account`](crate::types::Account).
    /// This method will fail if any of the following fields are not set:
    /// - [`account_id`](crate::types::builders::AccountBuilder::account_id)
    /// - [`email_address`](crate::types::builders::AccountBuilder::email_address)
    pub fn build(self) -> ::std::result::Result<crate::types::Account, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Account {
            account_id: self.account_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "account_id",
                    "account_id was not specified but it is required when building Account",
                )
            })?,
            email_address: self.email_address.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "email_address",
                    "email_address was not specified but it is required when building Account",
                )
            })?,
        })
    }
}
impl ::std::fmt::Debug for AccountBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("AccountBuilder");
        formatter.field("account_id", &self.account_id);
        formatter.field("email_address", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}