Skip to content

delete_user async

delete_user(
    user_id: IdType,
    *,
    config_overrides: Optional[AsyncWorkDocsClientConfig] = None,
    authentication_token: Optional[AuthenticationHeaderType] = None,
) -> None

Deletes the specified user from a Simple AD or Microsoft AD directory.

Deleting a user immediately and permanently deletes all content in that user's folder structure. Site retention policies do NOT apply to this type of deletion.

Parameters:

  • authentication_token (Optional[AuthenticationHeaderType], default: None ) –

    Amazon WorkDocs authentication token. Do not set this field when using administrative API actions, as in accessing the API using Amazon Web Services credentials.

  • user_id (IdType) –

    The ID of the user.

Raises:

Source code in docs_src/capo_workdocs/_services/async_work_docs.py
async def delete_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,
) -> None:
    """<p>Deletes the specified user from a Simple AD or Microsoft AD directory.</p> <important> <p>Deleting a user immediately and permanently deletes all content in that user's folder structure. Site retention policies do NOT apply to this type of deletion.</p> </important>

    Args:
        authentication_token: <p>Amazon WorkDocs authentication token. Do not set this field when using administrative API actions, as in accessing the API using Amazon Web Services credentials.</p>
        user_id: <p>The ID of the user.</p>

    Raises:
        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.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.delete_user_request.DeleteUserRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_workdocs._operations.aws_gorilla_boy_service.delete_user

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

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

        return capo_workdocs.types.delete_user_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteUser", redact_input=_redact_input)
    )
    input_: capo_workdocs.types.delete_user_request.DeleteUserRequest = {
        "user_id": user_id
    }
    if authentication_token is not None:
        input_["authentication_token"] = authentication_token

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