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