async def get_session(
self,
bot_id: "capo_lex_runtime_v2.types.bot_identifier.BotIdentifier",
bot_alias_id: "capo_lex_runtime_v2.types.bot_alias_identifier.BotAliasIdentifier",
locale_id: "capo_lex_runtime_v2.types.locale_id.LocaleId",
session_id: "capo_lex_runtime_v2.types.session_id.SessionId",
*,
config_overrides: Optional[AsyncLexRuntimeV2ClientConfig] = None,
) -> "capo_lex_runtime_v2.types.get_session_response.GetSessionResponse":
"""<p>Returns session information for a specified bot, alias, and user.</p> <p>For example, you can use this operation to retrieve session information for a user that has left a long-running session in use.</p> <p>If the bot, alias, or session identifier doesn't exist, Amazon Lex V2 returns a <code>BadRequestException</code>. If the locale doesn't exist or is not enabled for the alias, you receive a <code>BadRequestException</code>.</p>
Args:
bot_id: <p>The identifier of the bot that contains the session data.</p>
bot_alias_id: <p>The alias identifier in use for the bot that contains the session data.</p>
locale_id: <p>The locale where the session is in use.</p>
session_id: <p>The identifier of the session to return.</p>
Raises:
capo_lex_runtime_v2.errors.access_denied_exception.AccessDeniedException: <p></p>
capo_lex_runtime_v2.errors.internal_server_exception.InternalServerException: <p></p>
capo_lex_runtime_v2.errors.resource_not_found_exception.ResourceNotFoundException: <p></p>
capo_lex_runtime_v2.errors.throttling_exception.ThrottlingException: <p></p>
capo_lex_runtime_v2.errors.validation_exception.ValidationException: <p></p>
capo_lex_runtime_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_lex_runtime_v2.types.get_session_request.GetSessionRequest]",
) -> AsyncOperationResponse[
"capo_lex_runtime_v2.types.get_session_response.GetSessionResponse"
]:
import capo_lex_runtime_v2._operations.aws_deep_sense_run_time_service_api2_0.get_session
(
output,
http_response,
) = await capo_lex_runtime_v2._operations.aws_deep_sense_run_time_service_api2_0.get_session.async_get_session(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_lex_runtime_v2.types.get_session_response.GetSessionResponse",
) -> dict[str, Any]:
import capo_lex_runtime_v2.types.get_session_response
return capo_lex_runtime_v2.types.get_session_response.redact_sensitive(
output
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("GetSession", redact_output=_redact_output),
)
input_: capo_lex_runtime_v2.types.get_session_request.GetSessionRequest = {
"bot_id": bot_id,
"bot_alias_id": bot_alias_id,
"locale_id": locale_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