aws-sdk-cloudhsm 1.57.0

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

/// <p>Contains the inputs for the <code>CreateHsm</code> operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateHsmInput {
    /// <p>The identifier of the subnet in your VPC in which to place the HSM.</p>
    pub subnet_id: ::std::option::Option<::std::string::String>,
    /// <p>The SSH public key to install on the HSM.</p>
    pub ssh_key: ::std::option::Option<::std::string::String>,
    /// <p>The IP address to assign to the HSM's ENI.</p>
    /// <p>If an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the subnet.</p>
    pub eni_ip: ::std::option::Option<::std::string::String>,
    /// <p>The ARN of an IAM role to enable the AWS CloudHSM service to allocate an ENI on your behalf.</p>
    pub iam_role_arn: ::std::option::Option<::std::string::String>,
    /// <p>The external ID from <code>IamRoleArn</code>, if present.</p>
    pub external_id: ::std::option::Option<::std::string::String>,
    /// <p>Specifies the type of subscription for the HSM.</p>
    /// <ul>
    /// <li>
    /// <p><b>PRODUCTION</b> - The HSM is being used in a production environment.</p></li>
    /// <li>
    /// <p><b>TRIAL</b> - The HSM is being used in a product trial.</p></li>
    /// </ul>
    pub subscription_type: ::std::option::Option<crate::types::SubscriptionType>,
    /// <p>A user-defined token to ensure idempotence. Subsequent calls to this operation with the same token will be ignored.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>The IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
    pub syslog_ip: ::std::option::Option<::std::string::String>,
}
impl CreateHsmInput {
    /// <p>The identifier of the subnet in your VPC in which to place the HSM.</p>
    pub fn subnet_id(&self) -> ::std::option::Option<&str> {
        self.subnet_id.as_deref()
    }
    /// <p>The SSH public key to install on the HSM.</p>
    pub fn ssh_key(&self) -> ::std::option::Option<&str> {
        self.ssh_key.as_deref()
    }
    /// <p>The IP address to assign to the HSM's ENI.</p>
    /// <p>If an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the subnet.</p>
    pub fn eni_ip(&self) -> ::std::option::Option<&str> {
        self.eni_ip.as_deref()
    }
    /// <p>The ARN of an IAM role to enable the AWS CloudHSM service to allocate an ENI on your behalf.</p>
    pub fn iam_role_arn(&self) -> ::std::option::Option<&str> {
        self.iam_role_arn.as_deref()
    }
    /// <p>The external ID from <code>IamRoleArn</code>, if present.</p>
    pub fn external_id(&self) -> ::std::option::Option<&str> {
        self.external_id.as_deref()
    }
    /// <p>Specifies the type of subscription for the HSM.</p>
    /// <ul>
    /// <li>
    /// <p><b>PRODUCTION</b> - The HSM is being used in a production environment.</p></li>
    /// <li>
    /// <p><b>TRIAL</b> - The HSM is being used in a product trial.</p></li>
    /// </ul>
    pub fn subscription_type(&self) -> ::std::option::Option<&crate::types::SubscriptionType> {
        self.subscription_type.as_ref()
    }
    /// <p>A user-defined token to ensure idempotence. Subsequent calls to this operation with the same token will be ignored.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>The IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
    pub fn syslog_ip(&self) -> ::std::option::Option<&str> {
        self.syslog_ip.as_deref()
    }
}
impl CreateHsmInput {
    /// Creates a new builder-style object to manufacture [`CreateHsmInput`](crate::operation::create_hsm::CreateHsmInput).
    pub fn builder() -> crate::operation::create_hsm::builders::CreateHsmInputBuilder {
        crate::operation::create_hsm::builders::CreateHsmInputBuilder::default()
    }
}

/// A builder for [`CreateHsmInput`](crate::operation::create_hsm::CreateHsmInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateHsmInputBuilder {
    pub(crate) subnet_id: ::std::option::Option<::std::string::String>,
    pub(crate) ssh_key: ::std::option::Option<::std::string::String>,
    pub(crate) eni_ip: ::std::option::Option<::std::string::String>,
    pub(crate) iam_role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) external_id: ::std::option::Option<::std::string::String>,
    pub(crate) subscription_type: ::std::option::Option<crate::types::SubscriptionType>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) syslog_ip: ::std::option::Option<::std::string::String>,
}
impl CreateHsmInputBuilder {
    /// <p>The identifier of the subnet in your VPC in which to place the HSM.</p>
    /// This field is required.
    pub fn subnet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.subnet_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the subnet in your VPC in which to place the HSM.</p>
    pub fn set_subnet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.subnet_id = input;
        self
    }
    /// <p>The identifier of the subnet in your VPC in which to place the HSM.</p>
    pub fn get_subnet_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.subnet_id
    }
    /// <p>The SSH public key to install on the HSM.</p>
    /// This field is required.
    pub fn ssh_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.ssh_key = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The SSH public key to install on the HSM.</p>
    pub fn set_ssh_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.ssh_key = input;
        self
    }
    /// <p>The SSH public key to install on the HSM.</p>
    pub fn get_ssh_key(&self) -> &::std::option::Option<::std::string::String> {
        &self.ssh_key
    }
    /// <p>The IP address to assign to the HSM's ENI.</p>
    /// <p>If an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the subnet.</p>
    pub fn eni_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.eni_ip = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The IP address to assign to the HSM's ENI.</p>
    /// <p>If an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the subnet.</p>
    pub fn set_eni_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.eni_ip = input;
        self
    }
    /// <p>The IP address to assign to the HSM's ENI.</p>
    /// <p>If an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the subnet.</p>
    pub fn get_eni_ip(&self) -> &::std::option::Option<::std::string::String> {
        &self.eni_ip
    }
    /// <p>The ARN of an IAM role to enable the AWS CloudHSM service to allocate an ENI on your behalf.</p>
    /// This field is required.
    pub fn iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.iam_role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of an IAM role to enable the AWS CloudHSM service to allocate an ENI on your behalf.</p>
    pub fn set_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.iam_role_arn = input;
        self
    }
    /// <p>The ARN of an IAM role to enable the AWS CloudHSM service to allocate an ENI on your behalf.</p>
    pub fn get_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.iam_role_arn
    }
    /// <p>The external ID from <code>IamRoleArn</code>, if present.</p>
    pub fn external_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.external_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The external ID from <code>IamRoleArn</code>, if present.</p>
    pub fn set_external_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.external_id = input;
        self
    }
    /// <p>The external ID from <code>IamRoleArn</code>, if present.</p>
    pub fn get_external_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.external_id
    }
    /// <p>Specifies the type of subscription for the HSM.</p>
    /// <ul>
    /// <li>
    /// <p><b>PRODUCTION</b> - The HSM is being used in a production environment.</p></li>
    /// <li>
    /// <p><b>TRIAL</b> - The HSM is being used in a product trial.</p></li>
    /// </ul>
    /// This field is required.
    pub fn subscription_type(mut self, input: crate::types::SubscriptionType) -> Self {
        self.subscription_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies the type of subscription for the HSM.</p>
    /// <ul>
    /// <li>
    /// <p><b>PRODUCTION</b> - The HSM is being used in a production environment.</p></li>
    /// <li>
    /// <p><b>TRIAL</b> - The HSM is being used in a product trial.</p></li>
    /// </ul>
    pub fn set_subscription_type(mut self, input: ::std::option::Option<crate::types::SubscriptionType>) -> Self {
        self.subscription_type = input;
        self
    }
    /// <p>Specifies the type of subscription for the HSM.</p>
    /// <ul>
    /// <li>
    /// <p><b>PRODUCTION</b> - The HSM is being used in a production environment.</p></li>
    /// <li>
    /// <p><b>TRIAL</b> - The HSM is being used in a product trial.</p></li>
    /// </ul>
    pub fn get_subscription_type(&self) -> &::std::option::Option<crate::types::SubscriptionType> {
        &self.subscription_type
    }
    /// <p>A user-defined token to ensure idempotence. Subsequent calls to this operation with the same token will be ignored.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A user-defined token to ensure idempotence. Subsequent calls to this operation with the same token will be ignored.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A user-defined token to ensure idempotence. Subsequent calls to this operation with the same token will be ignored.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>The IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
    pub fn syslog_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.syslog_ip = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
    pub fn set_syslog_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.syslog_ip = input;
        self
    }
    /// <p>The IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
    pub fn get_syslog_ip(&self) -> &::std::option::Option<::std::string::String> {
        &self.syslog_ip
    }
    /// Consumes the builder and constructs a [`CreateHsmInput`](crate::operation::create_hsm::CreateHsmInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::create_hsm::CreateHsmInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_hsm::CreateHsmInput {
            subnet_id: self.subnet_id,
            ssh_key: self.ssh_key,
            eni_ip: self.eni_ip,
            iam_role_arn: self.iam_role_arn,
            external_id: self.external_id,
            subscription_type: self.subscription_type,
            client_token: self.client_token,
            syslog_ip: self.syslog_ip,
        })
    }
}