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 UpdateDomainInput {
    /// The unique ID of the domain to update.
    pub domain_id: ::std::option::Option<::std::string::String>,
    /// A new name for the domain. Omit to leave unchanged. 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>,
}
impl UpdateDomainInput {
    /// The unique ID of the domain to update.
    pub fn domain_id(&self) -> ::std::option::Option<&str> {
        self.domain_id.as_deref()
    }
    /// A new name for the domain. Omit to leave unchanged. 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()
    }
}
impl UpdateDomainInput {
    /// Creates a new builder-style object to manufacture [`UpdateDomainInput`](crate::operation::update_domain::UpdateDomainInput).
    pub fn builder() -> crate::operation::update_domain::builders::UpdateDomainInputBuilder {
        crate::operation::update_domain::builders::UpdateDomainInputBuilder::default()
    }
}

/// A builder for [`UpdateDomainInput`](crate::operation::update_domain::UpdateDomainInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateDomainInputBuilder {
    pub(crate) domain_id: ::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>,
}
impl UpdateDomainInputBuilder {
    /// The unique ID of the domain to update.
    /// 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 to update.
    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 to update.
    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.domain_id
    }
    /// A new name for the domain. Omit to leave unchanged. 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(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// A new name for the domain. Omit to leave unchanged. 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 new name for the domain. Omit to leave unchanged. 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
    }
    /// Consumes the builder and constructs a [`UpdateDomainInput`](crate::operation::update_domain::UpdateDomainInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_domain::UpdateDomainInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_domain::UpdateDomainInput {
            domain_id: self.domain_id,
            name: self.name,
            identity_providers: self.identity_providers,
            identity_provider_configuration: self.identity_provider_configuration,
        })
    }
}