aws-sdk-cloudhsm 1.102.0

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>
    pub hapg_arn: ::std::option::Option<::std::string::String>,
    /// <p>The new label for the high-availability partition group.</p>
    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>
    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>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.partition_serial_list.is_none()`.
    pub fn partition_serial_list(&self) -> &[::std::string::String] {
        self.partition_serial_list.as_deref().unwrap_or_default()
    }
}
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).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
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>
    /// This field is required.
    pub fn hapg_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.hapg_arn = ::std::option::Option::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 ARN of the high-availability partition group to modify.</p>
    pub fn get_hapg_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.hapg_arn
    }
    /// <p>The new label for the high-availability partition group.</p>
    pub fn label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.label = ::std::option::Option::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
    }
    /// <p>The new label for the high-availability partition group.</p>
    pub fn get_label(&self) -> &::std::option::Option<::std::string::String> {
        &self.label
    }
    /// 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 ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.partition_serial_list.unwrap_or_default();
        v.push(input.into());
        self.partition_serial_list = ::std::option::Option::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
    }
    /// <p>The list of partition serial numbers to make members of the high-availability partition group.</p>
    pub fn get_partition_serial_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.partition_serial_list
    }
    /// Consumes the builder and constructs a [`ModifyHapgInput`](crate::operation::modify_hapg::ModifyHapgInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::modify_hapg::ModifyHapgInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::modify_hapg::ModifyHapgInput {
            hapg_arn: self.hapg_arn,
            label: self.label,
            partition_serial_list: self.partition_serial_list,
        })
    }
}