update_user
async
¶
update_user(
organization_id: OrganizationId,
user_id: EntityIdentifier,
*,
config_overrides: Optional[AsyncWorkMailClientConfig] = None,
role: Optional[UserRole] = None,
display_name: Optional[UserAttribute] = None,
first_name: Optional[UserAttribute] = None,
last_name: Optional[UserAttribute] = None,
hidden_from_global_address_list: Optional[BooleanObject] = None,
initials: Optional[UserAttribute] = None,
telephone: Optional[UserAttribute] = None,
street: Optional[UserAttribute] = None,
job_title: Optional[UserAttribute] = None,
city: Optional[UserAttribute] = None,
company: Optional[UserAttribute] = None,
zip_code: Optional[UserAttribute] = None,
department: Optional[UserAttribute] = None,
country: Optional[UserAttribute] = None,
office: Optional[UserAttribute] = None,
identity_provider_user_id: Optional[IdentityProviderUserIdForUpdate] = None,
) -> UpdateUserResponse
Updates data for the user. To have the latest information, it must be preceded by a DescribeUser call. The dataset in the request should be the one expected when performing another DescribeUser call.
Parameters:
-
organization_id(OrganizationId) –The identifier for the organization under which the user exists.
-
user_id(EntityIdentifier) –The identifier for the user to be updated.
The identifier can be the UserId, Username, or email. The following identity formats are available:
-
User ID: 12345678-1234-1234-1234-123456789012 or S-1-1-12-1234567890-123456789-123456789-1234
-
Email address: [email protected]
-
User name: user
-
-
role(Optional[UserRole], default:None) –Updates the user role.
You cannot pass SYSTEM_USER or RESOURCE.
-
display_name(Optional[UserAttribute], default:None) –Updates the display name of the user.
-
first_name(Optional[UserAttribute], default:None) –Updates the user's first name.
-
last_name(Optional[UserAttribute], default:None) –Updates the user's last name.
-
hidden_from_global_address_list(Optional[BooleanObject], default:None) –If enabled, the user is hidden from the global address list.
-
initials(Optional[UserAttribute], default:None) –Updates the user's initials.
-
telephone(Optional[UserAttribute], default:None) –Updates the user's contact details.
-
street(Optional[UserAttribute], default:None) –Updates the user's street address.
-
job_title(Optional[UserAttribute], default:None) –Updates the user's job title.
-
city(Optional[UserAttribute], default:None) –Updates the user's city.
-
company(Optional[UserAttribute], default:None) –Updates the user's company.
-
zip_code(Optional[UserAttribute], default:None) –Updates the user's zip code.
-
department(Optional[UserAttribute], default:None) –Updates the user's department.
-
country(Optional[UserAttribute], default:None) –Updates the user's country.
-
office(Optional[UserAttribute], default:None) –Updates the user's office.
-
identity_provider_user_id(Optional[IdentityProviderUserIdForUpdate], 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.
-
EntityNotFoundException–The identifier supplied for the user, group, or resource does not exist in your organization.
-
EntityStateException–You are performing an operation on a user, group, or resource that isn't in the expected state, such as trying to delete an active user.
-
InvalidParameterException–One or more of the input parameters don't match the service's restrictions.
-
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.
-
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/async_work_mail.py
6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 | |