aws-sdk-directory 1.69.0

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

/// <p>Contains the inputs for the <code>CreateComputer</code> operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct CreateComputerInput {
    /// <p>The identifier of the directory in which to create the computer account.</p>
    pub directory_id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the computer account.</p>
    pub computer_name: ::std::option::Option<::std::string::String>,
    /// <p>A one-time password that is used to join the computer to the directory. You should generate a random, strong password to use for this parameter.</p>
    pub password: ::std::option::Option<::std::string::String>,
    /// <p>The fully-qualified distinguished name of the organizational unit to place the computer account in.</p>
    pub organizational_unit_distinguished_name: ::std::option::Option<::std::string::String>,
    /// <p>An array of <code>Attribute</code> objects that contain any LDAP attributes to apply to the computer account.</p>
    pub computer_attributes: ::std::option::Option<::std::vec::Vec<crate::types::Attribute>>,
}
impl CreateComputerInput {
    /// <p>The identifier of the directory in which to create the computer account.</p>
    pub fn directory_id(&self) -> ::std::option::Option<&str> {
        self.directory_id.as_deref()
    }
    /// <p>The name of the computer account.</p>
    pub fn computer_name(&self) -> ::std::option::Option<&str> {
        self.computer_name.as_deref()
    }
    /// <p>A one-time password that is used to join the computer to the directory. You should generate a random, strong password to use for this parameter.</p>
    pub fn password(&self) -> ::std::option::Option<&str> {
        self.password.as_deref()
    }
    /// <p>The fully-qualified distinguished name of the organizational unit to place the computer account in.</p>
    pub fn organizational_unit_distinguished_name(&self) -> ::std::option::Option<&str> {
        self.organizational_unit_distinguished_name.as_deref()
    }
    /// <p>An array of <code>Attribute</code> objects that contain any LDAP attributes to apply to the computer account.</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 `.computer_attributes.is_none()`.
    pub fn computer_attributes(&self) -> &[crate::types::Attribute] {
        self.computer_attributes.as_deref().unwrap_or_default()
    }
}
impl ::std::fmt::Debug for CreateComputerInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateComputerInput");
        formatter.field("directory_id", &self.directory_id);
        formatter.field("computer_name", &self.computer_name);
        formatter.field("password", &"*** Sensitive Data Redacted ***");
        formatter.field("organizational_unit_distinguished_name", &self.organizational_unit_distinguished_name);
        formatter.field("computer_attributes", &self.computer_attributes);
        formatter.finish()
    }
}
impl CreateComputerInput {
    /// Creates a new builder-style object to manufacture [`CreateComputerInput`](crate::operation::create_computer::CreateComputerInput).
    pub fn builder() -> crate::operation::create_computer::builders::CreateComputerInputBuilder {
        crate::operation::create_computer::builders::CreateComputerInputBuilder::default()
    }
}

/// A builder for [`CreateComputerInput`](crate::operation::create_computer::CreateComputerInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateComputerInputBuilder {
    pub(crate) directory_id: ::std::option::Option<::std::string::String>,
    pub(crate) computer_name: ::std::option::Option<::std::string::String>,
    pub(crate) password: ::std::option::Option<::std::string::String>,
    pub(crate) organizational_unit_distinguished_name: ::std::option::Option<::std::string::String>,
    pub(crate) computer_attributes: ::std::option::Option<::std::vec::Vec<crate::types::Attribute>>,
}
impl CreateComputerInputBuilder {
    /// <p>The identifier of the directory in which to create the computer account.</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 identifier of the directory in which to create the computer account.</p>
    pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.directory_id = input;
        self
    }
    /// <p>The identifier of the directory in which to create the computer account.</p>
    pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.directory_id
    }
    /// <p>The name of the computer account.</p>
    /// This field is required.
    pub fn computer_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.computer_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the computer account.</p>
    pub fn set_computer_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.computer_name = input;
        self
    }
    /// <p>The name of the computer account.</p>
    pub fn get_computer_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.computer_name
    }
    /// <p>A one-time password that is used to join the computer to the directory. You should generate a random, strong password to use for this parameter.</p>
    /// This field is required.
    pub fn password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.password = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A one-time password that is used to join the computer to the directory. You should generate a random, strong password to use for this parameter.</p>
    pub fn set_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.password = input;
        self
    }
    /// <p>A one-time password that is used to join the computer to the directory. You should generate a random, strong password to use for this parameter.</p>
    pub fn get_password(&self) -> &::std::option::Option<::std::string::String> {
        &self.password
    }
    /// <p>The fully-qualified distinguished name of the organizational unit to place the computer account in.</p>
    pub fn organizational_unit_distinguished_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.organizational_unit_distinguished_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The fully-qualified distinguished name of the organizational unit to place the computer account in.</p>
    pub fn set_organizational_unit_distinguished_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.organizational_unit_distinguished_name = input;
        self
    }
    /// <p>The fully-qualified distinguished name of the organizational unit to place the computer account in.</p>
    pub fn get_organizational_unit_distinguished_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.organizational_unit_distinguished_name
    }
    /// Appends an item to `computer_attributes`.
    ///
    /// To override the contents of this collection use [`set_computer_attributes`](Self::set_computer_attributes).
    ///
    /// <p>An array of <code>Attribute</code> objects that contain any LDAP attributes to apply to the computer account.</p>
    pub fn computer_attributes(mut self, input: crate::types::Attribute) -> Self {
        let mut v = self.computer_attributes.unwrap_or_default();
        v.push(input);
        self.computer_attributes = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of <code>Attribute</code> objects that contain any LDAP attributes to apply to the computer account.</p>
    pub fn set_computer_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Attribute>>) -> Self {
        self.computer_attributes = input;
        self
    }
    /// <p>An array of <code>Attribute</code> objects that contain any LDAP attributes to apply to the computer account.</p>
    pub fn get_computer_attributes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Attribute>> {
        &self.computer_attributes
    }
    /// Consumes the builder and constructs a [`CreateComputerInput`](crate::operation::create_computer::CreateComputerInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_computer::CreateComputerInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_computer::CreateComputerInput {
            directory_id: self.directory_id,
            computer_name: self.computer_name,
            password: self.password,
            organizational_unit_distinguished_name: self.organizational_unit_distinguished_name,
            computer_attributes: self.computer_attributes,
        })
    }
}
impl ::std::fmt::Debug for CreateComputerInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateComputerInputBuilder");
        formatter.field("directory_id", &self.directory_id);
        formatter.field("computer_name", &self.computer_name);
        formatter.field("password", &"*** Sensitive Data Redacted ***");
        formatter.field("organizational_unit_distinguished_name", &self.organizational_unit_distinguished_name);
        formatter.field("computer_attributes", &self.computer_attributes);
        formatter.finish()
    }
}