aws-sdk-cloudwatchomni 1.2.0

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

/// Detailed information about a domain.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Domain {
    /// The unique ID of the domain.
    pub domain_id: ::std::string::String,
    /// The Amazon Resource Name (ARN) of the domain.
    pub domain_arn: ::std::string::String,
    /// A name that identifies the domain.
    pub name: ::std::option::Option<::std::string::String>,
    /// The identity providers configured for the domain.
    pub identity_providers: ::std::vec::Vec<crate::types::IdentityProvider>,
    /// Identity provider configuration for the domain.
    pub identity_provider_configuration: ::std::option::Option<crate::types::IdentityProviderConfiguration>,
    /// The HTTPS endpoint URL for accessing the domain.
    pub domain_endpoint_url: ::std::string::String,
    /// Additional endpoint URLs derived from the domain name.
    pub custom_endpoint_urls: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// The ARN of the Identity Center application. Absent for IAM-only domains.
    pub identity_center_application_arn: ::std::option::Option<::std::string::String>,
    /// The Region where this domain was created.
    pub region: ::std::string::String,
    /// The timestamp when the domain was created.
    pub created_at: ::aws_smithy_types::DateTime,
    /// The timestamp when the domain was last updated.
    pub updated_at: ::aws_smithy_types::DateTime,
    /// Current status of the domain.
    pub status: crate::types::DomainStatus,
}
impl Domain {
    /// The unique ID of the domain.
    pub fn domain_id(&self) -> &str {
        use std::ops::Deref;
        self.domain_id.deref()
    }
    /// The Amazon Resource Name (ARN) of the domain.
    pub fn domain_arn(&self) -> &str {
        use std::ops::Deref;
        self.domain_arn.deref()
    }
    /// A name that identifies the domain.
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// The identity providers configured for the domain.
    pub fn identity_providers(&self) -> &[crate::types::IdentityProvider] {
        use std::ops::Deref;
        self.identity_providers.deref()
    }
    /// Identity provider configuration for the domain.
    pub fn identity_provider_configuration(&self) -> ::std::option::Option<&crate::types::IdentityProviderConfiguration> {
        self.identity_provider_configuration.as_ref()
    }
    /// The HTTPS endpoint URL for accessing the domain.
    pub fn domain_endpoint_url(&self) -> &str {
        use std::ops::Deref;
        self.domain_endpoint_url.deref()
    }
    /// Additional endpoint URLs derived from the domain name.
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.custom_endpoint_urls.is_none()`.
    pub fn custom_endpoint_urls(&self) -> &[::std::string::String] {
        self.custom_endpoint_urls.as_deref().unwrap_or_default()
    }
    /// The ARN of the Identity Center application. Absent for IAM-only domains.
    pub fn identity_center_application_arn(&self) -> ::std::option::Option<&str> {
        self.identity_center_application_arn.as_deref()
    }
    /// The Region where this domain was created.
    pub fn region(&self) -> &str {
        use std::ops::Deref;
        self.region.deref()
    }
    /// The timestamp when the domain was created.
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    /// The timestamp when the domain was last updated.
    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
        &self.updated_at
    }
    /// Current status of the domain.
    pub fn status(&self) -> &crate::types::DomainStatus {
        &self.status
    }
}
impl Domain {
    /// Creates a new builder-style object to manufacture [`Domain`](crate::types::Domain).
    pub fn builder() -> crate::types::builders::DomainBuilder {
        crate::types::builders::DomainBuilder::default()
    }
}

/// A builder for [`Domain`](crate::types::Domain).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DomainBuilder {
    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
    pub(crate) domain_arn: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) identity_providers: ::std::option::Option<::std::vec::Vec<crate::types::IdentityProvider>>,
    pub(crate) identity_provider_configuration: ::std::option::Option<crate::types::IdentityProviderConfiguration>,
    pub(crate) domain_endpoint_url: ::std::option::Option<::std::string::String>,
    pub(crate) custom_endpoint_urls: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) identity_center_application_arn: ::std::option::Option<::std::string::String>,
    pub(crate) region: ::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) status: ::std::option::Option<crate::types::DomainStatus>,
}
impl DomainBuilder {
    /// The unique ID of the domain.
    /// This field is required.
    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.domain_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The unique ID of the domain.
    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.domain_id = input;
        self
    }
    /// The unique ID of the domain.
    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.domain_id
    }
    /// The Amazon Resource Name (ARN) of the domain.
    /// This field is required.
    pub fn domain_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.domain_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The Amazon Resource Name (ARN) of the domain.
    pub fn set_domain_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.domain_arn = input;
        self
    }
    /// The Amazon Resource Name (ARN) of the domain.
    pub fn get_domain_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.domain_arn
    }
    /// A name that identifies the domain.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// A name that identifies the domain.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// A name that identifies the domain.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// Appends an item to `identity_providers`.
    ///
    /// To override the contents of this collection use [`set_identity_providers`](Self::set_identity_providers).
    ///
    /// The identity providers configured for the domain.
    pub fn identity_providers(mut self, input: crate::types::IdentityProvider) -> Self {
        let mut v = self.identity_providers.unwrap_or_default();
        v.push(input);
        self.identity_providers = ::std::option::Option::Some(v);
        self
    }
    /// The identity providers configured for the domain.
    pub fn set_identity_providers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IdentityProvider>>) -> Self {
        self.identity_providers = input;
        self
    }
    /// The identity providers configured for the domain.
    pub fn get_identity_providers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IdentityProvider>> {
        &self.identity_providers
    }
    /// Identity provider configuration for the domain.
    pub fn identity_provider_configuration(mut self, input: crate::types::IdentityProviderConfiguration) -> Self {
        self.identity_provider_configuration = ::std::option::Option::Some(input);
        self
    }
    /// Identity provider configuration for the domain.
    pub fn set_identity_provider_configuration(mut self, input: ::std::option::Option<crate::types::IdentityProviderConfiguration>) -> Self {
        self.identity_provider_configuration = input;
        self
    }
    /// Identity provider configuration for the domain.
    pub fn get_identity_provider_configuration(&self) -> &::std::option::Option<crate::types::IdentityProviderConfiguration> {
        &self.identity_provider_configuration
    }
    /// The HTTPS endpoint URL for accessing the domain.
    /// This field is required.
    pub fn domain_endpoint_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.domain_endpoint_url = ::std::option::Option::Some(input.into());
        self
    }
    /// The HTTPS endpoint URL for accessing the domain.
    pub fn set_domain_endpoint_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.domain_endpoint_url = input;
        self
    }
    /// The HTTPS endpoint URL for accessing the domain.
    pub fn get_domain_endpoint_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.domain_endpoint_url
    }
    /// Appends an item to `custom_endpoint_urls`.
    ///
    /// To override the contents of this collection use [`set_custom_endpoint_urls`](Self::set_custom_endpoint_urls).
    ///
    /// Additional endpoint URLs derived from the domain name.
    pub fn custom_endpoint_urls(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.custom_endpoint_urls.unwrap_or_default();
        v.push(input.into());
        self.custom_endpoint_urls = ::std::option::Option::Some(v);
        self
    }
    /// Additional endpoint URLs derived from the domain name.
    pub fn set_custom_endpoint_urls(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.custom_endpoint_urls = input;
        self
    }
    /// Additional endpoint URLs derived from the domain name.
    pub fn get_custom_endpoint_urls(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.custom_endpoint_urls
    }
    /// The ARN of the Identity Center application. Absent for IAM-only domains.
    pub fn identity_center_application_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.identity_center_application_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The ARN of the Identity Center application. Absent for IAM-only domains.
    pub fn set_identity_center_application_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.identity_center_application_arn = input;
        self
    }
    /// The ARN of the Identity Center application. Absent for IAM-only domains.
    pub fn get_identity_center_application_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.identity_center_application_arn
    }
    /// The Region where this domain was created.
    /// This field is required.
    pub fn region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.region = ::std::option::Option::Some(input.into());
        self
    }
    /// The Region where this domain was created.
    pub fn set_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.region = input;
        self
    }
    /// The Region where this domain was created.
    pub fn get_region(&self) -> &::std::option::Option<::std::string::String> {
        &self.region
    }
    /// The timestamp when the domain was created.
    /// 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
    }
    /// The timestamp when the domain was created.
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// The timestamp when the domain was created.
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// The timestamp when the domain was last updated.
    /// 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
    }
    /// The timestamp when the domain was last updated.
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// The timestamp when the domain was last updated.
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// Current status of the domain.
    /// This field is required.
    pub fn status(mut self, input: crate::types::DomainStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// Current status of the domain.
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::DomainStatus>) -> Self {
        self.status = input;
        self
    }
    /// Current status of the domain.
    pub fn get_status(&self) -> &::std::option::Option<crate::types::DomainStatus> {
        &self.status
    }
    /// Consumes the builder and constructs a [`Domain`](crate::types::Domain).
    /// This method will fail if any of the following fields are not set:
    /// - [`domain_id`](crate::types::builders::DomainBuilder::domain_id)
    /// - [`domain_arn`](crate::types::builders::DomainBuilder::domain_arn)
    /// - [`identity_providers`](crate::types::builders::DomainBuilder::identity_providers)
    /// - [`domain_endpoint_url`](crate::types::builders::DomainBuilder::domain_endpoint_url)
    /// - [`region`](crate::types::builders::DomainBuilder::region)
    /// - [`created_at`](crate::types::builders::DomainBuilder::created_at)
    /// - [`updated_at`](crate::types::builders::DomainBuilder::updated_at)
    /// - [`status`](crate::types::builders::DomainBuilder::status)
    pub fn build(self) -> ::std::result::Result<crate::types::Domain, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Domain {
            domain_id: self.domain_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "domain_id",
                    "domain_id was not specified but it is required when building Domain",
                )
            })?,
            domain_arn: self.domain_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "domain_arn",
                    "domain_arn was not specified but it is required when building Domain",
                )
            })?,
            name: self.name,
            identity_providers: self.identity_providers.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "identity_providers",
                    "identity_providers was not specified but it is required when building Domain",
                )
            })?,
            identity_provider_configuration: self.identity_provider_configuration,
            domain_endpoint_url: self.domain_endpoint_url.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "domain_endpoint_url",
                    "domain_endpoint_url was not specified but it is required when building Domain",
                )
            })?,
            custom_endpoint_urls: self.custom_endpoint_urls,
            identity_center_application_arn: self.identity_center_application_arn,
            region: self.region.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "region",
                    "region was not specified but it is required when building Domain",
                )
            })?,
            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 Domain",
                )
            })?,
            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 Domain",
                )
            })?,
            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 Domain",
                )
            })?,
        })
    }
}