aws_sdk_cloudhsm/operation/modify_hapg/
_modify_hapg_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct ModifyHapgInput {
6    /// <p>The ARN of the high-availability partition group to modify.</p>
7    pub hapg_arn: ::std::option::Option<::std::string::String>,
8    /// <p>The new label for the high-availability partition group.</p>
9    pub label: ::std::option::Option<::std::string::String>,
10    /// <p>The list of partition serial numbers to make members of the high-availability partition group.</p>
11    pub partition_serial_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12}
13impl ModifyHapgInput {
14    /// <p>The ARN of the high-availability partition group to modify.</p>
15    pub fn hapg_arn(&self) -> ::std::option::Option<&str> {
16        self.hapg_arn.as_deref()
17    }
18    /// <p>The new label for the high-availability partition group.</p>
19    pub fn label(&self) -> ::std::option::Option<&str> {
20        self.label.as_deref()
21    }
22    /// <p>The list of partition serial numbers to make members of the high-availability partition group.</p>
23    ///
24    /// 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()`.
25    pub fn partition_serial_list(&self) -> &[::std::string::String] {
26        self.partition_serial_list.as_deref().unwrap_or_default()
27    }
28}
29impl ModifyHapgInput {
30    /// Creates a new builder-style object to manufacture [`ModifyHapgInput`](crate::operation::modify_hapg::ModifyHapgInput).
31    pub fn builder() -> crate::operation::modify_hapg::builders::ModifyHapgInputBuilder {
32        crate::operation::modify_hapg::builders::ModifyHapgInputBuilder::default()
33    }
34}
35
36/// A builder for [`ModifyHapgInput`](crate::operation::modify_hapg::ModifyHapgInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct ModifyHapgInputBuilder {
40    pub(crate) hapg_arn: ::std::option::Option<::std::string::String>,
41    pub(crate) label: ::std::option::Option<::std::string::String>,
42    pub(crate) partition_serial_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
43}
44impl ModifyHapgInputBuilder {
45    /// <p>The ARN of the high-availability partition group to modify.</p>
46    /// This field is required.
47    pub fn hapg_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.hapg_arn = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>The ARN of the high-availability partition group to modify.</p>
52    pub fn set_hapg_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.hapg_arn = input;
54        self
55    }
56    /// <p>The ARN of the high-availability partition group to modify.</p>
57    pub fn get_hapg_arn(&self) -> &::std::option::Option<::std::string::String> {
58        &self.hapg_arn
59    }
60    /// <p>The new label for the high-availability partition group.</p>
61    pub fn label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.label = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The new label for the high-availability partition group.</p>
66    pub fn set_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.label = input;
68        self
69    }
70    /// <p>The new label for the high-availability partition group.</p>
71    pub fn get_label(&self) -> &::std::option::Option<::std::string::String> {
72        &self.label
73    }
74    /// Appends an item to `partition_serial_list`.
75    ///
76    /// To override the contents of this collection use [`set_partition_serial_list`](Self::set_partition_serial_list).
77    ///
78    /// <p>The list of partition serial numbers to make members of the high-availability partition group.</p>
79    pub fn partition_serial_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80        let mut v = self.partition_serial_list.unwrap_or_default();
81        v.push(input.into());
82        self.partition_serial_list = ::std::option::Option::Some(v);
83        self
84    }
85    /// <p>The list of partition serial numbers to make members of the high-availability partition group.</p>
86    pub fn set_partition_serial_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
87        self.partition_serial_list = input;
88        self
89    }
90    /// <p>The list of partition serial numbers to make members of the high-availability partition group.</p>
91    pub fn get_partition_serial_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
92        &self.partition_serial_list
93    }
94    /// Consumes the builder and constructs a [`ModifyHapgInput`](crate::operation::modify_hapg::ModifyHapgInput).
95    pub fn build(self) -> ::std::result::Result<crate::operation::modify_hapg::ModifyHapgInput, ::aws_smithy_types::error::operation::BuildError> {
96        ::std::result::Result::Ok(crate::operation::modify_hapg::ModifyHapgInput {
97            hapg_arn: self.hapg_arn,
98            label: self.label,
99            partition_serial_list: self.partition_serial_list,
100        })
101    }
102}