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

namespace Google\Cloud\DocumentAI\V1\DocumentSchema;

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

/**
 * EntityType is the wrapper of a label of the corresponding model with
 * detailed attributes and limitations for entity-based processors. Multiple
 * types can also compose a dependency tree to represent nested types.
 *
 * Generated from protobuf message <code>google.cloud.documentai.v1.DocumentSchema.EntityType</code>
 */
class EntityType extends \Google\Protobuf\Internal\Message
{
    /**
     * User defined name for the type.
     *
     * Generated from protobuf field <code>string display_name = 13;</code>
     */
    private $display_name = '';
    /**
     * Name of the type. It must be unique within the schema file and
     * cannot be a 'Common Type'.  Besides that we use the following naming
     * conventions:
     * - *use `snake_casing`*
     * - name matching is case-sensitive
     * - Maximum 64 characters.
     * - Must start with a letter.
     * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
     *   compatibility internal infrastructure and tooling can handle any ascii
     *   character)
     * - The `/` is sometimes used to denote a property of a type.  For example
     *   `line_item/amount`.  This convention is deprecated, but will still be
     *   honored for backward compatibility.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * The entity type that this type is derived from.  For now, one and only
     * one should be set.
     *
     * Generated from protobuf field <code>repeated string base_types = 2;</code>
     */
    private $base_types;
    /**
     * Describing the nested structure, or composition of an entity.
     *
     * Generated from protobuf field <code>repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6;</code>
     */
    private $properties;
    protected $value_source;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\EnumValues $enum_values
     *           If specified, lists all the possible values for this entity.  This
     *           should not be more than a handful of values.  If the number of values
     *           is >10 or could change frequently use the `EntityType.value_ontology`
     *           field and specify a list of all possible values in a value ontology
     *           file.
     *     @type string $display_name
     *           User defined name for the type.
     *     @type string $name
     *           Name of the type. It must be unique within the schema file and
     *           cannot be a 'Common Type'.  Besides that we use the following naming
     *           conventions:
     *           - *use `snake_casing`*
     *           - name matching is case-sensitive
     *           - Maximum 64 characters.
     *           - Must start with a letter.
     *           - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
     *             compatibility internal infrastructure and tooling can handle any ascii
     *             character)
     *           - The `/` is sometimes used to denote a property of a type.  For example
     *             `line_item/amount`.  This convention is deprecated, but will still be
     *             honored for backward compatibility.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $base_types
     *           The entity type that this type is derived from.  For now, one and only
     *           one should be set.
     *     @type array<\Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\Property>|\Google\Protobuf\Internal\RepeatedField $properties
     *           Describing the nested structure, or composition of an entity.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Documentai\V1\DocumentSchema::initOnce();
        parent::__construct($data);
    }

    /**
     * If specified, lists all the possible values for this entity.  This
     * should not be more than a handful of values.  If the number of values
     * is >10 or could change frequently use the `EntityType.value_ontology`
     * field and specify a list of all possible values in a value ontology
     * file.
     *
     * Generated from protobuf field <code>.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14;</code>
     * @return \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\EnumValues|null
     */
    public function getEnumValues()
    {
        return $this->readOneof(14);
    }

    public function hasEnumValues()
    {
        return $this->hasOneof(14);
    }

    /**
     * If specified, lists all the possible values for this entity.  This
     * should not be more than a handful of values.  If the number of values
     * is >10 or could change frequently use the `EntityType.value_ontology`
     * field and specify a list of all possible values in a value ontology
     * file.
     *
     * Generated from protobuf field <code>.google.cloud.documentai.v1.DocumentSchema.EntityType.EnumValues enum_values = 14;</code>
     * @param \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\EnumValues $var
     * @return $this
     */
    public function setEnumValues($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\EnumValues::class);
        $this->writeOneof(14, $var);

        return $this;
    }

    /**
     * User defined name for the type.
     *
     * Generated from protobuf field <code>string display_name = 13;</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * User defined name for the type.
     *
     * Generated from protobuf field <code>string display_name = 13;</code>
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;

        return $this;
    }

    /**
     * Name of the type. It must be unique within the schema file and
     * cannot be a 'Common Type'.  Besides that we use the following naming
     * conventions:
     * - *use `snake_casing`*
     * - name matching is case-sensitive
     * - Maximum 64 characters.
     * - Must start with a letter.
     * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
     *   compatibility internal infrastructure and tooling can handle any ascii
     *   character)
     * - The `/` is sometimes used to denote a property of a type.  For example
     *   `line_item/amount`.  This convention is deprecated, but will still be
     *   honored for backward compatibility.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Name of the type. It must be unique within the schema file and
     * cannot be a 'Common Type'.  Besides that we use the following naming
     * conventions:
     * - *use `snake_casing`*
     * - name matching is case-sensitive
     * - Maximum 64 characters.
     * - Must start with a letter.
     * - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward
     *   compatibility internal infrastructure and tooling can handle any ascii
     *   character)
     * - The `/` is sometimes used to denote a property of a type.  For example
     *   `line_item/amount`.  This convention is deprecated, but will still be
     *   honored for backward compatibility.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * The entity type that this type is derived from.  For now, one and only
     * one should be set.
     *
     * Generated from protobuf field <code>repeated string base_types = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getBaseTypes()
    {
        return $this->base_types;
    }

    /**
     * The entity type that this type is derived from.  For now, one and only
     * one should be set.
     *
     * Generated from protobuf field <code>repeated string base_types = 2;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setBaseTypes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->base_types = $arr;

        return $this;
    }

    /**
     * Describing the nested structure, or composition of an entity.
     *
     * Generated from protobuf field <code>repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getProperties()
    {
        return $this->properties;
    }

    /**
     * Describing the nested structure, or composition of an entity.
     *
     * Generated from protobuf field <code>repeated .google.cloud.documentai.v1.DocumentSchema.EntityType.Property properties = 6;</code>
     * @param array<\Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\Property>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setProperties($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\DocumentSchema\EntityType\Property::class);
        $this->properties = $arr;

        return $this;
    }

    /**
     * @return string
     */
    public function getValueSource()
    {
        return $this->whichOneof("value_source");
    }

}


