Skip to content

get_session async

get_session(
    portal_id: PortalId,
    session_id: SessionId,
    *,
    config_overrides: Optional[AsyncWorkSpacesWebClientConfig] = None,
) -> GetSessionResponse

Gets information for a secure browser session.

Parameters:

  • portal_id (PortalId) –

    The ID of the web portal for the session.

  • session_id (SessionId) –

    The ID of the session.

Raises:

Source code in docs_src/capo_workspaces_web/_services/async_work_spaces_web.py
async def get_session(
    self,
    portal_id: "capo_workspaces_web.types.portal_id.PortalId",
    session_id: "capo_workspaces_web.types.session_id.SessionId",
    *,
    config_overrides: Optional[AsyncWorkSpacesWebClientConfig] = None,
) -> "capo_workspaces_web.types.get_session_response.GetSessionResponse":
    """<p>Gets information for a secure browser session.</p>

    Args:
        portal_id: <p>The ID of the web portal for the session.</p>
        session_id: <p>The ID of the session.</p>

    Raises:
        capo_workspaces_web.errors.access_denied_exception.AccessDeniedException: <p>Access is denied.</p>
        capo_workspaces_web.errors.internal_server_exception.InternalServerException: <p>There is an internal server error.</p>
        capo_workspaces_web.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource cannot be found.</p>
        capo_workspaces_web.errors.throttling_exception.ThrottlingException: <p>There is a throttling error.</p>
        capo_workspaces_web.errors.validation_exception.ValidationException: <p>There is a validation error.</p>
        capo_workspaces_web.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_workspaces_web.types.get_session_request.GetSessionRequest]",
    ) -> AsyncOperationResponse[
        "capo_workspaces_web.types.get_session_response.GetSessionResponse"
    ]:
        import capo_workspaces_web._operations.aws_ermine_control_plane_service.get_session

        (
            output,
            http_response,
        ) = await capo_workspaces_web._operations.aws_ermine_control_plane_service.get_session.async_get_session(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_workspaces_web.types.get_session_response.GetSessionResponse",
    ) -> dict[str, Any]:
        import capo_workspaces_web.types.get_session_response

        return capo_workspaces_web.types.get_session_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("GetSession", redact_output=_redact_output),
    )
    input_: capo_workspaces_web.types.get_session_request.GetSessionRequest = {
        "portal_id": portal_id,
        "session_id": session_id,
    }

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