Skip to content

update_session async

update_session(
    assistant_id: UuidOrArn,
    session_id: UuidOrArn,
    *,
    config_overrides: Optional[AsyncQConnectClientConfig] = None,
    description: Optional[Description] = None,
    tag_filter: Optional[TagFilter] = None,
    ai_agent_configuration: Optional[AIAgentConfigurationMap] = None,
    orchestrator_configuration_list: Optional[OrchestratorConfigurationList] = None,
    remove_orchestrator_configuration_list: Optional[bool] = None,
) -> UpdateSessionResponse

Updates a session. A session is a contextual container used for generating recommendations. Connect Customer updates the existing Amazon Q in Connect session for each contact on which Amazon Q in Connect is enabled.

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.

  • description (Optional[Description], default: None ) –

    The description.

  • tag_filter (Optional[TagFilter], default: None ) –

    An object that can be used to specify Tag conditions.

  • ai_agent_configuration (Optional[AIAgentConfigurationMap], default: None ) –

    The configuration of the AI Agents (mapped by AI Agent Type to AI Agent version) that should be used by Amazon Q in Connect for this Session.

  • orchestrator_configuration_list (Optional[OrchestratorConfigurationList], default: None ) –

    The updated list of orchestrator configurations for the session.

  • remove_orchestrator_configuration_list (Optional[bool], default: None ) –

    The list of orchestrator configurations to remove from the session.

Raises:

Source code in docs_src/capo_qconnect/_services/async_q_connect.py
async def update_session(
    self,
    assistant_id: "capo_qconnect.types.uuid_or_arn.UuidOrArn",
    session_id: "capo_qconnect.types.uuid_or_arn.UuidOrArn",
    *,
    config_overrides: Optional[AsyncQConnectClientConfig] = None,
    description: Optional["capo_qconnect.types.description.Description"] = None,
    tag_filter: Optional["capo_qconnect.types.tag_filter.TagFilter"] = None,
    ai_agent_configuration: Optional[
        "capo_qconnect.types.ai_agent_configuration_map.AIAgentConfigurationMap"
    ] = None,
    orchestrator_configuration_list: Optional[
        "capo_qconnect.types.orchestrator_configuration_list.OrchestratorConfigurationList"
    ] = None,
    remove_orchestrator_configuration_list: Optional[bool] = None,
) -> "capo_qconnect.types.update_session_response.UpdateSessionResponse":
    """<p>Updates a session. A session is a contextual container used for generating recommendations. Connect Customer updates the existing Amazon Q in Connect session for each contact on which Amazon Q in Connect is enabled.</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>
        description: <p>The description.</p>
        tag_filter: <p>An object that can be used to specify Tag conditions.</p>
        ai_agent_configuration: <p>The configuration of the AI Agents (mapped by AI Agent Type to AI Agent version) that should be used by Amazon Q in Connect for this Session.</p>
        orchestrator_configuration_list: <p>The updated list of orchestrator configurations for the session.</p>
        remove_orchestrator_configuration_list: <p>The list of orchestrator configurations to remove from the 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_request.UpdateSessionRequest]",
    ) -> AsyncOperationResponse[
        "capo_qconnect.types.update_session_response.UpdateSessionResponse"
    ]:
        import capo_qconnect._operations.wisdom_service.update_session

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateSession")
    )
    input_: capo_qconnect.types.update_session_request.UpdateSessionRequest = {
        "assistant_id": assistant_id,
        "session_id": session_id,
    }
    if description is not None:
        input_["description"] = description
    if tag_filter is not None:
        input_["tag_filter"] = tag_filter
    if ai_agent_configuration is not None:
        input_["ai_agent_configuration"] = ai_agent_configuration
    if orchestrator_configuration_list is not None:
        input_["orchestrator_configuration_list"] = orchestrator_configuration_list
    if remove_orchestrator_configuration_list is not None:
        input_["remove_orchestrator_configuration_list"] = (
            remove_orchestrator_configuration_list
        )

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