aws-sdk-accountaccess 1.2.0

AWS SDK for Account Access
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 GetApplicationOutput {
    /// <p>The identity source details for the application, including the IAM Identity Center instance configuration.</p>
    pub identity_source: ::std::option::Option<crate::types::IdentitySourceDetails>,
    /// <p>The current status of the application.</p>
    pub status: crate::types::Status,
    /// <p>The tenant identifier associated with the application.</p>
    pub tenant_id: ::std::option::Option<::std::string::String>,
    /// <p>The date and time when the application was created.</p>
    pub created_at: ::aws_smithy_types::DateTime,
    /// <p>The date and time when the application was last updated.</p>
    pub updated_at: ::aws_smithy_types::DateTime,
    /// <p>The tags associated with the application.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>The error details if the application is in a failed state.</p>
    pub error: ::std::option::Option<crate::types::ErrorDetails>,
    _request_id: Option<String>,
}
impl GetApplicationOutput {
    /// <p>The identity source details for the application, including the IAM Identity Center instance configuration.</p>
    pub fn identity_source(&self) -> ::std::option::Option<&crate::types::IdentitySourceDetails> {
        self.identity_source.as_ref()
    }
    /// <p>The current status of the application.</p>
    pub fn status(&self) -> &crate::types::Status {
        &self.status
    }
    /// <p>The tenant identifier associated with the application.</p>
    pub fn tenant_id(&self) -> ::std::option::Option<&str> {
        self.tenant_id.as_deref()
    }
    /// <p>The date and time when the application was created.</p>
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// <p>The date and time when the application was last updated.</p>
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
    /// <p>The tags associated with the application.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
    /// <p>The error details if the application is in a failed state.</p>
    pub fn error(&self) -> ::std::option::Option<&crate::types::ErrorDetails> {
        self.error.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetApplicationOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetApplicationOutput {
    /// Creates a new builder-style object to manufacture [`GetApplicationOutput`](crate::operation::get_application::GetApplicationOutput).
    pub fn builder() -> crate::operation::get_application::builders::GetApplicationOutputBuilder {
        crate::operation::get_application::builders::GetApplicationOutputBuilder::default()
    }
}

/// A builder for [`GetApplicationOutput`](crate::operation::get_application::GetApplicationOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetApplicationOutputBuilder {
    pub(crate) identity_source: ::std::option::Option<crate::types::IdentitySourceDetails>,
    pub(crate) status: ::std::option::Option<crate::types::Status>,
    pub(crate) tenant_id: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) error: ::std::option::Option<crate::types::ErrorDetails>,
    _request_id: Option<String>,
}
impl GetApplicationOutputBuilder {
    /// <p>The identity source details for the application, including the IAM Identity Center instance configuration.</p>
    /// This field is required.
    pub fn identity_source(mut self, input: crate::types::IdentitySourceDetails) -> Self {
        self.identity_source = ::std::option::Option::Some(input);
        self
    }
    /// <p>The identity source details for the application, including the IAM Identity Center instance configuration.</p>
    pub fn set_identity_source(mut self, input: ::std::option::Option<crate::types::IdentitySourceDetails>) -> Self {
        self.identity_source = input;
        self
    }
    /// <p>The identity source details for the application, including the IAM Identity Center instance configuration.</p>
    pub fn get_identity_source(&self) -> &::std::option::Option<crate::types::IdentitySourceDetails> {
        &self.identity_source
    }
    /// <p>The current status of the application.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::Status) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current status of the application.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::Status>) -> Self {
        self.status = input;
        self
    }
    /// <p>The current status of the application.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::Status> {
        &self.status
    }
    /// <p>The tenant identifier associated with the application.</p>
    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 tenant identifier associated with the application.</p>
    pub fn set_tenant_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.tenant_id = input;
        self
    }
    /// <p>The tenant identifier associated with the application.</p>
    pub fn get_tenant_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.tenant_id
    }
    /// <p>The date and time when the application was created.</p>
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time when the application was created.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The date and time when the application was created.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>The date and time when the application was last updated.</p>
    /// This field is required.
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time when the application was last updated.</p>
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// <p>The date and time when the application was last updated.</p>
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags associated with the application.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The tags associated with the application.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The tags associated with the application.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// <p>The error details if the application is in a failed state.</p>
    pub fn error(mut self, input: crate::types::ErrorDetails) -> Self {
        self.error = ::std::option::Option::Some(input);
        self
    }
    /// <p>The error details if the application is in a failed state.</p>
    pub fn set_error(mut self, input: ::std::option::Option<crate::types::ErrorDetails>) -> Self {
        self.error = input;
        self
    }
    /// <p>The error details if the application is in a failed state.</p>
    pub fn get_error(&self) -> &::std::option::Option<crate::types::ErrorDetails> {
        &self.error
    }
    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 [`GetApplicationOutput`](crate::operation::get_application::GetApplicationOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`status`](crate::operation::get_application::builders::GetApplicationOutputBuilder::status)
    /// - [`created_at`](crate::operation::get_application::builders::GetApplicationOutputBuilder::created_at)
    /// - [`updated_at`](crate::operation::get_application::builders::GetApplicationOutputBuilder::updated_at)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_application::GetApplicationOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_application::GetApplicationOutput {
            identity_source: self.identity_source,
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building GetApplicationOutput",
                )
            })?,
            tenant_id: self.tenant_id,
            created_at: self.created_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "created_at",
                    "created_at was not specified but it is required when building GetApplicationOutput",
                )
            })?,
            updated_at: self.updated_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "updated_at",
                    "updated_at was not specified but it is required when building GetApplicationOutput",
                )
            })?,
            tags: self.tags,
            error: self.error,
            _request_id: self._request_id,
        })
    }
}