Skip to content

update_user async

update_user(
    user_id: IdType,
    *,
    config_overrides: Optional[AsyncWorkDocsClientConfig] = None,
    authentication_token: Optional[AuthenticationHeaderType] = None,
    given_name: Optional[UserAttributeValueType] = None,
    surname: Optional[UserAttributeValueType] = None,
    type: Optional[UserType] = None,
    storage_rule: Optional[StorageRuleType] = None,
    time_zone_id: Optional[TimeZoneIdType] = None,
    locale: Optional[LocaleType] = None,
    grant_poweruser_privileges: Optional[BooleanEnumType] = None,
) -> UpdateUserResponse

Updates the specified attributes of the specified user, and grants or revokes administrative privileges to the Amazon WorkDocs site.

Parameters:

Raises:

Source code in docs_src/capo_workdocs/_services/async_work_docs.py
async def update_user(
    self,
    user_id: "capo_workdocs.types.id_type.IdType",
    *,
    config_overrides: Optional[AsyncWorkDocsClientConfig] = None,
    authentication_token: Optional[
        "capo_workdocs.types.authentication_header_type.AuthenticationHeaderType"
    ] = None,
    given_name: Optional[
        "capo_workdocs.types.user_attribute_value_type.UserAttributeValueType"
    ] = None,
    surname: Optional[
        "capo_workdocs.types.user_attribute_value_type.UserAttributeValueType"
    ] = None,
    type: Optional["capo_workdocs.types.user_type.UserType"] = None,
    storage_rule: Optional[
        "capo_workdocs.types.storage_rule_type.StorageRuleType"
    ] = None,
    time_zone_id: Optional[
        "capo_workdocs.types.time_zone_id_type.TimeZoneIdType"
    ] = None,
    locale: Optional["capo_workdocs.types.locale_type.LocaleType"] = None,
    grant_poweruser_privileges: Optional[
        "capo_workdocs.types.boolean_enum_type.BooleanEnumType"
    ] = None,
) -> "capo_workdocs.types.update_user_response.UpdateUserResponse":
    """<p>Updates the specified attributes of the specified user, and grants or revokes administrative privileges to the Amazon WorkDocs site.</p>

    Args:
        authentication_token: <p>Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.</p>
        user_id: <p>The ID of the user.</p>
        given_name: <p>The given name of the user.</p>
        surname: <p>The surname of the user.</p>
        type: <p>The type of the user.</p>
        storage_rule: <p>The amount of storage for the user.</p>
        time_zone_id: <p>The time zone ID of the user.</p>
        locale: <p>The locale of the user.</p>
        grant_poweruser_privileges: <p>Boolean value to determine whether the user is granted Power user privileges.</p>

    Raises:
        capo_workdocs.errors.deactivating_last_system_user_exception.DeactivatingLastSystemUserException: <p>The last user in the organization is being deactivated.</p>
        capo_workdocs.errors.entity_not_exists_exception.EntityNotExistsException: <p>The resource does not exist.</p>
        capo_workdocs.errors.failed_dependency_exception.FailedDependencyException: <p>The Directory Service cannot reach an on-premises instance. Or a dependency under the control of the organization is failing, such as a connected Active Directory.</p>
        capo_workdocs.errors.illegal_user_state_exception.IllegalUserStateException: <p>The user is undergoing transfer of ownership.</p>
        capo_workdocs.errors.invalid_argument_exception.InvalidArgumentException: <p>The pagination marker or limit fields are not valid.</p>
        capo_workdocs.errors.prohibited_state_exception.ProhibitedStateException: <p>The specified document version is not in the INITIALIZED state.</p>
        capo_workdocs.errors.service_unavailable_exception.ServiceUnavailableException: <p>One or more of the dependencies is unavailable.</p>
        capo_workdocs.errors.unauthorized_operation_exception.UnauthorizedOperationException: <p>The operation is not permitted.</p>
        capo_workdocs.errors.unauthorized_resource_access_exception.UnauthorizedResourceAccessException: <p>The caller does not have access to perform the action on the resource.</p>
        capo_workdocs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_workdocs.types.update_user_request.UpdateUserRequest]",
    ) -> AsyncOperationResponse[
        "capo_workdocs.types.update_user_response.UpdateUserResponse"
    ]:
        import capo_workdocs._operations.aws_gorilla_boy_service.update_user

        (
            output,
            http_response,
        ) = await capo_workdocs._operations.aws_gorilla_boy_service.update_user.async_update_user(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_workdocs.types.update_user_request.UpdateUserRequest",
    ) -> dict[str, Any]:
        import capo_workdocs.types.update_user_request

        return capo_workdocs.types.update_user_request.redact_sensitive(input_)

    def _redact_output(
        output: "capo_workdocs.types.update_user_response.UpdateUserResponse",
    ) -> dict[str, Any]:
        import capo_workdocs.types.update_user_response

        return capo_workdocs.types.update_user_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateUser", redact_input=_redact_input, redact_output=_redact_output
        ),
    )
    input_: capo_workdocs.types.update_user_request.UpdateUserRequest = {
        "user_id": user_id
    }
    if authentication_token is not None:
        input_["authentication_token"] = authentication_token
    if given_name is not None:
        input_["given_name"] = given_name
    if surname is not None:
        input_["surname"] = surname
    if type is not None:
        input_["type"] = type
    if storage_rule is not None:
        input_["storage_rule"] = storage_rule
    if time_zone_id is not None:
        input_["time_zone_id"] = time_zone_id
    if locale is not None:
        input_["locale"] = locale
    if grant_poweruser_privileges is not None:
        input_["grant_poweruser_privileges"] = grant_poweruser_privileges

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output