aws-sdk-accountaccessruntime 1.2.0

AWS SDK for Account Access Runtime
Documentation
// 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, ::std::fmt::Debug)]
pub struct GetRoleCredentialsInput {
    /// <p>The identifier of the tenant that the request applies to. A tenant ID begins with <code>aa-</code> and is 3 to 24 characters long. It can contain lowercase letters, numbers, and hyphens.</p>
    pub tenant_id: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the role to retrieve credentials for. You must be entitled to assume this role.</p>
    pub role_arn: ::std::option::Option<::std::string::String>,
    /// <p>The type of access to request for the role. Specify <code>PROGRAMMATIC_ACCESS</code> to receive access key credentials for use with the CLI or an Amazon Web Services SDK.</p>
    pub access_type: ::std::option::Option<crate::types::AccessType>,
    /// <p>An optional name for the role session. The name can be 2 to 64 characters and can contain alphanumeric characters and the following symbols: plus (+), equal (=), comma (,), period (.), at (@), and hyphen (-). The session name appears in CloudTrail logs for the assumed role session.</p>
    pub session_name: ::std::option::Option<::std::string::String>,
    /// <p>The duration, in seconds, that the returned credentials remain valid. If you don't specify a value, the service uses the default session duration. The maximum value can't exceed the maximum session duration configured for the role.</p>
    pub session_duration: ::std::option::Option<i32>,
}
impl GetRoleCredentialsInput {
    /// <p>The identifier of the tenant that the request applies to. A tenant ID begins with <code>aa-</code> and is 3 to 24 characters long. It can contain lowercase letters, numbers, and hyphens.</p>
    pub fn tenant_id(&self) -> ::std::option::Option<&str> {
        self.tenant_id.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the role to retrieve credentials for. You must be entitled to assume this role.</p>
    pub fn role_arn(&self) -> ::std::option::Option<&str> {
        self.role_arn.as_deref()
    }
    /// <p>The type of access to request for the role. Specify <code>PROGRAMMATIC_ACCESS</code> to receive access key credentials for use with the CLI or an Amazon Web Services SDK.</p>
    pub fn access_type(&self) -> ::std::option::Option<&crate::types::AccessType> {
        self.access_type.as_ref()
    }
    /// <p>An optional name for the role session. The name can be 2 to 64 characters and can contain alphanumeric characters and the following symbols: plus (+), equal (=), comma (,), period (.), at (@), and hyphen (-). The session name appears in CloudTrail logs for the assumed role session.</p>
    pub fn session_name(&self) -> ::std::option::Option<&str> {
        self.session_name.as_deref()
    }
    /// <p>The duration, in seconds, that the returned credentials remain valid. If you don't specify a value, the service uses the default session duration. The maximum value can't exceed the maximum session duration configured for the role.</p>
    pub fn session_duration(&self) -> ::std::option::Option<i32> {
        self.session_duration
    }
}
impl GetRoleCredentialsInput {
    /// Creates a new builder-style object to manufacture [`GetRoleCredentialsInput`](crate::operation::get_role_credentials::GetRoleCredentialsInput).
    pub fn builder() -> crate::operation::get_role_credentials::builders::GetRoleCredentialsInputBuilder {
        crate::operation::get_role_credentials::builders::GetRoleCredentialsInputBuilder::default()
    }
}

/// A builder for [`GetRoleCredentialsInput`](crate::operation::get_role_credentials::GetRoleCredentialsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetRoleCredentialsInputBuilder {
    pub(crate) tenant_id: ::std::option::Option<::std::string::String>,
    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) access_type: ::std::option::Option<crate::types::AccessType>,
    pub(crate) session_name: ::std::option::Option<::std::string::String>,
    pub(crate) session_duration: ::std::option::Option<i32>,
}
impl GetRoleCredentialsInputBuilder {
    /// <p>The identifier of the tenant that the request applies to. A tenant ID begins with <code>aa-</code> and is 3 to 24 characters long. It can contain lowercase letters, numbers, and hyphens.</p>
    /// This field is required.
    pub fn tenant_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.tenant_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the tenant that the request applies to. A tenant ID begins with <code>aa-</code> and is 3 to 24 characters long. It can contain lowercase letters, numbers, and hyphens.</p>
    pub fn set_tenant_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.tenant_id = input;
        self
    }
    /// <p>The identifier of the tenant that the request applies to. A tenant ID begins with <code>aa-</code> and is 3 to 24 characters long. It can contain lowercase letters, numbers, and hyphens.</p>
    pub fn get_tenant_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.tenant_id
    }
    /// <p>The Amazon Resource Name (ARN) of the role to retrieve credentials for. You must be entitled to assume this role.</p>
    /// This field is required.
    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the role to retrieve credentials for. You must be entitled to assume this role.</p>
    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.role_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the role to retrieve credentials for. You must be entitled to assume this role.</p>
    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.role_arn
    }
    /// <p>The type of access to request for the role. Specify <code>PROGRAMMATIC_ACCESS</code> to receive access key credentials for use with the CLI or an Amazon Web Services SDK.</p>
    /// This field is required.
    pub fn access_type(mut self, input: crate::types::AccessType) -> Self {
        self.access_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of access to request for the role. Specify <code>PROGRAMMATIC_ACCESS</code> to receive access key credentials for use with the CLI or an Amazon Web Services SDK.</p>
    pub fn set_access_type(mut self, input: ::std::option::Option<crate::types::AccessType>) -> Self {
        self.access_type = input;
        self
    }
    /// <p>The type of access to request for the role. Specify <code>PROGRAMMATIC_ACCESS</code> to receive access key credentials for use with the CLI or an Amazon Web Services SDK.</p>
    pub fn get_access_type(&self) -> &::std::option::Option<crate::types::AccessType> {
        &self.access_type
    }
    /// <p>An optional name for the role session. The name can be 2 to 64 characters and can contain alphanumeric characters and the following symbols: plus (+), equal (=), comma (,), period (.), at (@), and hyphen (-). The session name appears in CloudTrail logs for the assumed role session.</p>
    pub fn session_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.session_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An optional name for the role session. The name can be 2 to 64 characters and can contain alphanumeric characters and the following symbols: plus (+), equal (=), comma (,), period (.), at (@), and hyphen (-). The session name appears in CloudTrail logs for the assumed role session.</p>
    pub fn set_session_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.session_name = input;
        self
    }
    /// <p>An optional name for the role session. The name can be 2 to 64 characters and can contain alphanumeric characters and the following symbols: plus (+), equal (=), comma (,), period (.), at (@), and hyphen (-). The session name appears in CloudTrail logs for the assumed role session.</p>
    pub fn get_session_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_name
    }
    /// <p>The duration, in seconds, that the returned credentials remain valid. If you don't specify a value, the service uses the default session duration. The maximum value can't exceed the maximum session duration configured for the role.</p>
    pub fn session_duration(mut self, input: i32) -> Self {
        self.session_duration = ::std::option::Option::Some(input);
        self
    }
    /// <p>The duration, in seconds, that the returned credentials remain valid. If you don't specify a value, the service uses the default session duration. The maximum value can't exceed the maximum session duration configured for the role.</p>
    pub fn set_session_duration(mut self, input: ::std::option::Option<i32>) -> Self {
        self.session_duration = input;
        self
    }
    /// <p>The duration, in seconds, that the returned credentials remain valid. If you don't specify a value, the service uses the default session duration. The maximum value can't exceed the maximum session duration configured for the role.</p>
    pub fn get_session_duration(&self) -> &::std::option::Option<i32> {
        &self.session_duration
    }
    /// Consumes the builder and constructs a [`GetRoleCredentialsInput`](crate::operation::get_role_credentials::GetRoleCredentialsInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_role_credentials::GetRoleCredentialsInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::get_role_credentials::GetRoleCredentialsInput {
            tenant_id: self.tenant_id,
            role_arn: self.role_arn,
            access_type: self.access_type,
            session_name: self.session_name,
            session_duration: self.session_duration,
        })
    }
}