aws-sdk-cloudhsm 0.25.1

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>DescribeHsm</code> operation.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeHsmInput {
    /// <p>The ARN of the HSM. Either the <code>HsmArn</code> or the <code>SerialNumber</code> parameter must be specified.</p>
    #[doc(hidden)]
    pub hsm_arn: std::option::Option<std::string::String>,
    /// <p>The serial number of the HSM. Either the <code>HsmArn</code> or the <code>HsmSerialNumber</code> parameter must be specified.</p>
    #[doc(hidden)]
    pub hsm_serial_number: std::option::Option<std::string::String>,
}
impl DescribeHsmInput {
    /// <p>The ARN of the HSM. Either the <code>HsmArn</code> or the <code>SerialNumber</code> parameter must be specified.</p>
    pub fn hsm_arn(&self) -> std::option::Option<&str> {
        self.hsm_arn.as_deref()
    }
    /// <p>The serial number of the HSM. Either the <code>HsmArn</code> or the <code>HsmSerialNumber</code> parameter must be specified.</p>
    pub fn hsm_serial_number(&self) -> std::option::Option<&str> {
        self.hsm_serial_number.as_deref()
    }
}
impl DescribeHsmInput {
    /// Creates a new builder-style object to manufacture [`DescribeHsmInput`](crate::operation::describe_hsm::DescribeHsmInput).
    pub fn builder() -> crate::operation::describe_hsm::builders::DescribeHsmInputBuilder {
        crate::operation::describe_hsm::builders::DescribeHsmInputBuilder::default()
    }
}

/// A builder for [`DescribeHsmInput`](crate::operation::describe_hsm::DescribeHsmInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct DescribeHsmInputBuilder {
    pub(crate) hsm_arn: std::option::Option<std::string::String>,
    pub(crate) hsm_serial_number: std::option::Option<std::string::String>,
}
impl DescribeHsmInputBuilder {
    /// <p>The ARN of the HSM. Either the <code>HsmArn</code> or the <code>SerialNumber</code> parameter must be specified.</p>
    pub fn hsm_arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.hsm_arn = Some(input.into());
        self
    }
    /// <p>The ARN of the HSM. Either the <code>HsmArn</code> or the <code>SerialNumber</code> parameter must be specified.</p>
    pub fn set_hsm_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.hsm_arn = input;
        self
    }
    /// <p>The serial number of the HSM. Either the <code>HsmArn</code> or the <code>HsmSerialNumber</code> parameter must be specified.</p>
    pub fn hsm_serial_number(mut self, input: impl Into<std::string::String>) -> Self {
        self.hsm_serial_number = Some(input.into());
        self
    }
    /// <p>The serial number of the HSM. Either the <code>HsmArn</code> or the <code>HsmSerialNumber</code> parameter must be specified.</p>
    pub fn set_hsm_serial_number(
        mut self,
        input: std::option::Option<std::string::String>,
    ) -> Self {
        self.hsm_serial_number = input;
        self
    }
    /// Consumes the builder and constructs a [`DescribeHsmInput`](crate::operation::describe_hsm::DescribeHsmInput).
    pub fn build(
        self,
    ) -> Result<
        crate::operation::describe_hsm::DescribeHsmInput,
        aws_smithy_http::operation::error::BuildError,
    > {
        Ok(crate::operation::describe_hsm::DescribeHsmInput {
            hsm_arn: self.hsm_arn,
            hsm_serial_number: self.hsm_serial_number,
        })
    }
}