Skip to content

insight_feedback async

insight_feedback(
    entity: InsightFeedbackEntity,
    insight_id: GUID,
    thumbs: InsightFeedbackThumbs,
    *,
    config_overrides: Optional[AsyncOpenSearchClientConfig] = None,
    feedback_text: Optional[InsightFeedbackText] = None,
) -> InsightFeedbackResponse

Submits feedback for an existing insight in an Amazon OpenSearch Service domain. Allows users to provide a thumbs up or thumbs down rating and optional text feedback for a specific insight.

Parameters:

  • entity (InsightFeedbackEntity) –

    The entity for which to submit insight feedback. Specifies the type and value of the entity, such as a domain name.

  • insight_id (GUID) –

    The unique identifier of the insight for which to submit feedback.

  • thumbs (InsightFeedbackThumbs) –

    The thumbs up or thumbs down feedback for the insight. Possible values are Up and Down.

  • feedback_text (Optional[InsightFeedbackText], default: None ) –

    Optional text feedback providing additional details about the insight. Maximum length is 1000 characters.

Raises:

Source code in docs_src/capo_opensearch/_services/async_open_search.py
async def insight_feedback(
    self,
    entity: "capo_opensearch.types.insight_feedback_entity.InsightFeedbackEntity",
    insight_id: "capo_opensearch.types.guid.GUID",
    thumbs: "capo_opensearch.types.insight_feedback_thumbs.InsightFeedbackThumbs",
    *,
    config_overrides: Optional[AsyncOpenSearchClientConfig] = None,
    feedback_text: Optional[
        "capo_opensearch.types.insight_feedback_text.InsightFeedbackText"
    ] = None,
) -> "capo_opensearch.types.insight_feedback_response.InsightFeedbackResponse":
    """<p>Submits feedback for an existing insight in an Amazon OpenSearch Service domain. Allows users to provide a thumbs up or thumbs down rating and optional text feedback for a specific insight.</p>

    Args:
        entity: <p>The entity for which to submit insight feedback. Specifies the type and value of the entity, such as a domain name.</p>
        insight_id: <p>The unique identifier of the insight for which to submit feedback.</p>
        thumbs: <p>The thumbs up or thumbs down feedback for the insight. Possible values are <code>Up</code> and <code>Down</code>.</p>
        feedback_text: <p>Optional text feedback providing additional details about the insight. Maximum length is 1000 characters.</p>

    Raises:
        capo_opensearch.errors.base_exception.BaseException: <p>An error occurred while processing the request.</p>
        capo_opensearch.errors.disabled_operation_exception.DisabledOperationException: <p>An error occured because the client wanted to access an unsupported operation.</p>
        capo_opensearch.errors.internal_exception.InternalException: <p>Request processing failed because of an unknown error, exception, or internal failure.</p>
        capo_opensearch.errors.limit_exceeded_exception.LimitExceededException: <p>An exception for trying to create more than the allowed number of resources or sub-resources.</p>
        capo_opensearch.errors.resource_not_found_exception.ResourceNotFoundException: <p>An exception for accessing or deleting a resource that doesn't exist.</p>
        capo_opensearch.errors.validation_exception.ValidationException: <p>An exception for accessing or deleting a resource that doesn't exist.</p>
        capo_opensearch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_opensearch.types.insight_feedback_request.InsightFeedbackRequest]",
    ) -> AsyncOperationResponse[
        "capo_opensearch.types.insight_feedback_response.InsightFeedbackResponse"
    ]:
        import capo_opensearch._operations.amazon_open_search_service.insight_feedback

        (
            output,
            http_response,
        ) = await capo_opensearch._operations.amazon_open_search_service.insight_feedback.async_insight_feedback(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("InsightFeedback")
    )
    input_: capo_opensearch.types.insight_feedback_request.InsightFeedbackRequest = {
        "entity": entity,
        "insight_id": insight_id,
        "thumbs": thumbs,
    }
    if feedback_text is not None:
        input_["feedback_text"] = feedback_text

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