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.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ModifyHapgInput {
    /// <p>The ARN of the high-availability partition group to modify.</p>
    #[doc(hidden)]
    pub hapg_arn: std::option::Option<std::string::String>,
    /// <p>The new label for the high-availability partition group.</p>
    #[doc(hidden)]
    pub label: std::option::Option<std::string::String>,
    /// <p>The list of partition serial numbers to make members of the high-availability partition group.</p>
    #[doc(hidden)]
    pub partition_serial_list: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl ModifyHapgInput {
    /// <p>The ARN of the high-availability partition group to modify.</p>
    pub fn hapg_arn(&self) -> std::option::Option<&str> {
        self.hapg_arn.as_deref()
    }
    /// <p>The new label for the high-availability partition group.</p>
    pub fn label(&self) -> std::option::Option<&str> {
        self.label.as_deref()
    }
    /// <p>The list of partition serial numbers to make members of the high-availability partition group.</p>
    pub fn partition_serial_list(&self) -> std::option::Option<&[std::string::String]> {
        self.partition_serial_list.as_deref()
    }
}
impl ModifyHapgInput {
    /// Creates a new builder-style object to manufacture [`ModifyHapgInput`](crate::operation::modify_hapg::ModifyHapgInput).
    pub fn builder() -> crate::operation::modify_hapg::builders::ModifyHapgInputBuilder {
        crate::operation::modify_hapg::builders::ModifyHapgInputBuilder::default()
    }
}

/// A builder for [`ModifyHapgInput`](crate::operation::modify_hapg::ModifyHapgInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct ModifyHapgInputBuilder {
    pub(crate) hapg_arn: std::option::Option<std::string::String>,
    pub(crate) label: std::option::Option<std::string::String>,
    pub(crate) partition_serial_list: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl ModifyHapgInputBuilder {
    /// <p>The ARN of the high-availability partition group to modify.</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 to modify.</p>
    pub fn set_hapg_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.hapg_arn = input;
        self
    }
    /// <p>The new 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 new 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
    }
    /// 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 to make members of 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 to make members of 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
    }
    /// Consumes the builder and constructs a [`ModifyHapgInput`](crate::operation::modify_hapg::ModifyHapgInput).
    pub fn build(
        self,
    ) -> Result<
        crate::operation::modify_hapg::ModifyHapgInput,
        aws_smithy_http::operation::error::BuildError,
    > {
        Ok(crate::operation::modify_hapg::ModifyHapgInput {
            hapg_arn: self.hapg_arn,
            label: self.label,
            partition_serial_list: self.partition_serial_list,
        })
    }
}