aws-sdk-directory 1.56.0

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

/// <p>Directory Service for Microsoft Active Directory allows you to configure trust relationships. For example, you can establish a trust between your Managed Microsoft AD directory, and your existing self-managed Microsoft Active Directory. This would allow you to provide users and groups access to resources in either domain, with a single set of credentials.</p>
/// <p>This action initiates the creation of the Amazon Web Services side of a trust relationship between an Managed Microsoft AD directory and an external domain.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct CreateTrustInput {
    /// <p>The Directory ID of the Managed Microsoft AD directory for which to establish the trust relationship.</p>
    pub directory_id: ::std::option::Option<::std::string::String>,
    /// <p>The Fully Qualified Domain Name (FQDN) of the external domain for which to create the trust relationship.</p>
    pub remote_domain_name: ::std::option::Option<::std::string::String>,
    /// <p>The trust password. The trust password must be the same password that was used when creating the trust relationship on the external domain.</p>
    pub trust_password: ::std::option::Option<::std::string::String>,
    /// <p>The direction of the trust relationship.</p>
    pub trust_direction: ::std::option::Option<crate::types::TrustDirection>,
    /// <p>The trust relationship type. <code>Forest</code> is the default.</p>
    pub trust_type: ::std::option::Option<crate::types::TrustType>,
    /// <p>The IP addresses of the remote DNS server associated with RemoteDomainName.</p>
    pub conditional_forwarder_ip_addrs: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Optional parameter to enable selective authentication for the trust.</p>
    pub selective_auth: ::std::option::Option<crate::types::SelectiveAuth>,
}
impl CreateTrustInput {
    /// <p>The Directory ID of the Managed Microsoft AD directory for which to establish the trust relationship.</p>
    pub fn directory_id(&self) -> ::std::option::Option<&str> {
        self.directory_id.as_deref()
    }
    /// <p>The Fully Qualified Domain Name (FQDN) of the external domain for which to create the trust relationship.</p>
    pub fn remote_domain_name(&self) -> ::std::option::Option<&str> {
        self.remote_domain_name.as_deref()
    }
    /// <p>The trust password. The trust password must be the same password that was used when creating the trust relationship on the external domain.</p>
    pub fn trust_password(&self) -> ::std::option::Option<&str> {
        self.trust_password.as_deref()
    }
    /// <p>The direction of the trust relationship.</p>
    pub fn trust_direction(&self) -> ::std::option::Option<&crate::types::TrustDirection> {
        self.trust_direction.as_ref()
    }
    /// <p>The trust relationship type. <code>Forest</code> is the default.</p>
    pub fn trust_type(&self) -> ::std::option::Option<&crate::types::TrustType> {
        self.trust_type.as_ref()
    }
    /// <p>The IP addresses of the remote DNS server associated with RemoteDomainName.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.conditional_forwarder_ip_addrs.is_none()`.
    pub fn conditional_forwarder_ip_addrs(&self) -> &[::std::string::String] {
        self.conditional_forwarder_ip_addrs.as_deref().unwrap_or_default()
    }
    /// <p>Optional parameter to enable selective authentication for the trust.</p>
    pub fn selective_auth(&self) -> ::std::option::Option<&crate::types::SelectiveAuth> {
        self.selective_auth.as_ref()
    }
}
impl ::std::fmt::Debug for CreateTrustInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateTrustInput");
        formatter.field("directory_id", &self.directory_id);
        formatter.field("remote_domain_name", &self.remote_domain_name);
        formatter.field("trust_password", &"*** Sensitive Data Redacted ***");
        formatter.field("trust_direction", &self.trust_direction);
        formatter.field("trust_type", &self.trust_type);
        formatter.field("conditional_forwarder_ip_addrs", &self.conditional_forwarder_ip_addrs);
        formatter.field("selective_auth", &self.selective_auth);
        formatter.finish()
    }
}
impl CreateTrustInput {
    /// Creates a new builder-style object to manufacture [`CreateTrustInput`](crate::operation::create_trust::CreateTrustInput).
    pub fn builder() -> crate::operation::create_trust::builders::CreateTrustInputBuilder {
        crate::operation::create_trust::builders::CreateTrustInputBuilder::default()
    }
}

/// A builder for [`CreateTrustInput`](crate::operation::create_trust::CreateTrustInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateTrustInputBuilder {
    pub(crate) directory_id: ::std::option::Option<::std::string::String>,
    pub(crate) remote_domain_name: ::std::option::Option<::std::string::String>,
    pub(crate) trust_password: ::std::option::Option<::std::string::String>,
    pub(crate) trust_direction: ::std::option::Option<crate::types::TrustDirection>,
    pub(crate) trust_type: ::std::option::Option<crate::types::TrustType>,
    pub(crate) conditional_forwarder_ip_addrs: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) selective_auth: ::std::option::Option<crate::types::SelectiveAuth>,
}
impl CreateTrustInputBuilder {
    /// <p>The Directory ID of the Managed Microsoft AD directory for which to establish the trust relationship.</p>
    /// This field is required.
    pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.directory_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Directory ID of the Managed Microsoft AD directory for which to establish the trust relationship.</p>
    pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.directory_id = input;
        self
    }
    /// <p>The Directory ID of the Managed Microsoft AD directory for which to establish the trust relationship.</p>
    pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.directory_id
    }
    /// <p>The Fully Qualified Domain Name (FQDN) of the external domain for which to create the trust relationship.</p>
    /// This field is required.
    pub fn remote_domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.remote_domain_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Fully Qualified Domain Name (FQDN) of the external domain for which to create the trust relationship.</p>
    pub fn set_remote_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.remote_domain_name = input;
        self
    }
    /// <p>The Fully Qualified Domain Name (FQDN) of the external domain for which to create the trust relationship.</p>
    pub fn get_remote_domain_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.remote_domain_name
    }
    /// <p>The trust password. The trust password must be the same password that was used when creating the trust relationship on the external domain.</p>
    /// This field is required.
    pub fn trust_password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.trust_password = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The trust password. The trust password must be the same password that was used when creating the trust relationship on the external domain.</p>
    pub fn set_trust_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.trust_password = input;
        self
    }
    /// <p>The trust password. The trust password must be the same password that was used when creating the trust relationship on the external domain.</p>
    pub fn get_trust_password(&self) -> &::std::option::Option<::std::string::String> {
        &self.trust_password
    }
    /// <p>The direction of the trust relationship.</p>
    /// This field is required.
    pub fn trust_direction(mut self, input: crate::types::TrustDirection) -> Self {
        self.trust_direction = ::std::option::Option::Some(input);
        self
    }
    /// <p>The direction of the trust relationship.</p>
    pub fn set_trust_direction(mut self, input: ::std::option::Option<crate::types::TrustDirection>) -> Self {
        self.trust_direction = input;
        self
    }
    /// <p>The direction of the trust relationship.</p>
    pub fn get_trust_direction(&self) -> &::std::option::Option<crate::types::TrustDirection> {
        &self.trust_direction
    }
    /// <p>The trust relationship type. <code>Forest</code> is the default.</p>
    pub fn trust_type(mut self, input: crate::types::TrustType) -> Self {
        self.trust_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The trust relationship type. <code>Forest</code> is the default.</p>
    pub fn set_trust_type(mut self, input: ::std::option::Option<crate::types::TrustType>) -> Self {
        self.trust_type = input;
        self
    }
    /// <p>The trust relationship type. <code>Forest</code> is the default.</p>
    pub fn get_trust_type(&self) -> &::std::option::Option<crate::types::TrustType> {
        &self.trust_type
    }
    /// Appends an item to `conditional_forwarder_ip_addrs`.
    ///
    /// To override the contents of this collection use [`set_conditional_forwarder_ip_addrs`](Self::set_conditional_forwarder_ip_addrs).
    ///
    /// <p>The IP addresses of the remote DNS server associated with RemoteDomainName.</p>
    pub fn conditional_forwarder_ip_addrs(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.conditional_forwarder_ip_addrs.unwrap_or_default();
        v.push(input.into());
        self.conditional_forwarder_ip_addrs = ::std::option::Option::Some(v);
        self
    }
    /// <p>The IP addresses of the remote DNS server associated with RemoteDomainName.</p>
    pub fn set_conditional_forwarder_ip_addrs(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.conditional_forwarder_ip_addrs = input;
        self
    }
    /// <p>The IP addresses of the remote DNS server associated with RemoteDomainName.</p>
    pub fn get_conditional_forwarder_ip_addrs(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.conditional_forwarder_ip_addrs
    }
    /// <p>Optional parameter to enable selective authentication for the trust.</p>
    pub fn selective_auth(mut self, input: crate::types::SelectiveAuth) -> Self {
        self.selective_auth = ::std::option::Option::Some(input);
        self
    }
    /// <p>Optional parameter to enable selective authentication for the trust.</p>
    pub fn set_selective_auth(mut self, input: ::std::option::Option<crate::types::SelectiveAuth>) -> Self {
        self.selective_auth = input;
        self
    }
    /// <p>Optional parameter to enable selective authentication for the trust.</p>
    pub fn get_selective_auth(&self) -> &::std::option::Option<crate::types::SelectiveAuth> {
        &self.selective_auth
    }
    /// Consumes the builder and constructs a [`CreateTrustInput`](crate::operation::create_trust::CreateTrustInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::create_trust::CreateTrustInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_trust::CreateTrustInput {
            directory_id: self.directory_id,
            remote_domain_name: self.remote_domain_name,
            trust_password: self.trust_password,
            trust_direction: self.trust_direction,
            trust_type: self.trust_type,
            conditional_forwarder_ip_addrs: self.conditional_forwarder_ip_addrs,
            selective_auth: self.selective_auth,
        })
    }
}
impl ::std::fmt::Debug for CreateTrustInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateTrustInputBuilder");
        formatter.field("directory_id", &self.directory_id);
        formatter.field("remote_domain_name", &self.remote_domain_name);
        formatter.field("trust_password", &"*** Sensitive Data Redacted ***");
        formatter.field("trust_direction", &self.trust_direction);
        formatter.field("trust_type", &self.trust_type);
        formatter.field("conditional_forwarder_ip_addrs", &self.conditional_forwarder_ip_addrs);
        formatter.field("selective_auth", &self.selective_auth);
        formatter.finish()
    }
}