aws-sdk-cloudhsm 0.26.0

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

/// <p>Contains the output of the <code>DescribeHapg</code> action.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeHapgOutput {
    /// <p>The ARN of the high-availability partition group.</p>
    #[doc(hidden)]
    pub hapg_arn: std::option::Option<std::string::String>,
    /// <p>The serial number of the high-availability partition group.</p>
    #[doc(hidden)]
    pub hapg_serial: std::option::Option<std::string::String>,
    /// <p></p>
    #[doc(hidden)]
    pub hsms_last_action_failed: std::option::Option<std::vec::Vec<std::string::String>>,
    /// <p></p>
    #[doc(hidden)]
    pub hsms_pending_deletion: std::option::Option<std::vec::Vec<std::string::String>>,
    /// <p></p>
    #[doc(hidden)]
    pub hsms_pending_registration: std::option::Option<std::vec::Vec<std::string::String>>,
    /// <p>The label for the high-availability partition group.</p>
    #[doc(hidden)]
    pub label: std::option::Option<std::string::String>,
    /// <p>The date and time the high-availability partition group was last modified.</p>
    #[doc(hidden)]
    pub last_modified_timestamp: std::option::Option<std::string::String>,
    /// <p>The list of partition serial numbers that belong to the high-availability partition group.</p>
    #[doc(hidden)]
    pub partition_serial_list: std::option::Option<std::vec::Vec<std::string::String>>,
    /// <p>The state of the high-availability partition group.</p>
    #[doc(hidden)]
    pub state: std::option::Option<crate::types::CloudHsmObjectState>,
    _request_id: Option<String>,
}
impl DescribeHapgOutput {
    /// <p>The ARN of the high-availability partition group.</p>
    pub fn hapg_arn(&self) -> std::option::Option<&str> {
        self.hapg_arn.as_deref()
    }
    /// <p>The serial number of the high-availability partition group.</p>
    pub fn hapg_serial(&self) -> std::option::Option<&str> {
        self.hapg_serial.as_deref()
    }
    /// <p></p>
    pub fn hsms_last_action_failed(&self) -> std::option::Option<&[std::string::String]> {
        self.hsms_last_action_failed.as_deref()
    }
    /// <p></p>
    pub fn hsms_pending_deletion(&self) -> std::option::Option<&[std::string::String]> {
        self.hsms_pending_deletion.as_deref()
    }
    /// <p></p>
    pub fn hsms_pending_registration(&self) -> std::option::Option<&[std::string::String]> {
        self.hsms_pending_registration.as_deref()
    }
    /// <p>The label for the high-availability partition group.</p>
    pub fn label(&self) -> std::option::Option<&str> {
        self.label.as_deref()
    }
    /// <p>The date and time the high-availability partition group was last modified.</p>
    pub fn last_modified_timestamp(&self) -> std::option::Option<&str> {
        self.last_modified_timestamp.as_deref()
    }
    /// <p>The list of partition serial numbers that belong to the high-availability partition group.</p>
    pub fn partition_serial_list(&self) -> std::option::Option<&[std::string::String]> {
        self.partition_serial_list.as_deref()
    }
    /// <p>The state of the high-availability partition group.</p>
    pub fn state(&self) -> std::option::Option<&crate::types::CloudHsmObjectState> {
        self.state.as_ref()
    }
}
impl aws_http::request_id::RequestId for DescribeHapgOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribeHapgOutput {
    /// Creates a new builder-style object to manufacture [`DescribeHapgOutput`](crate::operation::describe_hapg::DescribeHapgOutput).
    pub fn builder() -> crate::operation::describe_hapg::builders::DescribeHapgOutputBuilder {
        crate::operation::describe_hapg::builders::DescribeHapgOutputBuilder::default()
    }
}

/// A builder for [`DescribeHapgOutput`](crate::operation::describe_hapg::DescribeHapgOutput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct DescribeHapgOutputBuilder {
    pub(crate) hapg_arn: std::option::Option<std::string::String>,
    pub(crate) hapg_serial: std::option::Option<std::string::String>,
    pub(crate) hsms_last_action_failed: std::option::Option<std::vec::Vec<std::string::String>>,
    pub(crate) hsms_pending_deletion: std::option::Option<std::vec::Vec<std::string::String>>,
    pub(crate) hsms_pending_registration: std::option::Option<std::vec::Vec<std::string::String>>,
    pub(crate) label: std::option::Option<std::string::String>,
    pub(crate) last_modified_timestamp: std::option::Option<std::string::String>,
    pub(crate) partition_serial_list: std::option::Option<std::vec::Vec<std::string::String>>,
    pub(crate) state: std::option::Option<crate::types::CloudHsmObjectState>,
    _request_id: Option<String>,
}
impl DescribeHapgOutputBuilder {
    /// <p>The ARN of the high-availability partition group.</p>
    pub fn hapg_arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.hapg_arn = Some(input.into());
        self
    }
    /// <p>The ARN of the high-availability partition group.</p>
    pub fn set_hapg_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.hapg_arn = input;
        self
    }
    /// <p>The serial number of the high-availability partition group.</p>
    pub fn hapg_serial(mut self, input: impl Into<std::string::String>) -> Self {
        self.hapg_serial = Some(input.into());
        self
    }
    /// <p>The serial number of the high-availability partition group.</p>
    pub fn set_hapg_serial(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.hapg_serial = input;
        self
    }
    /// Appends an item to `hsms_last_action_failed`.
    ///
    /// To override the contents of this collection use [`set_hsms_last_action_failed`](Self::set_hsms_last_action_failed).
    ///
    /// <p></p>
    pub fn hsms_last_action_failed(mut self, input: impl Into<std::string::String>) -> Self {
        let mut v = self.hsms_last_action_failed.unwrap_or_default();
        v.push(input.into());
        self.hsms_last_action_failed = Some(v);
        self
    }
    /// <p></p>
    pub fn set_hsms_last_action_failed(
        mut self,
        input: std::option::Option<std::vec::Vec<std::string::String>>,
    ) -> Self {
        self.hsms_last_action_failed = input;
        self
    }
    /// Appends an item to `hsms_pending_deletion`.
    ///
    /// To override the contents of this collection use [`set_hsms_pending_deletion`](Self::set_hsms_pending_deletion).
    ///
    /// <p></p>
    pub fn hsms_pending_deletion(mut self, input: impl Into<std::string::String>) -> Self {
        let mut v = self.hsms_pending_deletion.unwrap_or_default();
        v.push(input.into());
        self.hsms_pending_deletion = Some(v);
        self
    }
    /// <p></p>
    pub fn set_hsms_pending_deletion(
        mut self,
        input: std::option::Option<std::vec::Vec<std::string::String>>,
    ) -> Self {
        self.hsms_pending_deletion = input;
        self
    }
    /// Appends an item to `hsms_pending_registration`.
    ///
    /// To override the contents of this collection use [`set_hsms_pending_registration`](Self::set_hsms_pending_registration).
    ///
    /// <p></p>
    pub fn hsms_pending_registration(mut self, input: impl Into<std::string::String>) -> Self {
        let mut v = self.hsms_pending_registration.unwrap_or_default();
        v.push(input.into());
        self.hsms_pending_registration = Some(v);
        self
    }
    /// <p></p>
    pub fn set_hsms_pending_registration(
        mut self,
        input: std::option::Option<std::vec::Vec<std::string::String>>,
    ) -> Self {
        self.hsms_pending_registration = input;
        self
    }
    /// <p>The label for the high-availability partition group.</p>
    pub fn label(mut self, input: impl Into<std::string::String>) -> Self {
        self.label = Some(input.into());
        self
    }
    /// <p>The label for the high-availability partition group.</p>
    pub fn set_label(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.label = input;
        self
    }
    /// <p>The date and time the high-availability partition group was last modified.</p>
    pub fn last_modified_timestamp(mut self, input: impl Into<std::string::String>) -> Self {
        self.last_modified_timestamp = Some(input.into());
        self
    }
    /// <p>The date and time the high-availability partition group was last modified.</p>
    pub fn set_last_modified_timestamp(
        mut self,
        input: std::option::Option<std::string::String>,
    ) -> Self {
        self.last_modified_timestamp = input;
        self
    }
    /// Appends an item to `partition_serial_list`.
    ///
    /// To override the contents of this collection use [`set_partition_serial_list`](Self::set_partition_serial_list).
    ///
    /// <p>The list of partition serial numbers that belong to the high-availability partition group.</p>
    pub fn partition_serial_list(mut self, input: impl Into<std::string::String>) -> Self {
        let mut v = self.partition_serial_list.unwrap_or_default();
        v.push(input.into());
        self.partition_serial_list = Some(v);
        self
    }
    /// <p>The list of partition serial numbers that belong to the high-availability partition group.</p>
    pub fn set_partition_serial_list(
        mut self,
        input: std::option::Option<std::vec::Vec<std::string::String>>,
    ) -> Self {
        self.partition_serial_list = input;
        self
    }
    /// <p>The state of the high-availability partition group.</p>
    pub fn state(mut self, input: crate::types::CloudHsmObjectState) -> Self {
        self.state = Some(input);
        self
    }
    /// <p>The state of the high-availability partition group.</p>
    pub fn set_state(
        mut self,
        input: std::option::Option<crate::types::CloudHsmObjectState>,
    ) -> Self {
        self.state = input;
        self
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`DescribeHapgOutput`](crate::operation::describe_hapg::DescribeHapgOutput).
    pub fn build(self) -> crate::operation::describe_hapg::DescribeHapgOutput {
        crate::operation::describe_hapg::DescribeHapgOutput {
            hapg_arn: self.hapg_arn,
            hapg_serial: self.hapg_serial,
            hsms_last_action_failed: self.hsms_last_action_failed,
            hsms_pending_deletion: self.hsms_pending_deletion,
            hsms_pending_registration: self.hsms_pending_registration,
            label: self.label,
            last_modified_timestamp: self.last_modified_timestamp,
            partition_serial_list: self.partition_serial_list,
            state: self.state,
            _request_id: self._request_id,
        }
    }
}