aws-sdk-redshift 1.106.0

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

/// <p></p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateHsmConfigurationInput {
    /// <p>The identifier to be assigned to the new Amazon Redshift HSM configuration.</p>
    pub hsm_configuration_identifier: ::std::option::Option<::std::string::String>,
    /// <p>A text description of the HSM configuration to be created.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The IP address that the Amazon Redshift cluster must use to access the HSM.</p>
    pub hsm_ip_address: ::std::option::Option<::std::string::String>,
    /// <p>The name of the partition in the HSM where the Amazon Redshift clusters will store their database encryption keys.</p>
    pub hsm_partition_name: ::std::option::Option<::std::string::String>,
    /// <p>The password required to access the HSM partition.</p>
    pub hsm_partition_password: ::std::option::Option<::std::string::String>,
    /// <p>The HSMs public certificate file. When using Cloud HSM, the file name is server.pem.</p>
    pub hsm_server_public_certificate: ::std::option::Option<::std::string::String>,
    /// <p>A list of tag instances.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateHsmConfigurationInput {
    /// <p>The identifier to be assigned to the new Amazon Redshift HSM configuration.</p>
    pub fn hsm_configuration_identifier(&self) -> ::std::option::Option<&str> {
        self.hsm_configuration_identifier.as_deref()
    }
    /// <p>A text description of the HSM configuration to be created.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The IP address that the Amazon Redshift cluster must use to access the HSM.</p>
    pub fn hsm_ip_address(&self) -> ::std::option::Option<&str> {
        self.hsm_ip_address.as_deref()
    }
    /// <p>The name of the partition in the HSM where the Amazon Redshift clusters will store their database encryption keys.</p>
    pub fn hsm_partition_name(&self) -> ::std::option::Option<&str> {
        self.hsm_partition_name.as_deref()
    }
    /// <p>The password required to access the HSM partition.</p>
    pub fn hsm_partition_password(&self) -> ::std::option::Option<&str> {
        self.hsm_partition_password.as_deref()
    }
    /// <p>The HSMs public certificate file. When using Cloud HSM, the file name is server.pem.</p>
    pub fn hsm_server_public_certificate(&self) -> ::std::option::Option<&str> {
        self.hsm_server_public_certificate.as_deref()
    }
    /// <p>A list of tag instances.</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 `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
}
impl CreateHsmConfigurationInput {
    /// Creates a new builder-style object to manufacture [`CreateHsmConfigurationInput`](crate::operation::create_hsm_configuration::CreateHsmConfigurationInput).
    pub fn builder() -> crate::operation::create_hsm_configuration::builders::CreateHsmConfigurationInputBuilder {
        crate::operation::create_hsm_configuration::builders::CreateHsmConfigurationInputBuilder::default()
    }
}

/// A builder for [`CreateHsmConfigurationInput`](crate::operation::create_hsm_configuration::CreateHsmConfigurationInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateHsmConfigurationInputBuilder {
    pub(crate) hsm_configuration_identifier: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) hsm_ip_address: ::std::option::Option<::std::string::String>,
    pub(crate) hsm_partition_name: ::std::option::Option<::std::string::String>,
    pub(crate) hsm_partition_password: ::std::option::Option<::std::string::String>,
    pub(crate) hsm_server_public_certificate: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateHsmConfigurationInputBuilder {
    /// <p>The identifier to be assigned to the new Amazon Redshift HSM configuration.</p>
    /// This field is required.
    pub fn hsm_configuration_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.hsm_configuration_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier to be assigned to the new Amazon Redshift HSM configuration.</p>
    pub fn set_hsm_configuration_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.hsm_configuration_identifier = input;
        self
    }
    /// <p>The identifier to be assigned to the new Amazon Redshift HSM configuration.</p>
    pub fn get_hsm_configuration_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.hsm_configuration_identifier
    }
    /// <p>A text description of the HSM configuration to be created.</p>
    /// This field is required.
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A text description of the HSM configuration to be created.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A text description of the HSM configuration to be created.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The IP address that the Amazon Redshift cluster must use to access the HSM.</p>
    /// This field is required.
    pub fn hsm_ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.hsm_ip_address = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The IP address that the Amazon Redshift cluster must use to access the HSM.</p>
    pub fn set_hsm_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.hsm_ip_address = input;
        self
    }
    /// <p>The IP address that the Amazon Redshift cluster must use to access the HSM.</p>
    pub fn get_hsm_ip_address(&self) -> &::std::option::Option<::std::string::String> {
        &self.hsm_ip_address
    }
    /// <p>The name of the partition in the HSM where the Amazon Redshift clusters will store their database encryption keys.</p>
    /// This field is required.
    pub fn hsm_partition_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.hsm_partition_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the partition in the HSM where the Amazon Redshift clusters will store their database encryption keys.</p>
    pub fn set_hsm_partition_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.hsm_partition_name = input;
        self
    }
    /// <p>The name of the partition in the HSM where the Amazon Redshift clusters will store their database encryption keys.</p>
    pub fn get_hsm_partition_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.hsm_partition_name
    }
    /// <p>The password required to access the HSM partition.</p>
    /// This field is required.
    pub fn hsm_partition_password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.hsm_partition_password = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The password required to access the HSM partition.</p>
    pub fn set_hsm_partition_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.hsm_partition_password = input;
        self
    }
    /// <p>The password required to access the HSM partition.</p>
    pub fn get_hsm_partition_password(&self) -> &::std::option::Option<::std::string::String> {
        &self.hsm_partition_password
    }
    /// <p>The HSMs public certificate file. When using Cloud HSM, the file name is server.pem.</p>
    /// This field is required.
    pub fn hsm_server_public_certificate(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.hsm_server_public_certificate = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The HSMs public certificate file. When using Cloud HSM, the file name is server.pem.</p>
    pub fn set_hsm_server_public_certificate(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.hsm_server_public_certificate = input;
        self
    }
    /// <p>The HSMs public certificate file. When using Cloud HSM, the file name is server.pem.</p>
    pub fn get_hsm_server_public_certificate(&self) -> &::std::option::Option<::std::string::String> {
        &self.hsm_server_public_certificate
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>A list of tag instances.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of tag instances.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>A list of tag instances.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateHsmConfigurationInput`](crate::operation::create_hsm_configuration::CreateHsmConfigurationInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_hsm_configuration::CreateHsmConfigurationInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::create_hsm_configuration::CreateHsmConfigurationInput {
            hsm_configuration_identifier: self.hsm_configuration_identifier,
            description: self.description,
            hsm_ip_address: self.hsm_ip_address,
            hsm_partition_name: self.hsm_partition_name,
            hsm_partition_password: self.hsm_partition_password,
            hsm_server_public_certificate: self.hsm_server_public_certificate,
            tags: self.tags,
        })
    }
}