<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/aiplatform/v1/evaluated_annotation.proto

namespace Google\Cloud\AIPlatform\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * True positive, false positive, or false negative.
 * EvaluatedAnnotation is only available under ModelEvaluationSlice with slice
 * of `annotationSpec` dimension.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.EvaluatedAnnotation</code>
 */
class EvaluatedAnnotation extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Type of the EvaluatedAnnotation.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.EvaluatedAnnotation.EvaluatedAnnotationType type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $type = 0;
    /**
     * Output only. The model predicted annotations.
     * For true positive, there is one and only one prediction, which matches the
     * only one ground truth annotation in
     * [ground_truths][google.cloud.aiplatform.v1.EvaluatedAnnotation.ground_truths].
     * For false positive, there is one and only one prediction, which doesn't
     * match any ground truth annotation of the corresponding
     * [data_item_view_id][EvaluatedAnnotation.data_item_view_id].
     * For false negative, there are zero or more predictions which are similar to
     * the only ground truth annotation in
     * [ground_truths][google.cloud.aiplatform.v1.EvaluatedAnnotation.ground_truths]
     * but not enough for a match.
     * The schema of the prediction is stored in
     * [ModelEvaluation.annotation_schema_uri][google.cloud.aiplatform.v1.ModelEvaluation.annotation_schema_uri]
     *
     * Generated from protobuf field <code>repeated .google.protobuf.Value predictions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $predictions;
    /**
     * Output only. The ground truth Annotations, i.e. the Annotations that exist
     * in the test data the Model is evaluated on.
     * For true positive, there is one and only one ground truth annotation, which
     * matches the only prediction in
     * [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions].
     * For false positive, there are zero or more ground truth annotations that
     * are similar to the only prediction in
     * [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions],
     * but not enough for a match.
     * For false negative, there is one and only one ground truth annotation,
     * which doesn't match any predictions created by the model.
     * The schema of the ground truth is stored in
     * [ModelEvaluation.annotation_schema_uri][google.cloud.aiplatform.v1.ModelEvaluation.annotation_schema_uri]
     *
     * Generated from protobuf field <code>repeated .google.protobuf.Value ground_truths = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $ground_truths;
    /**
     * Output only. The data item payload that the Model predicted this
     * EvaluatedAnnotation on.
     *
     * Generated from protobuf field <code>.google.protobuf.Value data_item_payload = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $data_item_payload = null;
    /**
     * Output only. ID of the EvaluatedDataItemView under the same ancestor
     * ModelEvaluation. The EvaluatedDataItemView consists of all ground truths
     * and predictions on
     * [data_item_payload][google.cloud.aiplatform.v1.EvaluatedAnnotation.data_item_payload].
     *
     * Generated from protobuf field <code>string evaluated_data_item_view_id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $evaluated_data_item_view_id = '';
    /**
     * Explanations of
     * [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions].
     * Each element of the explanations indicates the explanation for one
     * explanation Method.
     * The attributions list in the
     * [EvaluatedAnnotationExplanation.explanation][google.cloud.aiplatform.v1.EvaluatedAnnotationExplanation.explanation]
     * object corresponds to the
     * [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions]
     * list. For example, the second element in the attributions list explains the
     * second element in the predictions list.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.EvaluatedAnnotationExplanation explanations = 8;</code>
     */
    private $explanations;
    /**
     * Annotations of model error analysis results.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.ErrorAnalysisAnnotation error_analysis_annotations = 9;</code>
     */
    private $error_analysis_annotations;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $type
     *           Output only. Type of the EvaluatedAnnotation.
     *     @type array<\Google\Protobuf\Value>|\Google\Protobuf\Internal\RepeatedField $predictions
     *           Output only. The model predicted annotations.
     *           For true positive, there is one and only one prediction, which matches the
     *           only one ground truth annotation in
     *           [ground_truths][google.cloud.aiplatform.v1.EvaluatedAnnotation.ground_truths].
     *           For false positive, there is one and only one prediction, which doesn't
     *           match any ground truth annotation of the corresponding
     *           [data_item_view_id][EvaluatedAnnotation.data_item_view_id].
     *           For false negative, there are zero or more predictions which are similar to
     *           the only ground truth annotation in
     *           [ground_truths][google.cloud.aiplatform.v1.EvaluatedAnnotation.ground_truths]
     *           but not enough for a match.
     *           The schema of the prediction is stored in
     *           [ModelEvaluation.annotation_schema_uri][google.cloud.aiplatform.v1.ModelEvaluation.annotation_schema_uri]
     *     @type array<\Google\Protobuf\Value>|\Google\Protobuf\Internal\RepeatedField $ground_truths
     *           Output only. The ground truth Annotations, i.e. the Annotations that exist
     *           in the test data the Model is evaluated on.
     *           For true positive, there is one and only one ground truth annotation, which
     *           matches the only prediction in
     *           [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions].
     *           For false positive, there are zero or more ground truth annotations that
     *           are similar to the only prediction in
     *           [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions],
     *           but not enough for a match.
     *           For false negative, there is one and only one ground truth annotation,
     *           which doesn't match any predictions created by the model.
     *           The schema of the ground truth is stored in
     *           [ModelEvaluation.annotation_schema_uri][google.cloud.aiplatform.v1.ModelEvaluation.annotation_schema_uri]
     *     @type \Google\Protobuf\Value $data_item_payload
     *           Output only. The data item payload that the Model predicted this
     *           EvaluatedAnnotation on.
     *     @type string $evaluated_data_item_view_id
     *           Output only. ID of the EvaluatedDataItemView under the same ancestor
     *           ModelEvaluation. The EvaluatedDataItemView consists of all ground truths
     *           and predictions on
     *           [data_item_payload][google.cloud.aiplatform.v1.EvaluatedAnnotation.data_item_payload].
     *     @type array<\Google\Cloud\AIPlatform\V1\EvaluatedAnnotationExplanation>|\Google\Protobuf\Internal\RepeatedField $explanations
     *           Explanations of
     *           [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions].
     *           Each element of the explanations indicates the explanation for one
     *           explanation Method.
     *           The attributions list in the
     *           [EvaluatedAnnotationExplanation.explanation][google.cloud.aiplatform.v1.EvaluatedAnnotationExplanation.explanation]
     *           object corresponds to the
     *           [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions]
     *           list. For example, the second element in the attributions list explains the
     *           second element in the predictions list.
     *     @type array<\Google\Cloud\AIPlatform\V1\ErrorAnalysisAnnotation>|\Google\Protobuf\Internal\RepeatedField $error_analysis_annotations
     *           Annotations of model error analysis results.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\EvaluatedAnnotation::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. Type of the EvaluatedAnnotation.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.EvaluatedAnnotation.EvaluatedAnnotationType type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Output only. Type of the EvaluatedAnnotation.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.EvaluatedAnnotation.EvaluatedAnnotationType type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\AIPlatform\V1\EvaluatedAnnotation\EvaluatedAnnotationType::class);
        $this->type = $var;

        return $this;
    }

    /**
     * Output only. The model predicted annotations.
     * For true positive, there is one and only one prediction, which matches the
     * only one ground truth annotation in
     * [ground_truths][google.cloud.aiplatform.v1.EvaluatedAnnotation.ground_truths].
     * For false positive, there is one and only one prediction, which doesn't
     * match any ground truth annotation of the corresponding
     * [data_item_view_id][EvaluatedAnnotation.data_item_view_id].
     * For false negative, there are zero or more predictions which are similar to
     * the only ground truth annotation in
     * [ground_truths][google.cloud.aiplatform.v1.EvaluatedAnnotation.ground_truths]
     * but not enough for a match.
     * The schema of the prediction is stored in
     * [ModelEvaluation.annotation_schema_uri][google.cloud.aiplatform.v1.ModelEvaluation.annotation_schema_uri]
     *
     * Generated from protobuf field <code>repeated .google.protobuf.Value predictions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getPredictions()
    {
        return $this->predictions;
    }

    /**
     * Output only. The model predicted annotations.
     * For true positive, there is one and only one prediction, which matches the
     * only one ground truth annotation in
     * [ground_truths][google.cloud.aiplatform.v1.EvaluatedAnnotation.ground_truths].
     * For false positive, there is one and only one prediction, which doesn't
     * match any ground truth annotation of the corresponding
     * [data_item_view_id][EvaluatedAnnotation.data_item_view_id].
     * For false negative, there are zero or more predictions which are similar to
     * the only ground truth annotation in
     * [ground_truths][google.cloud.aiplatform.v1.EvaluatedAnnotation.ground_truths]
     * but not enough for a match.
     * The schema of the prediction is stored in
     * [ModelEvaluation.annotation_schema_uri][google.cloud.aiplatform.v1.ModelEvaluation.annotation_schema_uri]
     *
     * Generated from protobuf field <code>repeated .google.protobuf.Value predictions = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param array<\Google\Protobuf\Value>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setPredictions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class);
        $this->predictions = $arr;

        return $this;
    }

    /**
     * Output only. The ground truth Annotations, i.e. the Annotations that exist
     * in the test data the Model is evaluated on.
     * For true positive, there is one and only one ground truth annotation, which
     * matches the only prediction in
     * [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions].
     * For false positive, there are zero or more ground truth annotations that
     * are similar to the only prediction in
     * [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions],
     * but not enough for a match.
     * For false negative, there is one and only one ground truth annotation,
     * which doesn't match any predictions created by the model.
     * The schema of the ground truth is stored in
     * [ModelEvaluation.annotation_schema_uri][google.cloud.aiplatform.v1.ModelEvaluation.annotation_schema_uri]
     *
     * Generated from protobuf field <code>repeated .google.protobuf.Value ground_truths = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getGroundTruths()
    {
        return $this->ground_truths;
    }

    /**
     * Output only. The ground truth Annotations, i.e. the Annotations that exist
     * in the test data the Model is evaluated on.
     * For true positive, there is one and only one ground truth annotation, which
     * matches the only prediction in
     * [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions].
     * For false positive, there are zero or more ground truth annotations that
     * are similar to the only prediction in
     * [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions],
     * but not enough for a match.
     * For false negative, there is one and only one ground truth annotation,
     * which doesn't match any predictions created by the model.
     * The schema of the ground truth is stored in
     * [ModelEvaluation.annotation_schema_uri][google.cloud.aiplatform.v1.ModelEvaluation.annotation_schema_uri]
     *
     * Generated from protobuf field <code>repeated .google.protobuf.Value ground_truths = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param array<\Google\Protobuf\Value>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setGroundTruths($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class);
        $this->ground_truths = $arr;

        return $this;
    }

    /**
     * Output only. The data item payload that the Model predicted this
     * EvaluatedAnnotation on.
     *
     * Generated from protobuf field <code>.google.protobuf.Value data_item_payload = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Value|null
     */
    public function getDataItemPayload()
    {
        return $this->data_item_payload;
    }

    public function hasDataItemPayload()
    {
        return isset($this->data_item_payload);
    }

    public function clearDataItemPayload()
    {
        unset($this->data_item_payload);
    }

    /**
     * Output only. The data item payload that the Model predicted this
     * EvaluatedAnnotation on.
     *
     * Generated from protobuf field <code>.google.protobuf.Value data_item_payload = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Value $var
     * @return $this
     */
    public function setDataItemPayload($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Value::class);
        $this->data_item_payload = $var;

        return $this;
    }

    /**
     * Output only. ID of the EvaluatedDataItemView under the same ancestor
     * ModelEvaluation. The EvaluatedDataItemView consists of all ground truths
     * and predictions on
     * [data_item_payload][google.cloud.aiplatform.v1.EvaluatedAnnotation.data_item_payload].
     *
     * Generated from protobuf field <code>string evaluated_data_item_view_id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getEvaluatedDataItemViewId()
    {
        return $this->evaluated_data_item_view_id;
    }

    /**
     * Output only. ID of the EvaluatedDataItemView under the same ancestor
     * ModelEvaluation. The EvaluatedDataItemView consists of all ground truths
     * and predictions on
     * [data_item_payload][google.cloud.aiplatform.v1.EvaluatedAnnotation.data_item_payload].
     *
     * Generated from protobuf field <code>string evaluated_data_item_view_id = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setEvaluatedDataItemViewId($var)
    {
        GPBUtil::checkString($var, True);
        $this->evaluated_data_item_view_id = $var;

        return $this;
    }

    /**
     * Explanations of
     * [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions].
     * Each element of the explanations indicates the explanation for one
     * explanation Method.
     * The attributions list in the
     * [EvaluatedAnnotationExplanation.explanation][google.cloud.aiplatform.v1.EvaluatedAnnotationExplanation.explanation]
     * object corresponds to the
     * [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions]
     * list. For example, the second element in the attributions list explains the
     * second element in the predictions list.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.EvaluatedAnnotationExplanation explanations = 8;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getExplanations()
    {
        return $this->explanations;
    }

    /**
     * Explanations of
     * [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions].
     * Each element of the explanations indicates the explanation for one
     * explanation Method.
     * The attributions list in the
     * [EvaluatedAnnotationExplanation.explanation][google.cloud.aiplatform.v1.EvaluatedAnnotationExplanation.explanation]
     * object corresponds to the
     * [predictions][google.cloud.aiplatform.v1.EvaluatedAnnotation.predictions]
     * list. For example, the second element in the attributions list explains the
     * second element in the predictions list.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.EvaluatedAnnotationExplanation explanations = 8;</code>
     * @param array<\Google\Cloud\AIPlatform\V1\EvaluatedAnnotationExplanation>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setExplanations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\EvaluatedAnnotationExplanation::class);
        $this->explanations = $arr;

        return $this;
    }

    /**
     * Annotations of model error analysis results.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.ErrorAnalysisAnnotation error_analysis_annotations = 9;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getErrorAnalysisAnnotations()
    {
        return $this->error_analysis_annotations;
    }

    /**
     * Annotations of model error analysis results.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.ErrorAnalysisAnnotation error_analysis_annotations = 9;</code>
     * @param array<\Google\Cloud\AIPlatform\V1\ErrorAnalysisAnnotation>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setErrorAnalysisAnnotations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\ErrorAnalysisAnnotation::class);
        $this->error_analysis_annotations = $arr;

        return $this;
    }

}

