aws_sdk_licensemanagerusersubscriptions/operation/associate_user/
_associate_user_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)]
5pub struct AssociateUserInput {
6    /// <p>The user name from the identity provider.</p>
7    pub username: ::std::option::Option<::std::string::String>,
8    /// <p>The ID of the EC2 instance that provides the user-based subscription.</p>
9    pub instance_id: ::std::option::Option<::std::string::String>,
10    /// <p>The identity provider for the user.</p>
11    pub identity_provider: ::std::option::Option<crate::types::IdentityProvider>,
12    /// <p>The domain name of the Active Directory that contains information for the user to associate.</p>
13    pub domain: ::std::option::Option<::std::string::String>,
14    /// <p>The tags that apply for the user association.</p>
15    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16}
17impl AssociateUserInput {
18    /// <p>The user name from the identity provider.</p>
19    pub fn username(&self) -> ::std::option::Option<&str> {
20        self.username.as_deref()
21    }
22    /// <p>The ID of the EC2 instance that provides the user-based subscription.</p>
23    pub fn instance_id(&self) -> ::std::option::Option<&str> {
24        self.instance_id.as_deref()
25    }
26    /// <p>The identity provider for the user.</p>
27    pub fn identity_provider(&self) -> ::std::option::Option<&crate::types::IdentityProvider> {
28        self.identity_provider.as_ref()
29    }
30    /// <p>The domain name of the Active Directory that contains information for the user to associate.</p>
31    pub fn domain(&self) -> ::std::option::Option<&str> {
32        self.domain.as_deref()
33    }
34    /// <p>The tags that apply for the user association.</p>
35    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
36        self.tags.as_ref()
37    }
38}
39impl ::std::fmt::Debug for AssociateUserInput {
40    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
41        let mut formatter = f.debug_struct("AssociateUserInput");
42        formatter.field("username", &self.username);
43        formatter.field("instance_id", &self.instance_id);
44        formatter.field("identity_provider", &self.identity_provider);
45        formatter.field("domain", &self.domain);
46        formatter.field("tags", &"*** Sensitive Data Redacted ***");
47        formatter.finish()
48    }
49}
50impl AssociateUserInput {
51    /// Creates a new builder-style object to manufacture [`AssociateUserInput`](crate::operation::associate_user::AssociateUserInput).
52    pub fn builder() -> crate::operation::associate_user::builders::AssociateUserInputBuilder {
53        crate::operation::associate_user::builders::AssociateUserInputBuilder::default()
54    }
55}
56
57/// A builder for [`AssociateUserInput`](crate::operation::associate_user::AssociateUserInput).
58#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
59#[non_exhaustive]
60pub struct AssociateUserInputBuilder {
61    pub(crate) username: ::std::option::Option<::std::string::String>,
62    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
63    pub(crate) identity_provider: ::std::option::Option<crate::types::IdentityProvider>,
64    pub(crate) domain: ::std::option::Option<::std::string::String>,
65    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
66}
67impl AssociateUserInputBuilder {
68    /// <p>The user name from the identity provider.</p>
69    /// This field is required.
70    pub fn username(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71        self.username = ::std::option::Option::Some(input.into());
72        self
73    }
74    /// <p>The user name from the identity provider.</p>
75    pub fn set_username(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.username = input;
77        self
78    }
79    /// <p>The user name from the identity provider.</p>
80    pub fn get_username(&self) -> &::std::option::Option<::std::string::String> {
81        &self.username
82    }
83    /// <p>The ID of the EC2 instance that provides the user-based subscription.</p>
84    /// This field is required.
85    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
86        self.instance_id = ::std::option::Option::Some(input.into());
87        self
88    }
89    /// <p>The ID of the EC2 instance that provides the user-based subscription.</p>
90    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
91        self.instance_id = input;
92        self
93    }
94    /// <p>The ID of the EC2 instance that provides the user-based subscription.</p>
95    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
96        &self.instance_id
97    }
98    /// <p>The identity provider for the user.</p>
99    /// This field is required.
100    pub fn identity_provider(mut self, input: crate::types::IdentityProvider) -> Self {
101        self.identity_provider = ::std::option::Option::Some(input);
102        self
103    }
104    /// <p>The identity provider for the user.</p>
105    pub fn set_identity_provider(mut self, input: ::std::option::Option<crate::types::IdentityProvider>) -> Self {
106        self.identity_provider = input;
107        self
108    }
109    /// <p>The identity provider for the user.</p>
110    pub fn get_identity_provider(&self) -> &::std::option::Option<crate::types::IdentityProvider> {
111        &self.identity_provider
112    }
113    /// <p>The domain name of the Active Directory that contains information for the user to associate.</p>
114    pub fn domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.domain = ::std::option::Option::Some(input.into());
116        self
117    }
118    /// <p>The domain name of the Active Directory that contains information for the user to associate.</p>
119    pub fn set_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.domain = input;
121        self
122    }
123    /// <p>The domain name of the Active Directory that contains information for the user to associate.</p>
124    pub fn get_domain(&self) -> &::std::option::Option<::std::string::String> {
125        &self.domain
126    }
127    /// Adds a key-value pair to `tags`.
128    ///
129    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
130    ///
131    /// <p>The tags that apply for the user association.</p>
132    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
133        let mut hash_map = self.tags.unwrap_or_default();
134        hash_map.insert(k.into(), v.into());
135        self.tags = ::std::option::Option::Some(hash_map);
136        self
137    }
138    /// <p>The tags that apply for the user association.</p>
139    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
140        self.tags = input;
141        self
142    }
143    /// <p>The tags that apply for the user association.</p>
144    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
145        &self.tags
146    }
147    /// Consumes the builder and constructs a [`AssociateUserInput`](crate::operation::associate_user::AssociateUserInput).
148    pub fn build(
149        self,
150    ) -> ::std::result::Result<crate::operation::associate_user::AssociateUserInput, ::aws_smithy_types::error::operation::BuildError> {
151        ::std::result::Result::Ok(crate::operation::associate_user::AssociateUserInput {
152            username: self.username,
153            instance_id: self.instance_id,
154            identity_provider: self.identity_provider,
155            domain: self.domain,
156            tags: self.tags,
157        })
158    }
159}
160impl ::std::fmt::Debug for AssociateUserInputBuilder {
161    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
162        let mut formatter = f.debug_struct("AssociateUserInputBuilder");
163        formatter.field("username", &self.username);
164        formatter.field("instance_id", &self.instance_id);
165        formatter.field("identity_provider", &self.identity_provider);
166        formatter.field("domain", &self.domain);
167        formatter.field("tags", &"*** Sensitive Data Redacted ***");
168        formatter.finish()
169    }
170}