Skip to content

enable_user async

enable_user(
    *,
    config_overrides: Optional[AsyncAppStreamClientConfig] = None,
    user_name: Optional[Username] = None,
    authentication_type: Optional[AuthenticationType] = None,
) -> EnableUserResult

Enables a user in the user pool. After being enabled, users can sign in to WorkSpaces Applications and open applications from the stacks to which they are assigned.

Parameters:

  • user_name (Optional[Username], default: None ) –

    The email address of the user.

    Users' email addresses are case-sensitive. During login, if they specify an email address that doesn't use the same capitalization as the email address specified when their user pool account was created, a "user does not exist" error message displays.

  • authentication_type (Optional[AuthenticationType], default: None ) –

    The authentication type for the user. You must specify USERPOOL.

Raises:

Source code in docs_src/capo_appstream/_services/async_app_stream.py
async def enable_user(
    self,
    *,
    config_overrides: Optional[AsyncAppStreamClientConfig] = None,
    user_name: Optional["capo_appstream.types.username.Username"] = None,
    authentication_type: Optional[
        "capo_appstream.types.authentication_type.AuthenticationType"
    ] = None,
) -> "capo_appstream.types.enable_user_result.EnableUserResult":
    """<p>Enables a user in the user pool. After being enabled, users can sign in to WorkSpaces Applications and open applications from the stacks to which they are assigned.</p>

    Args:
        user_name: <p>The email address of the user.</p> <note> <p>Users' email addresses are case-sensitive. During login, if they specify an email address that doesn't use the same capitalization as the email address specified when their user pool account was created, a "user does not exist" error message displays. </p> </note>
        authentication_type: <p>The authentication type for the user. You must specify USERPOOL.</p>

    Raises:
        capo_appstream.errors.invalid_account_status_exception.InvalidAccountStatusException: <p>The resource cannot be created because your AWS account is suspended. For assistance, contact AWS Support. </p>
        capo_appstream.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_appstream.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_appstream.types.enable_user_request.EnableUserRequest]",
    ) -> AsyncOperationResponse[
        "capo_appstream.types.enable_user_result.EnableUserResult"
    ]:
        import capo_appstream._operations.photon_admin_proxy_service.enable_user

        (
            output,
            http_response,
        ) = await capo_appstream._operations.photon_admin_proxy_service.enable_user.async_enable_user(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_appstream.types.enable_user_request.EnableUserRequest",
    ) -> dict[str, Any]:
        import capo_appstream.types.enable_user_request

        return capo_appstream.types.enable_user_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("EnableUser", redact_input=_redact_input)
    )
    input_: capo_appstream.types.enable_user_request.EnableUserRequest = {}
    if user_name is not None:
        input_["user_name"] = user_name
    if authentication_type is not None:
        input_["authentication_type"] = authentication_type

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