Skip to content

update_session_data async

update_session_data(
    assistant_id: UuidOrArn,
    session_id: UuidOrArn,
    data: RuntimeSessionDataList,
    *,
    config_overrides: Optional[AsyncQConnectClientConfig] = None,
    namespace: Optional[SessionDataNamespace] = None,
) -> UpdateSessionDataResponse

Updates the data stored on an Amazon Q in Connect Session.

Parameters:

  • assistant_id (UuidOrArn) –

    The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

  • session_id (UuidOrArn) –

    The identifier of the session. Can be either the ID or the ARN. URLs cannot contain the ARN.

  • namespace (Optional[SessionDataNamespace], default: None ) –

    The namespace into which the session data is stored. Supported namespaces are: Custom

  • data (RuntimeSessionDataList) –

    The data stored on the Amazon Q in Connect Session.

Raises:

Source code in docs_src/capo_qconnect/_services/async_q_connect.py
async def update_session_data(
    self,
    assistant_id: "capo_qconnect.types.uuid_or_arn.UuidOrArn",
    session_id: "capo_qconnect.types.uuid_or_arn.UuidOrArn",
    data: "capo_qconnect.types.runtime_session_data_list.RuntimeSessionDataList",
    *,
    config_overrides: Optional[AsyncQConnectClientConfig] = None,
    namespace: Optional[
        "capo_qconnect.types.session_data_namespace.SessionDataNamespace"
    ] = None,
) -> "capo_qconnect.types.update_session_data_response.UpdateSessionDataResponse":
    """<p>Updates the data stored on an Amazon Q in Connect Session.</p>

    Args:
        assistant_id: <p>The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
        session_id: <p>The identifier of the session. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
        namespace: <p>The namespace into which the session data is stored. Supported namespaces are: Custom</p>
        data: <p>The data stored on the Amazon Q in Connect Session.</p>

    Raises:
        capo_qconnect.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_qconnect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_qconnect.errors.unauthorized_exception.UnauthorizedException: <p>You do not have permission to perform this action.</p>
        capo_qconnect.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by a service.</p>
        capo_qconnect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_qconnect.types.update_session_data_request.UpdateSessionDataRequest]",
    ) -> AsyncOperationResponse[
        "capo_qconnect.types.update_session_data_response.UpdateSessionDataResponse"
    ]:
        import capo_qconnect._operations.wisdom_service.update_session_data

        (
            output,
            http_response,
        ) = await capo_qconnect._operations.wisdom_service.update_session_data.async_update_session_data(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_qconnect.types.update_session_data_request.UpdateSessionDataRequest",
    ) -> dict[str, Any]:
        import capo_qconnect.types.update_session_data_request

        return capo_qconnect.types.update_session_data_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_qconnect.types.update_session_data_response.UpdateSessionDataResponse",
    ) -> dict[str, Any]:
        import capo_qconnect.types.update_session_data_response

        return capo_qconnect.types.update_session_data_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateSessionData",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_qconnect.types.update_session_data_request.UpdateSessionDataRequest = {
        "assistant_id": assistant_id,
        "session_id": session_id,
        "data": data,
    }
    if namespace is not None:
        input_["namespace"] = namespace

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