create_user
¶
create_user(
organization_id: OrganizationId,
name: UserName,
display_name: UserAttribute,
*,
config_overrides: Optional[WorkMailClientConfig] = None,
password: Optional[Password] = None,
role: Optional[UserRole] = None,
first_name: Optional[UserAttribute] = None,
last_name: Optional[UserAttribute] = None,
hidden_from_global_address_list: Optional[Boolean] = None,
identity_provider_user_id: Optional[IdentityProviderUserId] = None,
) -> CreateUserResponse
Creates a user who can be used in WorkMail by calling the RegisterToWorkMail operation.
Parameters:
-
organization_id(OrganizationId) –The identifier of the organization for which the user is created.
-
name(UserName) –The name for the new user. WorkMail directory user names have a maximum length of 64. All others have a maximum length of 20.
-
display_name(UserAttribute) –The display name for the new user.
-
password(Optional[Password], default:None) –The password for the new user.
-
role(Optional[UserRole], default:None) –The role of the new user.
You cannot pass SYSTEM_USER or RESOURCE role in a single request. When a user role is not selected, the default role of USER is selected.
-
first_name(Optional[UserAttribute], default:None) –The first name of the new user.
-
last_name(Optional[UserAttribute], default:None) –The last name of the new user.
-
hidden_from_global_address_list(Optional[Boolean], default:None) –If this parameter is enabled, the user will be hidden from the address book.
-
identity_provider_user_id(Optional[IdentityProviderUserId], default:None) –User ID from the IAM Identity Center. If this parameter is empty it will be updated automatically when the user logs in for the first time to the mailbox associated with WorkMail.
Raises:
-
DirectoryServiceAuthenticationFailedException–The directory service doesn't recognize the credentials supplied by WorkMail.
-
DirectoryUnavailableException–The directory is unavailable. It might be located in another Region or deleted.
-
InvalidParameterException–One or more of the input parameters don't match the service's restrictions.
-
InvalidPasswordException–The supplied password doesn't match the minimum security constraints, such as length or use of special characters.
-
NameAvailabilityException–The user, group, or resource name isn't unique in WorkMail.
-
OrganizationNotFoundException–An operation received a valid organization identifier that either doesn't belong or exist in the system.
-
OrganizationStateException–The organization must have a valid state to perform certain operations on the organization or its members.
-
ReservedNameException–This user, group, or resource name is not allowed in WorkMail.
-
UnsupportedOperationException–You can't perform a write operation against a read-only directory.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_workmail/_services/work_mail.py
1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 | |