Skip to content

get_event_prediction_metadata

get_event_prediction_metadata(
    event_id: identifier,
    event_type_name: identifier,
    detector_id: identifier,
    detector_version_id: wholeNumberVersionString,
    prediction_timestamp: time,
    *,
    config_overrides: Optional[FraudDetectorClientConfig] = None,
) -> GetEventPredictionMetadataResult

Gets details of the past fraud predictions for the specified event ID, event type, detector ID, and detector version ID that was generated in the specified time period.

Parameters:

  • event_id (identifier) –

    The event ID.

  • event_type_name (identifier) –

    The event type associated with the detector specified for the prediction.

  • detector_id (identifier) –

    The detector ID.

  • detector_version_id (wholeNumberVersionString) –

    The detector version ID.

  • prediction_timestamp (time) –

    The timestamp that defines when the prediction was generated. The timestamp must be specified using ISO 8601 standard in UTC.

    We recommend calling ListEventPredictions first, and using the predictionTimestamp value in the response to provide an accurate prediction timestamp value.

Raises:

  • AccessDeniedException –

    An exception indicating Amazon Fraud Detector does not have the needed permissions. This can occur if you submit a request, such as PutExternalModel, that specifies a role that is not in your account.

  • InternalServerException –

    An exception indicating an internal server error.

  • ResourceNotFoundException –

    An exception indicating the specified resource was not found.

  • ThrottlingException –

    An exception indicating a throttling error.

  • ValidationException –

    An exception indicating a specified value is not allowed.

  • UnknownServiceError –

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

Source code in docs_src/capo_frauddetector/_services/fraud_detector.py
def get_event_prediction_metadata(
    self,
    event_id: "capo_frauddetector.types.identifier.identifier",
    event_type_name: "capo_frauddetector.types.identifier.identifier",
    detector_id: "capo_frauddetector.types.identifier.identifier",
    detector_version_id: "capo_frauddetector.types.whole_number_version_string.wholeNumberVersionString",
    prediction_timestamp: "capo_frauddetector.types.time.time",
    *,
    config_overrides: Optional[FraudDetectorClientConfig] = None,
) -> "capo_frauddetector.types.get_event_prediction_metadata_result.GetEventPredictionMetadataResult":
    """<p> Gets details of the past fraud predictions for the specified event ID, event type, detector ID, and detector version ID that was generated in the specified time period. </p>

    Args:
        event_id: <p> The event ID. </p>
        event_type_name: <p> The event type associated with the detector specified for the prediction. </p>
        detector_id: <p> The detector ID. </p>
        detector_version_id: <p> The detector version ID. </p>
        prediction_timestamp: <p> The timestamp that defines when the prediction was generated. The timestamp must be specified using ISO 8601 standard in UTC.</p> <p>We recommend calling <a href="https://docs.aws.amazon.com/frauddetector/latest/api/API_ListEventPredictions.html">ListEventPredictions</a> first, and using the <code>predictionTimestamp</code> value in the response to provide an accurate prediction timestamp value.</p>

    Raises:
        capo_frauddetector.errors.access_denied_exception.AccessDeniedException: <p>An exception indicating Amazon Fraud Detector does not have the needed permissions. This can occur if you submit a request, such as <code>PutExternalModel</code>, that specifies a role that is not in your account.</p>
        capo_frauddetector.errors.internal_server_exception.InternalServerException: <p>An exception indicating an internal server error.</p>
        capo_frauddetector.errors.resource_not_found_exception.ResourceNotFoundException: <p>An exception indicating the specified resource was not found.</p>
        capo_frauddetector.errors.throttling_exception.ThrottlingException: <p>An exception indicating a throttling error.</p>
        capo_frauddetector.errors.validation_exception.ValidationException: <p>An exception indicating a specified value is not allowed.</p>
        capo_frauddetector.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_frauddetector.types.get_event_prediction_metadata_request.GetEventPredictionMetadataRequest]",
    ) -> OperationResponse[
        "capo_frauddetector.types.get_event_prediction_metadata_result.GetEventPredictionMetadataResult"
    ]:
        import capo_frauddetector._operations.aws_hawks_nest_service_facade.get_event_prediction_metadata

        output, http_response = (
            capo_frauddetector._operations.aws_hawks_nest_service_facade.get_event_prediction_metadata.get_event_prediction_metadata(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_frauddetector.types.get_event_prediction_metadata_result.GetEventPredictionMetadataResult",
    ) -> dict[str, Any]:
        import capo_frauddetector.types.get_event_prediction_metadata_result

        return capo_frauddetector.types.get_event_prediction_metadata_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "GetEventPredictionMetadata", redact_output=_redact_output
        ),
    )
    input_: capo_frauddetector.types.get_event_prediction_metadata_request.GetEventPredictionMetadataRequest = {
        "event_id": event_id,
        "event_type_name": event_type_name,
        "detector_id": detector_id,
        "detector_version_id": detector_version_id,
        "prediction_timestamp": prediction_timestamp,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output