Skip to content

reset_user_password async

reset_user_password(
    user_id: UserId,
    *,
    config_overrides: Optional[AsyncfinspacedataClientConfig] = None,
    client_token: Optional[ClientToken] = None,
) -> ResetUserPasswordResponse

Resets the password for a specified user ID and generates a temporary one. Only a superuser can reset password for other users. Resetting the password immediately invalidates the previous password associated with the user.

Parameters:

  • user_id (UserId) –

    The unique identifier of the user that a temporary password is requested for.

  • client_token (Optional[ClientToken], default: None ) –

    A token that ensures idempotency. This token expires in 10 minutes.

Raises:

Source code in docs_src/capo_finspace_data/_services/async_finspacedata.py
async def reset_user_password(
    self,
    user_id: "capo_finspace_data.types.user_id.UserId",
    *,
    config_overrides: Optional[AsyncfinspacedataClientConfig] = None,
    client_token: Optional[
        "capo_finspace_data.types.client_token.ClientToken"
    ] = None,
) -> "capo_finspace_data.types.reset_user_password_response.ResetUserPasswordResponse":
    """<p>Resets the password for a specified user ID and generates a temporary one. Only a superuser can reset password for other users. Resetting the password immediately invalidates the previous password associated with the user.</p>

    Args:
        user_id: <p>The unique identifier of the user that a temporary password is requested for.</p>
        client_token: <p>A token that ensures idempotency. This token expires in 10 minutes.</p>

    Raises:
        capo_finspace_data.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_finspace_data.errors.conflict_exception.ConflictException: <p>The request conflicts with an existing resource.</p>
        capo_finspace_data.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_finspace_data.errors.resource_not_found_exception.ResourceNotFoundException: <p>One or more resources can't be found.</p>
        capo_finspace_data.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_finspace_data.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an AWS service.</p>
        capo_finspace_data.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_finspace_data.types.reset_user_password_request.ResetUserPasswordRequest]",
    ) -> AsyncOperationResponse[
        "capo_finspace_data.types.reset_user_password_response.ResetUserPasswordResponse"
    ]:
        import capo_finspace_data._operations.aws_habanero_public_api.reset_user_password

        (
            output,
            http_response,
        ) = await capo_finspace_data._operations.aws_habanero_public_api.reset_user_password.async_reset_user_password(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_finspace_data.types.reset_user_password_response.ResetUserPasswordResponse",
    ) -> dict[str, Any]:
        import capo_finspace_data.types.reset_user_password_response

        return (
            capo_finspace_data.types.reset_user_password_response.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("ResetUserPassword", redact_output=_redact_output),
    )
    input_: capo_finspace_data.types.reset_user_password_request.ResetUserPasswordRequest = {
        "user_id": user_id
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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