aws_sdk_cloudhsm/operation/describe_hapg/
_describe_hapg_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the output of the <code>DescribeHapg</code> action.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DescribeHapgOutput {
7    /// <p>The ARN of the high-availability partition group.</p>
8    pub hapg_arn: ::std::option::Option<::std::string::String>,
9    /// <p>The serial number of the high-availability partition group.</p>
10    pub hapg_serial: ::std::option::Option<::std::string::String>,
11    /// <p></p>
12    pub hsms_last_action_failed: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
13    /// <p></p>
14    pub hsms_pending_deletion: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
15    /// <p></p>
16    pub hsms_pending_registration: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
17    /// <p>The label for the high-availability partition group.</p>
18    pub label: ::std::option::Option<::std::string::String>,
19    /// <p>The date and time the high-availability partition group was last modified.</p>
20    pub last_modified_timestamp: ::std::option::Option<::std::string::String>,
21    /// <p>The list of partition serial numbers that belong to the high-availability partition group.</p>
22    pub partition_serial_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
23    /// <p>The state of the high-availability partition group.</p>
24    pub state: ::std::option::Option<crate::types::CloudHsmObjectState>,
25    _request_id: Option<String>,
26}
27impl DescribeHapgOutput {
28    /// <p>The ARN of the high-availability partition group.</p>
29    pub fn hapg_arn(&self) -> ::std::option::Option<&str> {
30        self.hapg_arn.as_deref()
31    }
32    /// <p>The serial number of the high-availability partition group.</p>
33    pub fn hapg_serial(&self) -> ::std::option::Option<&str> {
34        self.hapg_serial.as_deref()
35    }
36    /// <p></p>
37    ///
38    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.hsms_last_action_failed.is_none()`.
39    pub fn hsms_last_action_failed(&self) -> &[::std::string::String] {
40        self.hsms_last_action_failed.as_deref().unwrap_or_default()
41    }
42    /// <p></p>
43    ///
44    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.hsms_pending_deletion.is_none()`.
45    pub fn hsms_pending_deletion(&self) -> &[::std::string::String] {
46        self.hsms_pending_deletion.as_deref().unwrap_or_default()
47    }
48    /// <p></p>
49    ///
50    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.hsms_pending_registration.is_none()`.
51    pub fn hsms_pending_registration(&self) -> &[::std::string::String] {
52        self.hsms_pending_registration.as_deref().unwrap_or_default()
53    }
54    /// <p>The label for the high-availability partition group.</p>
55    pub fn label(&self) -> ::std::option::Option<&str> {
56        self.label.as_deref()
57    }
58    /// <p>The date and time the high-availability partition group was last modified.</p>
59    pub fn last_modified_timestamp(&self) -> ::std::option::Option<&str> {
60        self.last_modified_timestamp.as_deref()
61    }
62    /// <p>The list of partition serial numbers that belong to the high-availability partition group.</p>
63    ///
64    /// 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()`.
65    pub fn partition_serial_list(&self) -> &[::std::string::String] {
66        self.partition_serial_list.as_deref().unwrap_or_default()
67    }
68    /// <p>The state of the high-availability partition group.</p>
69    pub fn state(&self) -> ::std::option::Option<&crate::types::CloudHsmObjectState> {
70        self.state.as_ref()
71    }
72}
73impl ::aws_types::request_id::RequestId for DescribeHapgOutput {
74    fn request_id(&self) -> Option<&str> {
75        self._request_id.as_deref()
76    }
77}
78impl DescribeHapgOutput {
79    /// Creates a new builder-style object to manufacture [`DescribeHapgOutput`](crate::operation::describe_hapg::DescribeHapgOutput).
80    pub fn builder() -> crate::operation::describe_hapg::builders::DescribeHapgOutputBuilder {
81        crate::operation::describe_hapg::builders::DescribeHapgOutputBuilder::default()
82    }
83}
84
85/// A builder for [`DescribeHapgOutput`](crate::operation::describe_hapg::DescribeHapgOutput).
86#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
87#[non_exhaustive]
88pub struct DescribeHapgOutputBuilder {
89    pub(crate) hapg_arn: ::std::option::Option<::std::string::String>,
90    pub(crate) hapg_serial: ::std::option::Option<::std::string::String>,
91    pub(crate) hsms_last_action_failed: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
92    pub(crate) hsms_pending_deletion: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
93    pub(crate) hsms_pending_registration: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
94    pub(crate) label: ::std::option::Option<::std::string::String>,
95    pub(crate) last_modified_timestamp: ::std::option::Option<::std::string::String>,
96    pub(crate) partition_serial_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
97    pub(crate) state: ::std::option::Option<crate::types::CloudHsmObjectState>,
98    _request_id: Option<String>,
99}
100impl DescribeHapgOutputBuilder {
101    /// <p>The ARN of the high-availability partition group.</p>
102    pub fn hapg_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.hapg_arn = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>The ARN of the high-availability partition group.</p>
107    pub fn set_hapg_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.hapg_arn = input;
109        self
110    }
111    /// <p>The ARN of the high-availability partition group.</p>
112    pub fn get_hapg_arn(&self) -> &::std::option::Option<::std::string::String> {
113        &self.hapg_arn
114    }
115    /// <p>The serial number of the high-availability partition group.</p>
116    pub fn hapg_serial(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.hapg_serial = ::std::option::Option::Some(input.into());
118        self
119    }
120    /// <p>The serial number of the high-availability partition group.</p>
121    pub fn set_hapg_serial(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.hapg_serial = input;
123        self
124    }
125    /// <p>The serial number of the high-availability partition group.</p>
126    pub fn get_hapg_serial(&self) -> &::std::option::Option<::std::string::String> {
127        &self.hapg_serial
128    }
129    /// Appends an item to `hsms_last_action_failed`.
130    ///
131    /// To override the contents of this collection use [`set_hsms_last_action_failed`](Self::set_hsms_last_action_failed).
132    ///
133    /// <p></p>
134    pub fn hsms_last_action_failed(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        let mut v = self.hsms_last_action_failed.unwrap_or_default();
136        v.push(input.into());
137        self.hsms_last_action_failed = ::std::option::Option::Some(v);
138        self
139    }
140    /// <p></p>
141    pub fn set_hsms_last_action_failed(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
142        self.hsms_last_action_failed = input;
143        self
144    }
145    /// <p></p>
146    pub fn get_hsms_last_action_failed(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
147        &self.hsms_last_action_failed
148    }
149    /// Appends an item to `hsms_pending_deletion`.
150    ///
151    /// To override the contents of this collection use [`set_hsms_pending_deletion`](Self::set_hsms_pending_deletion).
152    ///
153    /// <p></p>
154    pub fn hsms_pending_deletion(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        let mut v = self.hsms_pending_deletion.unwrap_or_default();
156        v.push(input.into());
157        self.hsms_pending_deletion = ::std::option::Option::Some(v);
158        self
159    }
160    /// <p></p>
161    pub fn set_hsms_pending_deletion(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
162        self.hsms_pending_deletion = input;
163        self
164    }
165    /// <p></p>
166    pub fn get_hsms_pending_deletion(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
167        &self.hsms_pending_deletion
168    }
169    /// Appends an item to `hsms_pending_registration`.
170    ///
171    /// To override the contents of this collection use [`set_hsms_pending_registration`](Self::set_hsms_pending_registration).
172    ///
173    /// <p></p>
174    pub fn hsms_pending_registration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
175        let mut v = self.hsms_pending_registration.unwrap_or_default();
176        v.push(input.into());
177        self.hsms_pending_registration = ::std::option::Option::Some(v);
178        self
179    }
180    /// <p></p>
181    pub fn set_hsms_pending_registration(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
182        self.hsms_pending_registration = input;
183        self
184    }
185    /// <p></p>
186    pub fn get_hsms_pending_registration(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
187        &self.hsms_pending_registration
188    }
189    /// <p>The label for the high-availability partition group.</p>
190    pub fn label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.label = ::std::option::Option::Some(input.into());
192        self
193    }
194    /// <p>The label for the high-availability partition group.</p>
195    pub fn set_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196        self.label = input;
197        self
198    }
199    /// <p>The label for the high-availability partition group.</p>
200    pub fn get_label(&self) -> &::std::option::Option<::std::string::String> {
201        &self.label
202    }
203    /// <p>The date and time the high-availability partition group was last modified.</p>
204    pub fn last_modified_timestamp(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205        self.last_modified_timestamp = ::std::option::Option::Some(input.into());
206        self
207    }
208    /// <p>The date and time the high-availability partition group was last modified.</p>
209    pub fn set_last_modified_timestamp(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210        self.last_modified_timestamp = input;
211        self
212    }
213    /// <p>The date and time the high-availability partition group was last modified.</p>
214    pub fn get_last_modified_timestamp(&self) -> &::std::option::Option<::std::string::String> {
215        &self.last_modified_timestamp
216    }
217    /// Appends an item to `partition_serial_list`.
218    ///
219    /// To override the contents of this collection use [`set_partition_serial_list`](Self::set_partition_serial_list).
220    ///
221    /// <p>The list of partition serial numbers that belong to the high-availability partition group.</p>
222    pub fn partition_serial_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
223        let mut v = self.partition_serial_list.unwrap_or_default();
224        v.push(input.into());
225        self.partition_serial_list = ::std::option::Option::Some(v);
226        self
227    }
228    /// <p>The list of partition serial numbers that belong to the high-availability partition group.</p>
229    pub fn set_partition_serial_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
230        self.partition_serial_list = input;
231        self
232    }
233    /// <p>The list of partition serial numbers that belong to the high-availability partition group.</p>
234    pub fn get_partition_serial_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
235        &self.partition_serial_list
236    }
237    /// <p>The state of the high-availability partition group.</p>
238    pub fn state(mut self, input: crate::types::CloudHsmObjectState) -> Self {
239        self.state = ::std::option::Option::Some(input);
240        self
241    }
242    /// <p>The state of the high-availability partition group.</p>
243    pub fn set_state(mut self, input: ::std::option::Option<crate::types::CloudHsmObjectState>) -> Self {
244        self.state = input;
245        self
246    }
247    /// <p>The state of the high-availability partition group.</p>
248    pub fn get_state(&self) -> &::std::option::Option<crate::types::CloudHsmObjectState> {
249        &self.state
250    }
251    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
252        self._request_id = Some(request_id.into());
253        self
254    }
255
256    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
257        self._request_id = request_id;
258        self
259    }
260    /// Consumes the builder and constructs a [`DescribeHapgOutput`](crate::operation::describe_hapg::DescribeHapgOutput).
261    pub fn build(self) -> crate::operation::describe_hapg::DescribeHapgOutput {
262        crate::operation::describe_hapg::DescribeHapgOutput {
263            hapg_arn: self.hapg_arn,
264            hapg_serial: self.hapg_serial,
265            hsms_last_action_failed: self.hsms_last_action_failed,
266            hsms_pending_deletion: self.hsms_pending_deletion,
267            hsms_pending_registration: self.hsms_pending_registration,
268            label: self.label,
269            last_modified_timestamp: self.last_modified_timestamp,
270            partition_serial_list: self.partition_serial_list,
271            state: self.state,
272            _request_id: self._request_id,
273        }
274    }
275}