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

namespace Google\Cloud\AIPlatform\V1;

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

/**
 * A container for a single DataItem and Annotations on it.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.DataItemView</code>
 */
class DataItemView extends \Google\Protobuf\Internal\Message
{
    /**
     * The DataItem.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.DataItem data_item = 1;</code>
     */
    protected $data_item = null;
    /**
     * The Annotations on the DataItem. If too many Annotations should be returned
     * for the DataItem, this field will be truncated per annotations_limit in
     * request. If it was, then the has_truncated_annotations will be set to true.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Annotation annotations = 2;</code>
     */
    private $annotations;
    /**
     * True if and only if the Annotations field has been truncated. It happens if
     * more Annotations for this DataItem met the request's annotation_filter than
     * are allowed to be returned by annotations_limit.
     * Note that if Annotations field is not being returned due to field mask,
     * then this field will not be set to true no matter how many Annotations are
     * there.
     *
     * Generated from protobuf field <code>bool has_truncated_annotations = 3;</code>
     */
    protected $has_truncated_annotations = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\AIPlatform\V1\DataItem $data_item
     *           The DataItem.
     *     @type array<\Google\Cloud\AIPlatform\V1\Annotation>|\Google\Protobuf\Internal\RepeatedField $annotations
     *           The Annotations on the DataItem. If too many Annotations should be returned
     *           for the DataItem, this field will be truncated per annotations_limit in
     *           request. If it was, then the has_truncated_annotations will be set to true.
     *     @type bool $has_truncated_annotations
     *           True if and only if the Annotations field has been truncated. It happens if
     *           more Annotations for this DataItem met the request's annotation_filter than
     *           are allowed to be returned by annotations_limit.
     *           Note that if Annotations field is not being returned due to field mask,
     *           then this field will not be set to true no matter how many Annotations are
     *           there.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\DatasetService::initOnce();
        parent::__construct($data);
    }

    /**
     * The DataItem.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.DataItem data_item = 1;</code>
     * @return \Google\Cloud\AIPlatform\V1\DataItem|null
     */
    public function getDataItem()
    {
        return $this->data_item;
    }

    public function hasDataItem()
    {
        return isset($this->data_item);
    }

    public function clearDataItem()
    {
        unset($this->data_item);
    }

    /**
     * The DataItem.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.DataItem data_item = 1;</code>
     * @param \Google\Cloud\AIPlatform\V1\DataItem $var
     * @return $this
     */
    public function setDataItem($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\DataItem::class);
        $this->data_item = $var;

        return $this;
    }

    /**
     * The Annotations on the DataItem. If too many Annotations should be returned
     * for the DataItem, this field will be truncated per annotations_limit in
     * request. If it was, then the has_truncated_annotations will be set to true.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Annotation annotations = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAnnotations()
    {
        return $this->annotations;
    }

    /**
     * The Annotations on the DataItem. If too many Annotations should be returned
     * for the DataItem, this field will be truncated per annotations_limit in
     * request. If it was, then the has_truncated_annotations will be set to true.
     *
     * Generated from protobuf field <code>repeated .google.cloud.aiplatform.v1.Annotation annotations = 2;</code>
     * @param array<\Google\Cloud\AIPlatform\V1\Annotation>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAnnotations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\Annotation::class);
        $this->annotations = $arr;

        return $this;
    }

    /**
     * True if and only if the Annotations field has been truncated. It happens if
     * more Annotations for this DataItem met the request's annotation_filter than
     * are allowed to be returned by annotations_limit.
     * Note that if Annotations field is not being returned due to field mask,
     * then this field will not be set to true no matter how many Annotations are
     * there.
     *
     * Generated from protobuf field <code>bool has_truncated_annotations = 3;</code>
     * @return bool
     */
    public function getHasTruncatedAnnotations()
    {
        return $this->has_truncated_annotations;
    }

    /**
     * True if and only if the Annotations field has been truncated. It happens if
     * more Annotations for this DataItem met the request's annotation_filter than
     * are allowed to be returned by annotations_limit.
     * Note that if Annotations field is not being returned due to field mask,
     * then this field will not be set to true no matter how many Annotations are
     * there.
     *
     * Generated from protobuf field <code>bool has_truncated_annotations = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setHasTruncatedAnnotations($var)
    {
        GPBUtil::checkBool($var);
        $this->has_truncated_annotations = $var;

        return $this;
    }

}

