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.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateDomainInput {
    /// A name that identifies the domain. Must be 3-63 characters: lowercase letters, numbers, and hyphens. It must begin and end with a letter or number and cannot contain consecutive hyphens.
    pub name: ::std::option::Option<::std::string::String>,
    /// The identity providers to configure for the domain.
    pub identity_providers: ::std::option::Option<::std::vec::Vec<crate::types::IdentityProvider>>,
    /// Identity provider configuration for the domain.
    pub identity_provider_configuration: ::std::option::Option<crate::types::IdentityProviderConfiguration>,
    /// The tags to associate with the domain.
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl CreateDomainInput {
    /// A name that identifies the domain. Must be 3-63 characters: lowercase letters, numbers, and hyphens. It must begin and end with a letter or number and cannot contain consecutive hyphens.
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// The identity providers to configure for the domain.
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.identity_providers.is_none()`.
    pub fn identity_providers(&self) -> &[crate::types::IdentityProvider] {
        self.identity_providers.as_deref().unwrap_or_default()
    }
    /// 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 tags to associate with the domain.
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
    /// Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl CreateDomainInput {
    /// Creates a new builder-style object to manufacture [`CreateDomainInput`](crate::operation::create_domain::CreateDomainInput).
    pub fn builder() -> crate::operation::create_domain::builders::CreateDomainInputBuilder {
        crate::operation::create_domain::builders::CreateDomainInputBuilder::default()
    }
}

/// A builder for [`CreateDomainInput`](crate::operation::create_domain::CreateDomainInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateDomainInputBuilder {
    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) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl CreateDomainInputBuilder {
    /// A name that identifies the domain. Must be 3-63 characters: lowercase letters, numbers, and hyphens. It must begin and end with a letter or number and cannot contain consecutive hyphens.
    /// This field is required.
    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. Must be 3-63 characters: lowercase letters, numbers, and hyphens. It must begin and end with a letter or number and cannot contain consecutive hyphens.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// A name that identifies the domain. Must be 3-63 characters: lowercase letters, numbers, and hyphens. It must begin and end with a letter or number and cannot contain consecutive hyphens.
    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 to configure 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 to configure 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 to configure 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
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// The tags to associate with the domain.
    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
    }
    /// The tags to associate with the domain.
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// The tags to associate with the domain.
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// Idempotency token for safe retries. Repeated requests with the same token return the original result instead of creating a duplicate.
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`CreateDomainInput`](crate::operation::create_domain::CreateDomainInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_domain::CreateDomainInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_domain::CreateDomainInput {
            name: self.name,
            identity_providers: self.identity_providers,
            identity_provider_configuration: self.identity_provider_configuration,
            tags: self.tags,
            client_token: self.client_token,
        })
    }
}