Skip to content

search_sessions async

search_sessions(
    assistant_id: UuidOrArn,
    search_expression: SearchExpression,
    *,
    config_overrides: Optional[AsyncWisdomClientConfig] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> SearchSessionsResponse

Searches for sessions.

Parameters:

  • next_token (Optional[NextToken], default: None ) –

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to return per page.

  • assistant_id (UuidOrArn) –

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

  • search_expression (SearchExpression) –

    The search expression to filter results.

Raises:

Source code in docs_src/capo_wisdom/_services/async_wisdom.py
async def search_sessions(
    self,
    assistant_id: "capo_wisdom.types.uuid_or_arn.UuidOrArn",
    search_expression: "capo_wisdom.types.search_expression.SearchExpression",
    *,
    config_overrides: Optional[AsyncWisdomClientConfig] = None,
    next_token: Optional["capo_wisdom.types.next_token.NextToken"] = None,
    max_results: Optional["capo_wisdom.types.max_results.MaxResults"] = None,
) -> "capo_wisdom.types.search_sessions_response.SearchSessionsResponse":
    """<p>Searches for sessions.</p>

    Args:
        next_token: <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
        max_results: <p>The maximum number of results to return per page.</p>
        assistant_id: <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
        search_expression: <p>The search expression to filter results.</p>

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

    async def _handler(
        req: "AsyncOperationRequest[capo_wisdom.types.search_sessions_request.SearchSessionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_wisdom.types.search_sessions_response.SearchSessionsResponse"
    ]:
        import capo_wisdom._operations.wisdom_service.search_sessions

        (
            output,
            http_response,
        ) = await capo_wisdom._operations.wisdom_service.search_sessions.async_search_sessions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SearchSessions")
    )
    input_: capo_wisdom.types.search_sessions_request.SearchSessionsRequest = {
        "assistant_id": assistant_id,
        "search_expression": search_expression,
    }
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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