aws_sdk_chime/operation/invite_users/
_invite_users_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 InviteUsersInput {
6    /// <p>The Amazon Chime account ID.</p>
7    pub account_id: ::std::option::Option<::std::string::String>,
8    /// <p>The user email addresses to which to send the email invitation.</p>
9    pub user_email_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10    /// <p>The user type.</p>
11    pub user_type: ::std::option::Option<crate::types::UserType>,
12}
13impl InviteUsersInput {
14    /// <p>The Amazon Chime account ID.</p>
15    pub fn account_id(&self) -> ::std::option::Option<&str> {
16        self.account_id.as_deref()
17    }
18    /// <p>The user email addresses to which to send the email invitation.</p>
19    ///
20    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.user_email_list.is_none()`.
21    pub fn user_email_list(&self) -> &[::std::string::String] {
22        self.user_email_list.as_deref().unwrap_or_default()
23    }
24    /// <p>The user type.</p>
25    pub fn user_type(&self) -> ::std::option::Option<&crate::types::UserType> {
26        self.user_type.as_ref()
27    }
28}
29impl InviteUsersInput {
30    /// Creates a new builder-style object to manufacture [`InviteUsersInput`](crate::operation::invite_users::InviteUsersInput).
31    pub fn builder() -> crate::operation::invite_users::builders::InviteUsersInputBuilder {
32        crate::operation::invite_users::builders::InviteUsersInputBuilder::default()
33    }
34}
35
36/// A builder for [`InviteUsersInput`](crate::operation::invite_users::InviteUsersInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct InviteUsersInputBuilder {
40    pub(crate) account_id: ::std::option::Option<::std::string::String>,
41    pub(crate) user_email_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
42    pub(crate) user_type: ::std::option::Option<crate::types::UserType>,
43}
44impl InviteUsersInputBuilder {
45    /// <p>The Amazon Chime account ID.</p>
46    /// This field is required.
47    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.account_id = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>The Amazon Chime account ID.</p>
52    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.account_id = input;
54        self
55    }
56    /// <p>The Amazon Chime account ID.</p>
57    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
58        &self.account_id
59    }
60    /// Appends an item to `user_email_list`.
61    ///
62    /// To override the contents of this collection use [`set_user_email_list`](Self::set_user_email_list).
63    ///
64    /// <p>The user email addresses to which to send the email invitation.</p>
65    pub fn user_email_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        let mut v = self.user_email_list.unwrap_or_default();
67        v.push(input.into());
68        self.user_email_list = ::std::option::Option::Some(v);
69        self
70    }
71    /// <p>The user email addresses to which to send the email invitation.</p>
72    pub fn set_user_email_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
73        self.user_email_list = input;
74        self
75    }
76    /// <p>The user email addresses to which to send the email invitation.</p>
77    pub fn get_user_email_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
78        &self.user_email_list
79    }
80    /// <p>The user type.</p>
81    pub fn user_type(mut self, input: crate::types::UserType) -> Self {
82        self.user_type = ::std::option::Option::Some(input);
83        self
84    }
85    /// <p>The user type.</p>
86    pub fn set_user_type(mut self, input: ::std::option::Option<crate::types::UserType>) -> Self {
87        self.user_type = input;
88        self
89    }
90    /// <p>The user type.</p>
91    pub fn get_user_type(&self) -> &::std::option::Option<crate::types::UserType> {
92        &self.user_type
93    }
94    /// Consumes the builder and constructs a [`InviteUsersInput`](crate::operation::invite_users::InviteUsersInput).
95    pub fn build(self) -> ::std::result::Result<crate::operation::invite_users::InviteUsersInput, ::aws_smithy_types::error::operation::BuildError> {
96        ::std::result::Result::Ok(crate::operation::invite_users::InviteUsersInput {
97            account_id: self.account_id,
98            user_email_list: self.user_email_list,
99            user_type: self.user_type,
100        })
101    }
102}