Skip to content

search_quick_responses async

search_quick_responses(
    knowledge_base_id: UuidOrArn,
    search_expression: QuickResponseSearchExpression,
    *,
    config_overrides: Optional[AsyncWisdomClientConfig] = None,
    next_token: Optional[NonEmptyString] = None,
    max_results: Optional[MaxResults] = None,
    attributes: Optional[ContactAttributes] = None,
) -> SearchQuickResponsesResponse

Searches existing Wisdom quick responses in a Wisdom knowledge base.

Parameters:

  • knowledge_base_id (UuidOrArn) –

    The identifier of the knowledge base. This should be a QUICK_RESPONSES type knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

  • search_expression (QuickResponseSearchExpression) –

    The search expression for querying the quick response.

  • next_token (Optional[NonEmptyString], 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.

  • attributes (Optional[ContactAttributes], default: None ) –

    The user-defined Amazon Connect contact attributes to be resolved when search results are returned.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • RequestTimeoutException –

    The request reached the service more than 15 minutes after the date stamp on the request or more than 15 minutes after the request expiration date (such as for pre-signed URLs), or the date stamp on the request is more than 15 minutes in the future.

  • ResourceNotFoundException –

    The specified resource does not exist.

  • ValidationException –

    The input fails to satisfy the constraints specified by a service.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_wisdom/_services/async_wisdom.py
async def search_quick_responses(
    self,
    knowledge_base_id: "capo_wisdom.types.uuid_or_arn.UuidOrArn",
    search_expression: "capo_wisdom.types.quick_response_search_expression.QuickResponseSearchExpression",
    *,
    config_overrides: Optional[AsyncWisdomClientConfig] = None,
    next_token: Optional[
        "capo_wisdom.types.non_empty_string.NonEmptyString"
    ] = None,
    max_results: Optional["capo_wisdom.types.max_results.MaxResults"] = None,
    attributes: Optional[
        "capo_wisdom.types.contact_attributes.ContactAttributes"
    ] = None,
) -> (
    "capo_wisdom.types.search_quick_responses_response.SearchQuickResponsesResponse"
):
    """<p>Searches existing Wisdom quick responses in a Wisdom knowledge base.</p>

    Args:
        knowledge_base_id: <p>The identifier of the knowledge base. This should be a QUICK_RESPONSES type knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
        search_expression: <p>The search expression for querying the quick response.</p>
        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>
        attributes: <p>The <a href="https://docs.aws.amazon.com/connect/latest/adminguide/connect-attrib-list.html#user-defined-attributes">user-defined Amazon Connect contact attributes</a> to be resolved when search results are returned.</p>

    Raises:
        capo_wisdom.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_wisdom.errors.request_timeout_exception.RequestTimeoutException: <p>The request reached the service more than 15 minutes after the date stamp on the request or more than 15 minutes after the request expiration date (such as for pre-signed URLs), or the date stamp on the request is more than 15 minutes in the future.</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_quick_responses_request.SearchQuickResponsesRequest]",
    ) -> AsyncOperationResponse[
        "capo_wisdom.types.search_quick_responses_response.SearchQuickResponsesResponse"
    ]:
        import capo_wisdom._operations.wisdom_service.search_quick_responses

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

    def _redact_input(
        input_: "capo_wisdom.types.search_quick_responses_request.SearchQuickResponsesRequest",
    ) -> dict[str, Any]:
        import capo_wisdom.types.search_quick_responses_request

        return capo_wisdom.types.search_quick_responses_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_wisdom.types.search_quick_responses_response.SearchQuickResponsesResponse",
    ) -> dict[str, Any]:
        import capo_wisdom.types.search_quick_responses_response

        return capo_wisdom.types.search_quick_responses_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "SearchQuickResponses",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_wisdom.types.search_quick_responses_request.SearchQuickResponsesRequest = {
        "knowledge_base_id": knowledge_base_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
    if attributes is not None:
        input_["attributes"] = attributes

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