// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct GetDelegatedAccessTokenOutput {
    /// <p>Amazon Web Services credentials for API authentication.</p>
    pub credentials: ::std::option::Option<crate::types::Credentials>,
    /// <p>The percentage of the maximum policy size that is used by the session policy. The policy size is calculated as the sum of all the session policies and permission boundaries attached to the session. If the packed size exceeds 100%, the request fails.</p>
    pub packed_policy_size: ::std::option::Option<i32>,
    /// <p>The Amazon Resource Name (ARN) of the principal that was assumed when obtaining the delegated access token. This ARN identifies the IAM entity whose permissions are granted by the temporary credentials.</p>
    pub assumed_principal: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetDelegatedAccessTokenOutput {
    /// <p>Amazon Web Services credentials for API authentication.</p>
    pub fn credentials(&self) -> ::std::option::Option<&crate::types::Credentials> {
        self.credentials.as_ref()
    }
    /// <p>The percentage of the maximum policy size that is used by the session policy. The policy size is calculated as the sum of all the session policies and permission boundaries attached to the session. If the packed size exceeds 100%, the request fails.</p>
    pub fn packed_policy_size(&self) -> ::std::option::Option<i32> {
        self.packed_policy_size
    }
    /// <p>The Amazon Resource Name (ARN) of the principal that was assumed when obtaining the delegated access token. This ARN identifies the IAM entity whose permissions are granted by the temporary credentials.</p>
    pub fn assumed_principal(&self) -> ::std::option::Option<&str> {
        self.assumed_principal.as_deref()
    }
}
impl ::std::fmt::Debug for GetDelegatedAccessTokenOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetDelegatedAccessTokenOutput");
        formatter.field("credentials", &"*** Sensitive Data Redacted ***");
        formatter.field("packed_policy_size", &self.packed_policy_size);
        formatter.field("assumed_principal", &self.assumed_principal);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for GetDelegatedAccessTokenOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetDelegatedAccessTokenOutput {
    /// Creates a new builder-style object to manufacture [`GetDelegatedAccessTokenOutput`](crate::operation::get_delegated_access_token::GetDelegatedAccessTokenOutput).
    pub fn builder() -> crate::operation::get_delegated_access_token::builders::GetDelegatedAccessTokenOutputBuilder {
        crate::operation::get_delegated_access_token::builders::GetDelegatedAccessTokenOutputBuilder::default()
    }
}

/// A builder for [`GetDelegatedAccessTokenOutput`](crate::operation::get_delegated_access_token::GetDelegatedAccessTokenOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct GetDelegatedAccessTokenOutputBuilder {
    pub(crate) credentials: ::std::option::Option<crate::types::Credentials>,
    pub(crate) packed_policy_size: ::std::option::Option<i32>,
    pub(crate) assumed_principal: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetDelegatedAccessTokenOutputBuilder {
    /// <p>Amazon Web Services credentials for API authentication.</p>
    pub fn credentials(mut self, input: crate::types::Credentials) -> Self {
        self.credentials = ::std::option::Option::Some(input);
        self
    }
    /// <p>Amazon Web Services credentials for API authentication.</p>
    pub fn set_credentials(mut self, input: ::std::option::Option<crate::types::Credentials>) -> Self {
        self.credentials = input;
        self
    }
    /// <p>Amazon Web Services credentials for API authentication.</p>
    pub fn get_credentials(&self) -> &::std::option::Option<crate::types::Credentials> {
        &self.credentials
    }
    /// <p>The percentage of the maximum policy size that is used by the session policy. The policy size is calculated as the sum of all the session policies and permission boundaries attached to the session. If the packed size exceeds 100%, the request fails.</p>
    pub fn packed_policy_size(mut self, input: i32) -> Self {
        self.packed_policy_size = ::std::option::Option::Some(input);
        self
    }
    /// <p>The percentage of the maximum policy size that is used by the session policy. The policy size is calculated as the sum of all the session policies and permission boundaries attached to the session. If the packed size exceeds 100%, the request fails.</p>
    pub fn set_packed_policy_size(mut self, input: ::std::option::Option<i32>) -> Self {
        self.packed_policy_size = input;
        self
    }
    /// <p>The percentage of the maximum policy size that is used by the session policy. The policy size is calculated as the sum of all the session policies and permission boundaries attached to the session. If the packed size exceeds 100%, the request fails.</p>
    pub fn get_packed_policy_size(&self) -> &::std::option::Option<i32> {
        &self.packed_policy_size
    }
    /// <p>The Amazon Resource Name (ARN) of the principal that was assumed when obtaining the delegated access token. This ARN identifies the IAM entity whose permissions are granted by the temporary credentials.</p>
    pub fn assumed_principal(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.assumed_principal = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the principal that was assumed when obtaining the delegated access token. This ARN identifies the IAM entity whose permissions are granted by the temporary credentials.</p>
    pub fn set_assumed_principal(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.assumed_principal = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the principal that was assumed when obtaining the delegated access token. This ARN identifies the IAM entity whose permissions are granted by the temporary credentials.</p>
    pub fn get_assumed_principal(&self) -> &::std::option::Option<::std::string::String> {
        &self.assumed_principal
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetDelegatedAccessTokenOutput`](crate::operation::get_delegated_access_token::GetDelegatedAccessTokenOutput).
    pub fn build(self) -> crate::operation::get_delegated_access_token::GetDelegatedAccessTokenOutput {
        crate::operation::get_delegated_access_token::GetDelegatedAccessTokenOutput {
            credentials: self.credentials,
            packed_policy_size: self.packed_policy_size,
            assumed_principal: self.assumed_principal,
            _request_id: self._request_id,
        }
    }
}
impl ::std::fmt::Debug for GetDelegatedAccessTokenOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetDelegatedAccessTokenOutputBuilder");
        formatter.field("credentials", &"*** Sensitive Data Redacted ***");
        formatter.field("packed_policy_size", &self.packed_policy_size);
        formatter.field("assumed_principal", &self.assumed_principal);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
