aws-sdk-securityagent 1.2.0

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

/// <p>Input for creating a new target domain.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateTargetDomainInput {
    /// <p>The domain name to register as a target domain.</p>
    pub target_domain_name: ::std::option::Option<::std::string::String>,
    /// <p>The method to use for verifying domain ownership. Valid values are DNS_TXT, HTTP_ROUTE, and PRIVATE_VPC.</p>
    pub verification_method: ::std::option::Option<crate::types::DomainVerificationMethod>,
    /// <p>The tags to associate with the target domain.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateTargetDomainInput {
    /// <p>The domain name to register as a target domain.</p>
    pub fn target_domain_name(&self) -> ::std::option::Option<&str> {
        self.target_domain_name.as_deref()
    }
    /// <p>The method to use for verifying domain ownership. Valid values are DNS_TXT, HTTP_ROUTE, and PRIVATE_VPC.</p>
    pub fn verification_method(&self) -> ::std::option::Option<&crate::types::DomainVerificationMethod> {
        self.verification_method.as_ref()
    }
    /// <p>The tags to associate with the target domain.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl CreateTargetDomainInput {
    /// Creates a new builder-style object to manufacture [`CreateTargetDomainInput`](crate::operation::create_target_domain::CreateTargetDomainInput).
    pub fn builder() -> crate::operation::create_target_domain::builders::CreateTargetDomainInputBuilder {
        crate::operation::create_target_domain::builders::CreateTargetDomainInputBuilder::default()
    }
}

/// A builder for [`CreateTargetDomainInput`](crate::operation::create_target_domain::CreateTargetDomainInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateTargetDomainInputBuilder {
    pub(crate) target_domain_name: ::std::option::Option<::std::string::String>,
    pub(crate) verification_method: ::std::option::Option<crate::types::DomainVerificationMethod>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateTargetDomainInputBuilder {
    /// <p>The domain name to register as a target domain.</p>
    /// This field is required.
    pub fn target_domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.target_domain_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The domain name to register as a target domain.</p>
    pub fn set_target_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.target_domain_name = input;
        self
    }
    /// <p>The domain name to register as a target domain.</p>
    pub fn get_target_domain_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.target_domain_name
    }
    /// <p>The method to use for verifying domain ownership. Valid values are DNS_TXT, HTTP_ROUTE, and PRIVATE_VPC.</p>
    /// This field is required.
    pub fn verification_method(mut self, input: crate::types::DomainVerificationMethod) -> Self {
        self.verification_method = ::std::option::Option::Some(input);
        self
    }
    /// <p>The method to use for verifying domain ownership. Valid values are DNS_TXT, HTTP_ROUTE, and PRIVATE_VPC.</p>
    pub fn set_verification_method(mut self, input: ::std::option::Option<crate::types::DomainVerificationMethod>) -> Self {
        self.verification_method = input;
        self
    }
    /// <p>The method to use for verifying domain ownership. Valid values are DNS_TXT, HTTP_ROUTE, and PRIVATE_VPC.</p>
    pub fn get_verification_method(&self) -> &::std::option::Option<crate::types::DomainVerificationMethod> {
        &self.verification_method
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags to associate with the target domain.</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 to associate with the target domain.</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 to associate with the target domain.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateTargetDomainInput`](crate::operation::create_target_domain::CreateTargetDomainInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_target_domain::CreateTargetDomainInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_target_domain::CreateTargetDomainInput {
            target_domain_name: self.target_domain_name,
            verification_method: self.verification_method,
            tags: self.tags,
        })
    }
}