aws_sdk_wickr/operation/update_user/
_update_user_output.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)]
5pub struct UpdateUserOutput {
6    /// <p>The unique identifier of the updated user.</p>
7    pub user_id: ::std::string::String,
8    /// <p>The ID of the network where the user was updated.</p>
9    pub network_id: ::std::string::String,
10    /// <p>The list of security group IDs to which the user now belongs after the update.</p>
11    pub security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12    /// <p>The updated first name of the user.</p>
13    pub first_name: ::std::option::Option<::std::string::String>,
14    /// <p>The updated last name of the user.</p>
15    pub last_name: ::std::option::Option<::std::string::String>,
16    /// <p>The middle name of the user (currently not used).</p>
17    pub middle_name: ::std::option::Option<::std::string::String>,
18    /// <p>Indicates whether the user is suspended after the update.</p>
19    pub suspended: bool,
20    /// <p>The timestamp when the user was last modified, specified in epoch seconds.</p>
21    pub modified: ::std::option::Option<i32>,
22    /// <p>The user's status after the update.</p>
23    pub status: ::std::option::Option<i32>,
24    /// <p>The updated invite code for the user, if applicable.</p>
25    pub invite_code: ::std::option::Option<::std::string::String>,
26    /// <p>The expiration time of the user's invite code, specified in epoch seconds.</p>
27    pub invite_expiration: ::std::option::Option<i32>,
28    /// <p>Indicates whether the user can be verified through a custom invite code.</p>
29    pub code_validation: ::std::option::Option<bool>,
30    _request_id: Option<String>,
31}
32impl UpdateUserOutput {
33    /// <p>The unique identifier of the updated user.</p>
34    pub fn user_id(&self) -> &str {
35        use std::ops::Deref;
36        self.user_id.deref()
37    }
38    /// <p>The ID of the network where the user was updated.</p>
39    pub fn network_id(&self) -> &str {
40        use std::ops::Deref;
41        self.network_id.deref()
42    }
43    /// <p>The list of security group IDs to which the user now belongs after the update.</p>
44    ///
45    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.security_group_ids.is_none()`.
46    pub fn security_group_ids(&self) -> &[::std::string::String] {
47        self.security_group_ids.as_deref().unwrap_or_default()
48    }
49    /// <p>The updated first name of the user.</p>
50    pub fn first_name(&self) -> ::std::option::Option<&str> {
51        self.first_name.as_deref()
52    }
53    /// <p>The updated last name of the user.</p>
54    pub fn last_name(&self) -> ::std::option::Option<&str> {
55        self.last_name.as_deref()
56    }
57    /// <p>The middle name of the user (currently not used).</p>
58    pub fn middle_name(&self) -> ::std::option::Option<&str> {
59        self.middle_name.as_deref()
60    }
61    /// <p>Indicates whether the user is suspended after the update.</p>
62    pub fn suspended(&self) -> bool {
63        self.suspended
64    }
65    /// <p>The timestamp when the user was last modified, specified in epoch seconds.</p>
66    pub fn modified(&self) -> ::std::option::Option<i32> {
67        self.modified
68    }
69    /// <p>The user's status after the update.</p>
70    pub fn status(&self) -> ::std::option::Option<i32> {
71        self.status
72    }
73    /// <p>The updated invite code for the user, if applicable.</p>
74    pub fn invite_code(&self) -> ::std::option::Option<&str> {
75        self.invite_code.as_deref()
76    }
77    /// <p>The expiration time of the user's invite code, specified in epoch seconds.</p>
78    pub fn invite_expiration(&self) -> ::std::option::Option<i32> {
79        self.invite_expiration
80    }
81    /// <p>Indicates whether the user can be verified through a custom invite code.</p>
82    pub fn code_validation(&self) -> ::std::option::Option<bool> {
83        self.code_validation
84    }
85}
86impl ::std::fmt::Debug for UpdateUserOutput {
87    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
88        let mut formatter = f.debug_struct("UpdateUserOutput");
89        formatter.field("user_id", &self.user_id);
90        formatter.field("network_id", &self.network_id);
91        formatter.field("security_group_ids", &self.security_group_ids);
92        formatter.field("first_name", &"*** Sensitive Data Redacted ***");
93        formatter.field("last_name", &"*** Sensitive Data Redacted ***");
94        formatter.field("middle_name", &self.middle_name);
95        formatter.field("suspended", &self.suspended);
96        formatter.field("modified", &self.modified);
97        formatter.field("status", &self.status);
98        formatter.field("invite_code", &self.invite_code);
99        formatter.field("invite_expiration", &self.invite_expiration);
100        formatter.field("code_validation", &self.code_validation);
101        formatter.field("_request_id", &self._request_id);
102        formatter.finish()
103    }
104}
105impl ::aws_types::request_id::RequestId for UpdateUserOutput {
106    fn request_id(&self) -> Option<&str> {
107        self._request_id.as_deref()
108    }
109}
110impl UpdateUserOutput {
111    /// Creates a new builder-style object to manufacture [`UpdateUserOutput`](crate::operation::update_user::UpdateUserOutput).
112    pub fn builder() -> crate::operation::update_user::builders::UpdateUserOutputBuilder {
113        crate::operation::update_user::builders::UpdateUserOutputBuilder::default()
114    }
115}
116
117/// A builder for [`UpdateUserOutput`](crate::operation::update_user::UpdateUserOutput).
118#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
119#[non_exhaustive]
120pub struct UpdateUserOutputBuilder {
121    pub(crate) user_id: ::std::option::Option<::std::string::String>,
122    pub(crate) network_id: ::std::option::Option<::std::string::String>,
123    pub(crate) security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
124    pub(crate) first_name: ::std::option::Option<::std::string::String>,
125    pub(crate) last_name: ::std::option::Option<::std::string::String>,
126    pub(crate) middle_name: ::std::option::Option<::std::string::String>,
127    pub(crate) suspended: ::std::option::Option<bool>,
128    pub(crate) modified: ::std::option::Option<i32>,
129    pub(crate) status: ::std::option::Option<i32>,
130    pub(crate) invite_code: ::std::option::Option<::std::string::String>,
131    pub(crate) invite_expiration: ::std::option::Option<i32>,
132    pub(crate) code_validation: ::std::option::Option<bool>,
133    _request_id: Option<String>,
134}
135impl UpdateUserOutputBuilder {
136    /// <p>The unique identifier of the updated user.</p>
137    /// This field is required.
138    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.user_id = ::std::option::Option::Some(input.into());
140        self
141    }
142    /// <p>The unique identifier of the updated user.</p>
143    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.user_id = input;
145        self
146    }
147    /// <p>The unique identifier of the updated user.</p>
148    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
149        &self.user_id
150    }
151    /// <p>The ID of the network where the user was updated.</p>
152    /// This field is required.
153    pub fn network_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.network_id = ::std::option::Option::Some(input.into());
155        self
156    }
157    /// <p>The ID of the network where the user was updated.</p>
158    pub fn set_network_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.network_id = input;
160        self
161    }
162    /// <p>The ID of the network where the user was updated.</p>
163    pub fn get_network_id(&self) -> &::std::option::Option<::std::string::String> {
164        &self.network_id
165    }
166    /// Appends an item to `security_group_ids`.
167    ///
168    /// To override the contents of this collection use [`set_security_group_ids`](Self::set_security_group_ids).
169    ///
170    /// <p>The list of security group IDs to which the user now belongs after the update.</p>
171    pub fn security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        let mut v = self.security_group_ids.unwrap_or_default();
173        v.push(input.into());
174        self.security_group_ids = ::std::option::Option::Some(v);
175        self
176    }
177    /// <p>The list of security group IDs to which the user now belongs after the update.</p>
178    pub fn set_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
179        self.security_group_ids = input;
180        self
181    }
182    /// <p>The list of security group IDs to which the user now belongs after the update.</p>
183    pub fn get_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
184        &self.security_group_ids
185    }
186    /// <p>The updated first name of the user.</p>
187    pub fn first_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188        self.first_name = ::std::option::Option::Some(input.into());
189        self
190    }
191    /// <p>The updated first name of the user.</p>
192    pub fn set_first_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193        self.first_name = input;
194        self
195    }
196    /// <p>The updated first name of the user.</p>
197    pub fn get_first_name(&self) -> &::std::option::Option<::std::string::String> {
198        &self.first_name
199    }
200    /// <p>The updated last name of the user.</p>
201    pub fn last_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202        self.last_name = ::std::option::Option::Some(input.into());
203        self
204    }
205    /// <p>The updated last name of the user.</p>
206    pub fn set_last_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
207        self.last_name = input;
208        self
209    }
210    /// <p>The updated last name of the user.</p>
211    pub fn get_last_name(&self) -> &::std::option::Option<::std::string::String> {
212        &self.last_name
213    }
214    /// <p>The middle name of the user (currently not used).</p>
215    pub fn middle_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
216        self.middle_name = ::std::option::Option::Some(input.into());
217        self
218    }
219    /// <p>The middle name of the user (currently not used).</p>
220    pub fn set_middle_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221        self.middle_name = input;
222        self
223    }
224    /// <p>The middle name of the user (currently not used).</p>
225    pub fn get_middle_name(&self) -> &::std::option::Option<::std::string::String> {
226        &self.middle_name
227    }
228    /// <p>Indicates whether the user is suspended after the update.</p>
229    /// This field is required.
230    pub fn suspended(mut self, input: bool) -> Self {
231        self.suspended = ::std::option::Option::Some(input);
232        self
233    }
234    /// <p>Indicates whether the user is suspended after the update.</p>
235    pub fn set_suspended(mut self, input: ::std::option::Option<bool>) -> Self {
236        self.suspended = input;
237        self
238    }
239    /// <p>Indicates whether the user is suspended after the update.</p>
240    pub fn get_suspended(&self) -> &::std::option::Option<bool> {
241        &self.suspended
242    }
243    /// <p>The timestamp when the user was last modified, specified in epoch seconds.</p>
244    pub fn modified(mut self, input: i32) -> Self {
245        self.modified = ::std::option::Option::Some(input);
246        self
247    }
248    /// <p>The timestamp when the user was last modified, specified in epoch seconds.</p>
249    pub fn set_modified(mut self, input: ::std::option::Option<i32>) -> Self {
250        self.modified = input;
251        self
252    }
253    /// <p>The timestamp when the user was last modified, specified in epoch seconds.</p>
254    pub fn get_modified(&self) -> &::std::option::Option<i32> {
255        &self.modified
256    }
257    /// <p>The user's status after the update.</p>
258    pub fn status(mut self, input: i32) -> Self {
259        self.status = ::std::option::Option::Some(input);
260        self
261    }
262    /// <p>The user's status after the update.</p>
263    pub fn set_status(mut self, input: ::std::option::Option<i32>) -> Self {
264        self.status = input;
265        self
266    }
267    /// <p>The user's status after the update.</p>
268    pub fn get_status(&self) -> &::std::option::Option<i32> {
269        &self.status
270    }
271    /// <p>The updated invite code for the user, if applicable.</p>
272    pub fn invite_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
273        self.invite_code = ::std::option::Option::Some(input.into());
274        self
275    }
276    /// <p>The updated invite code for the user, if applicable.</p>
277    pub fn set_invite_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
278        self.invite_code = input;
279        self
280    }
281    /// <p>The updated invite code for the user, if applicable.</p>
282    pub fn get_invite_code(&self) -> &::std::option::Option<::std::string::String> {
283        &self.invite_code
284    }
285    /// <p>The expiration time of the user's invite code, specified in epoch seconds.</p>
286    pub fn invite_expiration(mut self, input: i32) -> Self {
287        self.invite_expiration = ::std::option::Option::Some(input);
288        self
289    }
290    /// <p>The expiration time of the user's invite code, specified in epoch seconds.</p>
291    pub fn set_invite_expiration(mut self, input: ::std::option::Option<i32>) -> Self {
292        self.invite_expiration = input;
293        self
294    }
295    /// <p>The expiration time of the user's invite code, specified in epoch seconds.</p>
296    pub fn get_invite_expiration(&self) -> &::std::option::Option<i32> {
297        &self.invite_expiration
298    }
299    /// <p>Indicates whether the user can be verified through a custom invite code.</p>
300    pub fn code_validation(mut self, input: bool) -> Self {
301        self.code_validation = ::std::option::Option::Some(input);
302        self
303    }
304    /// <p>Indicates whether the user can be verified through a custom invite code.</p>
305    pub fn set_code_validation(mut self, input: ::std::option::Option<bool>) -> Self {
306        self.code_validation = input;
307        self
308    }
309    /// <p>Indicates whether the user can be verified through a custom invite code.</p>
310    pub fn get_code_validation(&self) -> &::std::option::Option<bool> {
311        &self.code_validation
312    }
313    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
314        self._request_id = Some(request_id.into());
315        self
316    }
317
318    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
319        self._request_id = request_id;
320        self
321    }
322    /// Consumes the builder and constructs a [`UpdateUserOutput`](crate::operation::update_user::UpdateUserOutput).
323    /// This method will fail if any of the following fields are not set:
324    /// - [`user_id`](crate::operation::update_user::builders::UpdateUserOutputBuilder::user_id)
325    /// - [`network_id`](crate::operation::update_user::builders::UpdateUserOutputBuilder::network_id)
326    /// - [`suspended`](crate::operation::update_user::builders::UpdateUserOutputBuilder::suspended)
327    pub fn build(self) -> ::std::result::Result<crate::operation::update_user::UpdateUserOutput, ::aws_smithy_types::error::operation::BuildError> {
328        ::std::result::Result::Ok(crate::operation::update_user::UpdateUserOutput {
329            user_id: self.user_id.ok_or_else(|| {
330                ::aws_smithy_types::error::operation::BuildError::missing_field(
331                    "user_id",
332                    "user_id was not specified but it is required when building UpdateUserOutput",
333                )
334            })?,
335            network_id: self.network_id.ok_or_else(|| {
336                ::aws_smithy_types::error::operation::BuildError::missing_field(
337                    "network_id",
338                    "network_id was not specified but it is required when building UpdateUserOutput",
339                )
340            })?,
341            security_group_ids: self.security_group_ids,
342            first_name: self.first_name,
343            last_name: self.last_name,
344            middle_name: self.middle_name,
345            suspended: self.suspended.ok_or_else(|| {
346                ::aws_smithy_types::error::operation::BuildError::missing_field(
347                    "suspended",
348                    "suspended was not specified but it is required when building UpdateUserOutput",
349                )
350            })?,
351            modified: self.modified,
352            status: self.status,
353            invite_code: self.invite_code,
354            invite_expiration: self.invite_expiration,
355            code_validation: self.code_validation,
356            _request_id: self._request_id,
357        })
358    }
359}
360impl ::std::fmt::Debug for UpdateUserOutputBuilder {
361    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
362        let mut formatter = f.debug_struct("UpdateUserOutputBuilder");
363        formatter.field("user_id", &self.user_id);
364        formatter.field("network_id", &self.network_id);
365        formatter.field("security_group_ids", &self.security_group_ids);
366        formatter.field("first_name", &"*** Sensitive Data Redacted ***");
367        formatter.field("last_name", &"*** Sensitive Data Redacted ***");
368        formatter.field("middle_name", &self.middle_name);
369        formatter.field("suspended", &self.suspended);
370        formatter.field("modified", &self.modified);
371        formatter.field("status", &self.status);
372        formatter.field("invite_code", &self.invite_code);
373        formatter.field("invite_expiration", &self.invite_expiration);
374        formatter.field("code_validation", &self.code_validation);
375        formatter.field("_request_id", &self._request_id);
376        formatter.finish()
377    }
378}