aws_sdk_transfer/operation/create_user/_create_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, ::std::fmt::Debug)]
5pub struct CreateUserInput {
6 /// <p>The landing directory (folder) for a user when they log in to the server using the client.</p>
7 /// <p>A <code>HomeDirectory</code> example is <code>/bucket_name/home/mydirectory</code>.</p><note>
8 /// <p>You can use the <code>HomeDirectory</code> parameter for <code>HomeDirectoryType</code> when it is set to either <code>PATH</code> or <code>LOGICAL</code>.</p>
9 /// </note>
10 pub home_directory: ::std::option::Option<::std::string::String>,
11 /// <p>The type of landing directory (folder) that you want your users' home directory to be when they log in to the server. If you set it to <code>PATH</code>, the user will see the absolute Amazon S3 bucket or Amazon EFS path as is in their file transfer protocol clients. If you set it to <code>LOGICAL</code>, you need to provide mappings in the <code>HomeDirectoryMappings</code> for how you want to make Amazon S3 or Amazon EFS paths visible to your users.</p><note>
12 /// <p>If <code>HomeDirectoryType</code> is <code>LOGICAL</code>, you must provide mappings, using the <code>HomeDirectoryMappings</code> parameter. If, on the other hand, <code>HomeDirectoryType</code> is <code>PATH</code>, you provide an absolute path using the <code>HomeDirectory</code> parameter. You cannot have both <code>HomeDirectory</code> and <code>HomeDirectoryMappings</code> in your template.</p>
13 /// </note>
14 pub home_directory_type: ::std::option::Option<crate::types::HomeDirectoryType>,
15 /// <p>Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should be visible to your user and how you want to make them visible. You must specify the <code>Entry</code> and <code>Target</code> pair, where <code>Entry</code> shows how the path is made visible and <code>Target</code> is the actual Amazon S3 or Amazon EFS path. If you only specify a target, it is displayed as is. You also must ensure that your Identity and Access Management (IAM) role provides access to paths in <code>Target</code>. This value can be set only when <code>HomeDirectoryType</code> is set to <i>LOGICAL</i>.</p>
16 /// <p>The following is an <code>Entry</code> and <code>Target</code> pair example.</p>
17 /// <p><code>\[ { "Entry": "/directory1", "Target": "/bucket_name/home/mydirectory" } \]</code></p>
18 /// <p>In most cases, you can use this value instead of the session policy to lock your user down to the designated home directory ("<code>chroot</code>"). To do this, you can set <code>Entry</code> to <code>/</code> and set <code>Target</code> to the value the user should see for their home directory when they log in.</p>
19 /// <p>The following is an <code>Entry</code> and <code>Target</code> pair example for <code>chroot</code>.</p>
20 /// <p><code>\[ { "Entry": "/", "Target": "/bucket_name/home/mydirectory" } \]</code></p>
21 pub home_directory_mappings: ::std::option::Option<::std::vec::Vec<crate::types::HomeDirectoryMapEntry>>,
22 /// <p>A session policy for your user so that you can use the same Identity and Access Management (IAM) role across multiple users. This policy scopes down a user's access to portions of their Amazon S3 bucket. Variables that you can use inside this policy include <code>${Transfer:UserName}</code>, <code>${Transfer:HomeDirectory}</code>, and <code>${Transfer:HomeBucket}</code>.</p><note>
23 /// <p>This policy applies only when the domain of <code>ServerId</code> is Amazon S3. Amazon EFS does not use session policies.</p>
24 /// <p>For session policies, Transfer Family stores the policy as a JSON blob, instead of the Amazon Resource Name (ARN) of the policy. You save the policy as a JSON blob and pass it in the <code>Policy</code> argument.</p>
25 /// <p>For an example of a session policy, see <a href="https://docs.aws.amazon.com/transfer/latest/userguide/session-policy.html">Example session policy</a>.</p>
26 /// <p>For more information, see <a href="https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html">AssumeRole</a> in the <i>Amazon Web Services Security Token Service API Reference</i>.</p>
27 /// </note>
28 pub policy: ::std::option::Option<::std::string::String>,
29 /// <p>Specifies the full POSIX identity, including user ID (<code>Uid</code>), group ID (<code>Gid</code>), and any secondary groups IDs (<code>SecondaryGids</code>), that controls your users' access to your Amazon EFS file systems. The POSIX permissions that are set on files and directories in Amazon EFS determine the level of access your users get when transferring files into and out of your Amazon EFS file systems.</p>
30 pub posix_profile: ::std::option::Option<crate::types::PosixProfile>,
31 /// <p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that controls your users' access to your Amazon S3 bucket or Amazon EFS file system. The policies attached to this role determine the level of access that you want to provide your users when transferring files into and out of your Amazon S3 bucket or Amazon EFS file system. The IAM role should also contain a trust relationship that allows the server to access your resources when servicing your users' transfer requests.</p>
32 pub role: ::std::option::Option<::std::string::String>,
33 /// <p>A system-assigned unique identifier for a server instance. This is the specific server that you added your user to.</p>
34 pub server_id: ::std::option::Option<::std::string::String>,
35 /// <p>The public portion of the Secure Shell (SSH) key used to authenticate the user to the server.</p>
36 /// <p>The three standard SSH public key format elements are <code><key type></code>, <code><body base64></code>, and an optional <code><comment></code>, with spaces between each element.</p>
37 /// <p>Transfer Family accepts RSA, ECDSA, and ED25519 keys.</p>
38 /// <ul>
39 /// <li>
40 /// <p>For RSA keys, the key type is <code>ssh-rsa</code>.</p></li>
41 /// <li>
42 /// <p>For ED25519 keys, the key type is <code>ssh-ed25519</code>.</p></li>
43 /// <li>
44 /// <p>For ECDSA keys, the key type is either <code>ecdsa-sha2-nistp256</code>, <code>ecdsa-sha2-nistp384</code>, or <code>ecdsa-sha2-nistp521</code>, depending on the size of the key you generated.</p></li>
45 /// </ul>
46 pub ssh_public_key_body: ::std::option::Option<::std::string::String>,
47 /// <p>Key-value pairs that can be used to group and search for users. Tags are metadata attached to users for any purpose.</p>
48 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
49 /// <p>A unique string that identifies a user and is associated with a <code>ServerId</code>. This user name must be a minimum of 3 and a maximum of 100 characters long. The following are valid characters: a-z, A-Z, 0-9, underscore '_', hyphen '-', period '.', and at sign '@'. The user name can't start with a hyphen, period, or at sign.</p>
50 pub user_name: ::std::option::Option<::std::string::String>,
51}
52impl CreateUserInput {
53 /// <p>The landing directory (folder) for a user when they log in to the server using the client.</p>
54 /// <p>A <code>HomeDirectory</code> example is <code>/bucket_name/home/mydirectory</code>.</p><note>
55 /// <p>You can use the <code>HomeDirectory</code> parameter for <code>HomeDirectoryType</code> when it is set to either <code>PATH</code> or <code>LOGICAL</code>.</p>
56 /// </note>
57 pub fn home_directory(&self) -> ::std::option::Option<&str> {
58 self.home_directory.as_deref()
59 }
60 /// <p>The type of landing directory (folder) that you want your users' home directory to be when they log in to the server. If you set it to <code>PATH</code>, the user will see the absolute Amazon S3 bucket or Amazon EFS path as is in their file transfer protocol clients. If you set it to <code>LOGICAL</code>, you need to provide mappings in the <code>HomeDirectoryMappings</code> for how you want to make Amazon S3 or Amazon EFS paths visible to your users.</p><note>
61 /// <p>If <code>HomeDirectoryType</code> is <code>LOGICAL</code>, you must provide mappings, using the <code>HomeDirectoryMappings</code> parameter. If, on the other hand, <code>HomeDirectoryType</code> is <code>PATH</code>, you provide an absolute path using the <code>HomeDirectory</code> parameter. You cannot have both <code>HomeDirectory</code> and <code>HomeDirectoryMappings</code> in your template.</p>
62 /// </note>
63 pub fn home_directory_type(&self) -> ::std::option::Option<&crate::types::HomeDirectoryType> {
64 self.home_directory_type.as_ref()
65 }
66 /// <p>Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should be visible to your user and how you want to make them visible. You must specify the <code>Entry</code> and <code>Target</code> pair, where <code>Entry</code> shows how the path is made visible and <code>Target</code> is the actual Amazon S3 or Amazon EFS path. If you only specify a target, it is displayed as is. You also must ensure that your Identity and Access Management (IAM) role provides access to paths in <code>Target</code>. This value can be set only when <code>HomeDirectoryType</code> is set to <i>LOGICAL</i>.</p>
67 /// <p>The following is an <code>Entry</code> and <code>Target</code> pair example.</p>
68 /// <p><code>\[ { "Entry": "/directory1", "Target": "/bucket_name/home/mydirectory" } \]</code></p>
69 /// <p>In most cases, you can use this value instead of the session policy to lock your user down to the designated home directory ("<code>chroot</code>"). To do this, you can set <code>Entry</code> to <code>/</code> and set <code>Target</code> to the value the user should see for their home directory when they log in.</p>
70 /// <p>The following is an <code>Entry</code> and <code>Target</code> pair example for <code>chroot</code>.</p>
71 /// <p><code>\[ { "Entry": "/", "Target": "/bucket_name/home/mydirectory" } \]</code></p>
72 ///
73 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.home_directory_mappings.is_none()`.
74 pub fn home_directory_mappings(&self) -> &[crate::types::HomeDirectoryMapEntry] {
75 self.home_directory_mappings.as_deref().unwrap_or_default()
76 }
77 /// <p>A session policy for your user so that you can use the same Identity and Access Management (IAM) role across multiple users. This policy scopes down a user's access to portions of their Amazon S3 bucket. Variables that you can use inside this policy include <code>${Transfer:UserName}</code>, <code>${Transfer:HomeDirectory}</code>, and <code>${Transfer:HomeBucket}</code>.</p><note>
78 /// <p>This policy applies only when the domain of <code>ServerId</code> is Amazon S3. Amazon EFS does not use session policies.</p>
79 /// <p>For session policies, Transfer Family stores the policy as a JSON blob, instead of the Amazon Resource Name (ARN) of the policy. You save the policy as a JSON blob and pass it in the <code>Policy</code> argument.</p>
80 /// <p>For an example of a session policy, see <a href="https://docs.aws.amazon.com/transfer/latest/userguide/session-policy.html">Example session policy</a>.</p>
81 /// <p>For more information, see <a href="https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html">AssumeRole</a> in the <i>Amazon Web Services Security Token Service API Reference</i>.</p>
82 /// </note>
83 pub fn policy(&self) -> ::std::option::Option<&str> {
84 self.policy.as_deref()
85 }
86 /// <p>Specifies the full POSIX identity, including user ID (<code>Uid</code>), group ID (<code>Gid</code>), and any secondary groups IDs (<code>SecondaryGids</code>), that controls your users' access to your Amazon EFS file systems. The POSIX permissions that are set on files and directories in Amazon EFS determine the level of access your users get when transferring files into and out of your Amazon EFS file systems.</p>
87 pub fn posix_profile(&self) -> ::std::option::Option<&crate::types::PosixProfile> {
88 self.posix_profile.as_ref()
89 }
90 /// <p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that controls your users' access to your Amazon S3 bucket or Amazon EFS file system. The policies attached to this role determine the level of access that you want to provide your users when transferring files into and out of your Amazon S3 bucket or Amazon EFS file system. The IAM role should also contain a trust relationship that allows the server to access your resources when servicing your users' transfer requests.</p>
91 pub fn role(&self) -> ::std::option::Option<&str> {
92 self.role.as_deref()
93 }
94 /// <p>A system-assigned unique identifier for a server instance. This is the specific server that you added your user to.</p>
95 pub fn server_id(&self) -> ::std::option::Option<&str> {
96 self.server_id.as_deref()
97 }
98 /// <p>The public portion of the Secure Shell (SSH) key used to authenticate the user to the server.</p>
99 /// <p>The three standard SSH public key format elements are <code><key type></code>, <code><body base64></code>, and an optional <code><comment></code>, with spaces between each element.</p>
100 /// <p>Transfer Family accepts RSA, ECDSA, and ED25519 keys.</p>
101 /// <ul>
102 /// <li>
103 /// <p>For RSA keys, the key type is <code>ssh-rsa</code>.</p></li>
104 /// <li>
105 /// <p>For ED25519 keys, the key type is <code>ssh-ed25519</code>.</p></li>
106 /// <li>
107 /// <p>For ECDSA keys, the key type is either <code>ecdsa-sha2-nistp256</code>, <code>ecdsa-sha2-nistp384</code>, or <code>ecdsa-sha2-nistp521</code>, depending on the size of the key you generated.</p></li>
108 /// </ul>
109 pub fn ssh_public_key_body(&self) -> ::std::option::Option<&str> {
110 self.ssh_public_key_body.as_deref()
111 }
112 /// <p>Key-value pairs that can be used to group and search for users. Tags are metadata attached to users for any purpose.</p>
113 ///
114 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
115 pub fn tags(&self) -> &[crate::types::Tag] {
116 self.tags.as_deref().unwrap_or_default()
117 }
118 /// <p>A unique string that identifies a user and is associated with a <code>ServerId</code>. This user name must be a minimum of 3 and a maximum of 100 characters long. The following are valid characters: a-z, A-Z, 0-9, underscore '_', hyphen '-', period '.', and at sign '@'. The user name can't start with a hyphen, period, or at sign.</p>
119 pub fn user_name(&self) -> ::std::option::Option<&str> {
120 self.user_name.as_deref()
121 }
122}
123impl CreateUserInput {
124 /// Creates a new builder-style object to manufacture [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
125 pub fn builder() -> crate::operation::create_user::builders::CreateUserInputBuilder {
126 crate::operation::create_user::builders::CreateUserInputBuilder::default()
127 }
128}
129
130/// A builder for [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
131#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
132#[non_exhaustive]
133pub struct CreateUserInputBuilder {
134 pub(crate) home_directory: ::std::option::Option<::std::string::String>,
135 pub(crate) home_directory_type: ::std::option::Option<crate::types::HomeDirectoryType>,
136 pub(crate) home_directory_mappings: ::std::option::Option<::std::vec::Vec<crate::types::HomeDirectoryMapEntry>>,
137 pub(crate) policy: ::std::option::Option<::std::string::String>,
138 pub(crate) posix_profile: ::std::option::Option<crate::types::PosixProfile>,
139 pub(crate) role: ::std::option::Option<::std::string::String>,
140 pub(crate) server_id: ::std::option::Option<::std::string::String>,
141 pub(crate) ssh_public_key_body: ::std::option::Option<::std::string::String>,
142 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
143 pub(crate) user_name: ::std::option::Option<::std::string::String>,
144}
145impl CreateUserInputBuilder {
146 /// <p>The landing directory (folder) for a user when they log in to the server using the client.</p>
147 /// <p>A <code>HomeDirectory</code> example is <code>/bucket_name/home/mydirectory</code>.</p><note>
148 /// <p>You can use the <code>HomeDirectory</code> parameter for <code>HomeDirectoryType</code> when it is set to either <code>PATH</code> or <code>LOGICAL</code>.</p>
149 /// </note>
150 pub fn home_directory(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151 self.home_directory = ::std::option::Option::Some(input.into());
152 self
153 }
154 /// <p>The landing directory (folder) for a user when they log in to the server using the client.</p>
155 /// <p>A <code>HomeDirectory</code> example is <code>/bucket_name/home/mydirectory</code>.</p><note>
156 /// <p>You can use the <code>HomeDirectory</code> parameter for <code>HomeDirectoryType</code> when it is set to either <code>PATH</code> or <code>LOGICAL</code>.</p>
157 /// </note>
158 pub fn set_home_directory(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159 self.home_directory = input;
160 self
161 }
162 /// <p>The landing directory (folder) for a user when they log in to the server using the client.</p>
163 /// <p>A <code>HomeDirectory</code> example is <code>/bucket_name/home/mydirectory</code>.</p><note>
164 /// <p>You can use the <code>HomeDirectory</code> parameter for <code>HomeDirectoryType</code> when it is set to either <code>PATH</code> or <code>LOGICAL</code>.</p>
165 /// </note>
166 pub fn get_home_directory(&self) -> &::std::option::Option<::std::string::String> {
167 &self.home_directory
168 }
169 /// <p>The type of landing directory (folder) that you want your users' home directory to be when they log in to the server. If you set it to <code>PATH</code>, the user will see the absolute Amazon S3 bucket or Amazon EFS path as is in their file transfer protocol clients. If you set it to <code>LOGICAL</code>, you need to provide mappings in the <code>HomeDirectoryMappings</code> for how you want to make Amazon S3 or Amazon EFS paths visible to your users.</p><note>
170 /// <p>If <code>HomeDirectoryType</code> is <code>LOGICAL</code>, you must provide mappings, using the <code>HomeDirectoryMappings</code> parameter. If, on the other hand, <code>HomeDirectoryType</code> is <code>PATH</code>, you provide an absolute path using the <code>HomeDirectory</code> parameter. You cannot have both <code>HomeDirectory</code> and <code>HomeDirectoryMappings</code> in your template.</p>
171 /// </note>
172 pub fn home_directory_type(mut self, input: crate::types::HomeDirectoryType) -> Self {
173 self.home_directory_type = ::std::option::Option::Some(input);
174 self
175 }
176 /// <p>The type of landing directory (folder) that you want your users' home directory to be when they log in to the server. If you set it to <code>PATH</code>, the user will see the absolute Amazon S3 bucket or Amazon EFS path as is in their file transfer protocol clients. If you set it to <code>LOGICAL</code>, you need to provide mappings in the <code>HomeDirectoryMappings</code> for how you want to make Amazon S3 or Amazon EFS paths visible to your users.</p><note>
177 /// <p>If <code>HomeDirectoryType</code> is <code>LOGICAL</code>, you must provide mappings, using the <code>HomeDirectoryMappings</code> parameter. If, on the other hand, <code>HomeDirectoryType</code> is <code>PATH</code>, you provide an absolute path using the <code>HomeDirectory</code> parameter. You cannot have both <code>HomeDirectory</code> and <code>HomeDirectoryMappings</code> in your template.</p>
178 /// </note>
179 pub fn set_home_directory_type(mut self, input: ::std::option::Option<crate::types::HomeDirectoryType>) -> Self {
180 self.home_directory_type = input;
181 self
182 }
183 /// <p>The type of landing directory (folder) that you want your users' home directory to be when they log in to the server. If you set it to <code>PATH</code>, the user will see the absolute Amazon S3 bucket or Amazon EFS path as is in their file transfer protocol clients. If you set it to <code>LOGICAL</code>, you need to provide mappings in the <code>HomeDirectoryMappings</code> for how you want to make Amazon S3 or Amazon EFS paths visible to your users.</p><note>
184 /// <p>If <code>HomeDirectoryType</code> is <code>LOGICAL</code>, you must provide mappings, using the <code>HomeDirectoryMappings</code> parameter. If, on the other hand, <code>HomeDirectoryType</code> is <code>PATH</code>, you provide an absolute path using the <code>HomeDirectory</code> parameter. You cannot have both <code>HomeDirectory</code> and <code>HomeDirectoryMappings</code> in your template.</p>
185 /// </note>
186 pub fn get_home_directory_type(&self) -> &::std::option::Option<crate::types::HomeDirectoryType> {
187 &self.home_directory_type
188 }
189 /// Appends an item to `home_directory_mappings`.
190 ///
191 /// To override the contents of this collection use [`set_home_directory_mappings`](Self::set_home_directory_mappings).
192 ///
193 /// <p>Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should be visible to your user and how you want to make them visible. You must specify the <code>Entry</code> and <code>Target</code> pair, where <code>Entry</code> shows how the path is made visible and <code>Target</code> is the actual Amazon S3 or Amazon EFS path. If you only specify a target, it is displayed as is. You also must ensure that your Identity and Access Management (IAM) role provides access to paths in <code>Target</code>. This value can be set only when <code>HomeDirectoryType</code> is set to <i>LOGICAL</i>.</p>
194 /// <p>The following is an <code>Entry</code> and <code>Target</code> pair example.</p>
195 /// <p><code>\[ { "Entry": "/directory1", "Target": "/bucket_name/home/mydirectory" } \]</code></p>
196 /// <p>In most cases, you can use this value instead of the session policy to lock your user down to the designated home directory ("<code>chroot</code>"). To do this, you can set <code>Entry</code> to <code>/</code> and set <code>Target</code> to the value the user should see for their home directory when they log in.</p>
197 /// <p>The following is an <code>Entry</code> and <code>Target</code> pair example for <code>chroot</code>.</p>
198 /// <p><code>\[ { "Entry": "/", "Target": "/bucket_name/home/mydirectory" } \]</code></p>
199 pub fn home_directory_mappings(mut self, input: crate::types::HomeDirectoryMapEntry) -> Self {
200 let mut v = self.home_directory_mappings.unwrap_or_default();
201 v.push(input);
202 self.home_directory_mappings = ::std::option::Option::Some(v);
203 self
204 }
205 /// <p>Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should be visible to your user and how you want to make them visible. You must specify the <code>Entry</code> and <code>Target</code> pair, where <code>Entry</code> shows how the path is made visible and <code>Target</code> is the actual Amazon S3 or Amazon EFS path. If you only specify a target, it is displayed as is. You also must ensure that your Identity and Access Management (IAM) role provides access to paths in <code>Target</code>. This value can be set only when <code>HomeDirectoryType</code> is set to <i>LOGICAL</i>.</p>
206 /// <p>The following is an <code>Entry</code> and <code>Target</code> pair example.</p>
207 /// <p><code>\[ { "Entry": "/directory1", "Target": "/bucket_name/home/mydirectory" } \]</code></p>
208 /// <p>In most cases, you can use this value instead of the session policy to lock your user down to the designated home directory ("<code>chroot</code>"). To do this, you can set <code>Entry</code> to <code>/</code> and set <code>Target</code> to the value the user should see for their home directory when they log in.</p>
209 /// <p>The following is an <code>Entry</code> and <code>Target</code> pair example for <code>chroot</code>.</p>
210 /// <p><code>\[ { "Entry": "/", "Target": "/bucket_name/home/mydirectory" } \]</code></p>
211 pub fn set_home_directory_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::HomeDirectoryMapEntry>>) -> Self {
212 self.home_directory_mappings = input;
213 self
214 }
215 /// <p>Logical directory mappings that specify what Amazon S3 or Amazon EFS paths and keys should be visible to your user and how you want to make them visible. You must specify the <code>Entry</code> and <code>Target</code> pair, where <code>Entry</code> shows how the path is made visible and <code>Target</code> is the actual Amazon S3 or Amazon EFS path. If you only specify a target, it is displayed as is. You also must ensure that your Identity and Access Management (IAM) role provides access to paths in <code>Target</code>. This value can be set only when <code>HomeDirectoryType</code> is set to <i>LOGICAL</i>.</p>
216 /// <p>The following is an <code>Entry</code> and <code>Target</code> pair example.</p>
217 /// <p><code>\[ { "Entry": "/directory1", "Target": "/bucket_name/home/mydirectory" } \]</code></p>
218 /// <p>In most cases, you can use this value instead of the session policy to lock your user down to the designated home directory ("<code>chroot</code>"). To do this, you can set <code>Entry</code> to <code>/</code> and set <code>Target</code> to the value the user should see for their home directory when they log in.</p>
219 /// <p>The following is an <code>Entry</code> and <code>Target</code> pair example for <code>chroot</code>.</p>
220 /// <p><code>\[ { "Entry": "/", "Target": "/bucket_name/home/mydirectory" } \]</code></p>
221 pub fn get_home_directory_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::HomeDirectoryMapEntry>> {
222 &self.home_directory_mappings
223 }
224 /// <p>A session policy for your user so that you can use the same Identity and Access Management (IAM) role across multiple users. This policy scopes down a user's access to portions of their Amazon S3 bucket. Variables that you can use inside this policy include <code>${Transfer:UserName}</code>, <code>${Transfer:HomeDirectory}</code>, and <code>${Transfer:HomeBucket}</code>.</p><note>
225 /// <p>This policy applies only when the domain of <code>ServerId</code> is Amazon S3. Amazon EFS does not use session policies.</p>
226 /// <p>For session policies, Transfer Family stores the policy as a JSON blob, instead of the Amazon Resource Name (ARN) of the policy. You save the policy as a JSON blob and pass it in the <code>Policy</code> argument.</p>
227 /// <p>For an example of a session policy, see <a href="https://docs.aws.amazon.com/transfer/latest/userguide/session-policy.html">Example session policy</a>.</p>
228 /// <p>For more information, see <a href="https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html">AssumeRole</a> in the <i>Amazon Web Services Security Token Service API Reference</i>.</p>
229 /// </note>
230 pub fn policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
231 self.policy = ::std::option::Option::Some(input.into());
232 self
233 }
234 /// <p>A session policy for your user so that you can use the same Identity and Access Management (IAM) role across multiple users. This policy scopes down a user's access to portions of their Amazon S3 bucket. Variables that you can use inside this policy include <code>${Transfer:UserName}</code>, <code>${Transfer:HomeDirectory}</code>, and <code>${Transfer:HomeBucket}</code>.</p><note>
235 /// <p>This policy applies only when the domain of <code>ServerId</code> is Amazon S3. Amazon EFS does not use session policies.</p>
236 /// <p>For session policies, Transfer Family stores the policy as a JSON blob, instead of the Amazon Resource Name (ARN) of the policy. You save the policy as a JSON blob and pass it in the <code>Policy</code> argument.</p>
237 /// <p>For an example of a session policy, see <a href="https://docs.aws.amazon.com/transfer/latest/userguide/session-policy.html">Example session policy</a>.</p>
238 /// <p>For more information, see <a href="https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html">AssumeRole</a> in the <i>Amazon Web Services Security Token Service API Reference</i>.</p>
239 /// </note>
240 pub fn set_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
241 self.policy = input;
242 self
243 }
244 /// <p>A session policy for your user so that you can use the same Identity and Access Management (IAM) role across multiple users. This policy scopes down a user's access to portions of their Amazon S3 bucket. Variables that you can use inside this policy include <code>${Transfer:UserName}</code>, <code>${Transfer:HomeDirectory}</code>, and <code>${Transfer:HomeBucket}</code>.</p><note>
245 /// <p>This policy applies only when the domain of <code>ServerId</code> is Amazon S3. Amazon EFS does not use session policies.</p>
246 /// <p>For session policies, Transfer Family stores the policy as a JSON blob, instead of the Amazon Resource Name (ARN) of the policy. You save the policy as a JSON blob and pass it in the <code>Policy</code> argument.</p>
247 /// <p>For an example of a session policy, see <a href="https://docs.aws.amazon.com/transfer/latest/userguide/session-policy.html">Example session policy</a>.</p>
248 /// <p>For more information, see <a href="https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html">AssumeRole</a> in the <i>Amazon Web Services Security Token Service API Reference</i>.</p>
249 /// </note>
250 pub fn get_policy(&self) -> &::std::option::Option<::std::string::String> {
251 &self.policy
252 }
253 /// <p>Specifies the full POSIX identity, including user ID (<code>Uid</code>), group ID (<code>Gid</code>), and any secondary groups IDs (<code>SecondaryGids</code>), that controls your users' access to your Amazon EFS file systems. The POSIX permissions that are set on files and directories in Amazon EFS determine the level of access your users get when transferring files into and out of your Amazon EFS file systems.</p>
254 pub fn posix_profile(mut self, input: crate::types::PosixProfile) -> Self {
255 self.posix_profile = ::std::option::Option::Some(input);
256 self
257 }
258 /// <p>Specifies the full POSIX identity, including user ID (<code>Uid</code>), group ID (<code>Gid</code>), and any secondary groups IDs (<code>SecondaryGids</code>), that controls your users' access to your Amazon EFS file systems. The POSIX permissions that are set on files and directories in Amazon EFS determine the level of access your users get when transferring files into and out of your Amazon EFS file systems.</p>
259 pub fn set_posix_profile(mut self, input: ::std::option::Option<crate::types::PosixProfile>) -> Self {
260 self.posix_profile = input;
261 self
262 }
263 /// <p>Specifies the full POSIX identity, including user ID (<code>Uid</code>), group ID (<code>Gid</code>), and any secondary groups IDs (<code>SecondaryGids</code>), that controls your users' access to your Amazon EFS file systems. The POSIX permissions that are set on files and directories in Amazon EFS determine the level of access your users get when transferring files into and out of your Amazon EFS file systems.</p>
264 pub fn get_posix_profile(&self) -> &::std::option::Option<crate::types::PosixProfile> {
265 &self.posix_profile
266 }
267 /// <p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that controls your users' access to your Amazon S3 bucket or Amazon EFS file system. The policies attached to this role determine the level of access that you want to provide your users when transferring files into and out of your Amazon S3 bucket or Amazon EFS file system. The IAM role should also contain a trust relationship that allows the server to access your resources when servicing your users' transfer requests.</p>
268 /// This field is required.
269 pub fn role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
270 self.role = ::std::option::Option::Some(input.into());
271 self
272 }
273 /// <p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that controls your users' access to your Amazon S3 bucket or Amazon EFS file system. The policies attached to this role determine the level of access that you want to provide your users when transferring files into and out of your Amazon S3 bucket or Amazon EFS file system. The IAM role should also contain a trust relationship that allows the server to access your resources when servicing your users' transfer requests.</p>
274 pub fn set_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
275 self.role = input;
276 self
277 }
278 /// <p>The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that controls your users' access to your Amazon S3 bucket or Amazon EFS file system. The policies attached to this role determine the level of access that you want to provide your users when transferring files into and out of your Amazon S3 bucket or Amazon EFS file system. The IAM role should also contain a trust relationship that allows the server to access your resources when servicing your users' transfer requests.</p>
279 pub fn get_role(&self) -> &::std::option::Option<::std::string::String> {
280 &self.role
281 }
282 /// <p>A system-assigned unique identifier for a server instance. This is the specific server that you added your user to.</p>
283 /// This field is required.
284 pub fn server_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
285 self.server_id = ::std::option::Option::Some(input.into());
286 self
287 }
288 /// <p>A system-assigned unique identifier for a server instance. This is the specific server that you added your user to.</p>
289 pub fn set_server_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
290 self.server_id = input;
291 self
292 }
293 /// <p>A system-assigned unique identifier for a server instance. This is the specific server that you added your user to.</p>
294 pub fn get_server_id(&self) -> &::std::option::Option<::std::string::String> {
295 &self.server_id
296 }
297 /// <p>The public portion of the Secure Shell (SSH) key used to authenticate the user to the server.</p>
298 /// <p>The three standard SSH public key format elements are <code><key type></code>, <code><body base64></code>, and an optional <code><comment></code>, with spaces between each element.</p>
299 /// <p>Transfer Family accepts RSA, ECDSA, and ED25519 keys.</p>
300 /// <ul>
301 /// <li>
302 /// <p>For RSA keys, the key type is <code>ssh-rsa</code>.</p></li>
303 /// <li>
304 /// <p>For ED25519 keys, the key type is <code>ssh-ed25519</code>.</p></li>
305 /// <li>
306 /// <p>For ECDSA keys, the key type is either <code>ecdsa-sha2-nistp256</code>, <code>ecdsa-sha2-nistp384</code>, or <code>ecdsa-sha2-nistp521</code>, depending on the size of the key you generated.</p></li>
307 /// </ul>
308 pub fn ssh_public_key_body(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
309 self.ssh_public_key_body = ::std::option::Option::Some(input.into());
310 self
311 }
312 /// <p>The public portion of the Secure Shell (SSH) key used to authenticate the user to the server.</p>
313 /// <p>The three standard SSH public key format elements are <code><key type></code>, <code><body base64></code>, and an optional <code><comment></code>, with spaces between each element.</p>
314 /// <p>Transfer Family accepts RSA, ECDSA, and ED25519 keys.</p>
315 /// <ul>
316 /// <li>
317 /// <p>For RSA keys, the key type is <code>ssh-rsa</code>.</p></li>
318 /// <li>
319 /// <p>For ED25519 keys, the key type is <code>ssh-ed25519</code>.</p></li>
320 /// <li>
321 /// <p>For ECDSA keys, the key type is either <code>ecdsa-sha2-nistp256</code>, <code>ecdsa-sha2-nistp384</code>, or <code>ecdsa-sha2-nistp521</code>, depending on the size of the key you generated.</p></li>
322 /// </ul>
323 pub fn set_ssh_public_key_body(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
324 self.ssh_public_key_body = input;
325 self
326 }
327 /// <p>The public portion of the Secure Shell (SSH) key used to authenticate the user to the server.</p>
328 /// <p>The three standard SSH public key format elements are <code><key type></code>, <code><body base64></code>, and an optional <code><comment></code>, with spaces between each element.</p>
329 /// <p>Transfer Family accepts RSA, ECDSA, and ED25519 keys.</p>
330 /// <ul>
331 /// <li>
332 /// <p>For RSA keys, the key type is <code>ssh-rsa</code>.</p></li>
333 /// <li>
334 /// <p>For ED25519 keys, the key type is <code>ssh-ed25519</code>.</p></li>
335 /// <li>
336 /// <p>For ECDSA keys, the key type is either <code>ecdsa-sha2-nistp256</code>, <code>ecdsa-sha2-nistp384</code>, or <code>ecdsa-sha2-nistp521</code>, depending on the size of the key you generated.</p></li>
337 /// </ul>
338 pub fn get_ssh_public_key_body(&self) -> &::std::option::Option<::std::string::String> {
339 &self.ssh_public_key_body
340 }
341 /// Appends an item to `tags`.
342 ///
343 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
344 ///
345 /// <p>Key-value pairs that can be used to group and search for users. Tags are metadata attached to users for any purpose.</p>
346 pub fn tags(mut self, input: crate::types::Tag) -> Self {
347 let mut v = self.tags.unwrap_or_default();
348 v.push(input);
349 self.tags = ::std::option::Option::Some(v);
350 self
351 }
352 /// <p>Key-value pairs that can be used to group and search for users. Tags are metadata attached to users for any purpose.</p>
353 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
354 self.tags = input;
355 self
356 }
357 /// <p>Key-value pairs that can be used to group and search for users. Tags are metadata attached to users for any purpose.</p>
358 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
359 &self.tags
360 }
361 /// <p>A unique string that identifies a user and is associated with a <code>ServerId</code>. This user name must be a minimum of 3 and a maximum of 100 characters long. The following are valid characters: a-z, A-Z, 0-9, underscore '_', hyphen '-', period '.', and at sign '@'. The user name can't start with a hyphen, period, or at sign.</p>
362 /// This field is required.
363 pub fn user_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
364 self.user_name = ::std::option::Option::Some(input.into());
365 self
366 }
367 /// <p>A unique string that identifies a user and is associated with a <code>ServerId</code>. This user name must be a minimum of 3 and a maximum of 100 characters long. The following are valid characters: a-z, A-Z, 0-9, underscore '_', hyphen '-', period '.', and at sign '@'. The user name can't start with a hyphen, period, or at sign.</p>
368 pub fn set_user_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
369 self.user_name = input;
370 self
371 }
372 /// <p>A unique string that identifies a user and is associated with a <code>ServerId</code>. This user name must be a minimum of 3 and a maximum of 100 characters long. The following are valid characters: a-z, A-Z, 0-9, underscore '_', hyphen '-', period '.', and at sign '@'. The user name can't start with a hyphen, period, or at sign.</p>
373 pub fn get_user_name(&self) -> &::std::option::Option<::std::string::String> {
374 &self.user_name
375 }
376 /// Consumes the builder and constructs a [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
377 pub fn build(self) -> ::std::result::Result<crate::operation::create_user::CreateUserInput, ::aws_smithy_types::error::operation::BuildError> {
378 ::std::result::Result::Ok(crate::operation::create_user::CreateUserInput {
379 home_directory: self.home_directory,
380 home_directory_type: self.home_directory_type,
381 home_directory_mappings: self.home_directory_mappings,
382 policy: self.policy,
383 posix_profile: self.posix_profile,
384 role: self.role,
385 server_id: self.server_id,
386 ssh_public_key_body: self.ssh_public_key_body,
387 tags: self.tags,
388 user_name: self.user_name,
389 })
390 }
391}