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

namespace Google\Cloud\DocumentAI\V1\Document\Entity;

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

/**
 * Parsed and normalized entity value.
 *
 * Generated from protobuf message <code>google.cloud.documentai.v1.Document.Entity.NormalizedValue</code>
 */
class NormalizedValue extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. An optional field to store a normalized string.
     * For some entity types, one of respective `structured_value` fields may
     * also be populated. Also not all the types of `structured_value` will be
     * normalized. For example, some processors may not generate `float`
     * or `integer` normalized text by default.
     * Below are sample formats mapped to structured values.
     * - Money/Currency type (`money_value`) is in the ISO 4217 text format.
     * - Date type (`date_value`) is in the ISO 8601 text format.
     * - Datetime type (`datetime_value`) is in the ISO 8601 text format.
     *
     * Generated from protobuf field <code>string text = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $text = '';
    protected $structured_value;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Type\Money $money_value
     *           Money value. See also:
     *           https://github.com/googleapis/googleapis/blob/master/google/type/money.proto
     *     @type \Google\Type\Date $date_value
     *           Date value. Includes year, month, day. See also:
     *           https://github.com/googleapis/googleapis/blob/master/google/type/date.proto
     *     @type \Google\Type\DateTime $datetime_value
     *           DateTime value. Includes date, time, and timezone. See also:
     *           https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto
     *     @type \Google\Type\PostalAddress $address_value
     *           Postal address. See also:
     *           https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto
     *     @type bool $boolean_value
     *           Boolean value. Can be used for entities with binary values, or for
     *           checkboxes.
     *     @type int $integer_value
     *           Integer value.
     *     @type float $float_value
     *           Float value.
     *     @type string $text
     *           Optional. An optional field to store a normalized string.
     *           For some entity types, one of respective `structured_value` fields may
     *           also be populated. Also not all the types of `structured_value` will be
     *           normalized. For example, some processors may not generate `float`
     *           or `integer` normalized text by default.
     *           Below are sample formats mapped to structured values.
     *           - Money/Currency type (`money_value`) is in the ISO 4217 text format.
     *           - Date type (`date_value`) is in the ISO 8601 text format.
     *           - Datetime type (`datetime_value`) is in the ISO 8601 text format.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce();
        parent::__construct($data);
    }

    /**
     * Money value. See also:
     * https://github.com/googleapis/googleapis/blob/master/google/type/money.proto
     *
     * Generated from protobuf field <code>.google.type.Money money_value = 2;</code>
     * @return \Google\Type\Money|null
     */
    public function getMoneyValue()
    {
        return $this->readOneof(2);
    }

    public function hasMoneyValue()
    {
        return $this->hasOneof(2);
    }

    /**
     * Money value. See also:
     * https://github.com/googleapis/googleapis/blob/master/google/type/money.proto
     *
     * Generated from protobuf field <code>.google.type.Money money_value = 2;</code>
     * @param \Google\Type\Money $var
     * @return $this
     */
    public function setMoneyValue($var)
    {
        GPBUtil::checkMessage($var, \Google\Type\Money::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Date value. Includes year, month, day. See also:
     * https://github.com/googleapis/googleapis/blob/master/google/type/date.proto
     *
     * Generated from protobuf field <code>.google.type.Date date_value = 3;</code>
     * @return \Google\Type\Date|null
     */
    public function getDateValue()
    {
        return $this->readOneof(3);
    }

    public function hasDateValue()
    {
        return $this->hasOneof(3);
    }

    /**
     * Date value. Includes year, month, day. See also:
     * https://github.com/googleapis/googleapis/blob/master/google/type/date.proto
     *
     * Generated from protobuf field <code>.google.type.Date date_value = 3;</code>
     * @param \Google\Type\Date $var
     * @return $this
     */
    public function setDateValue($var)
    {
        GPBUtil::checkMessage($var, \Google\Type\Date::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * DateTime value. Includes date, time, and timezone. See also:
     * https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto
     *
     * Generated from protobuf field <code>.google.type.DateTime datetime_value = 4;</code>
     * @return \Google\Type\DateTime|null
     */
    public function getDatetimeValue()
    {
        return $this->readOneof(4);
    }

    public function hasDatetimeValue()
    {
        return $this->hasOneof(4);
    }

    /**
     * DateTime value. Includes date, time, and timezone. See also:
     * https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto
     *
     * Generated from protobuf field <code>.google.type.DateTime datetime_value = 4;</code>
     * @param \Google\Type\DateTime $var
     * @return $this
     */
    public function setDatetimeValue($var)
    {
        GPBUtil::checkMessage($var, \Google\Type\DateTime::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Postal address. See also:
     * https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto
     *
     * Generated from protobuf field <code>.google.type.PostalAddress address_value = 5;</code>
     * @return \Google\Type\PostalAddress|null
     */
    public function getAddressValue()
    {
        return $this->readOneof(5);
    }

    public function hasAddressValue()
    {
        return $this->hasOneof(5);
    }

    /**
     * Postal address. See also:
     * https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto
     *
     * Generated from protobuf field <code>.google.type.PostalAddress address_value = 5;</code>
     * @param \Google\Type\PostalAddress $var
     * @return $this
     */
    public function setAddressValue($var)
    {
        GPBUtil::checkMessage($var, \Google\Type\PostalAddress::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Boolean value. Can be used for entities with binary values, or for
     * checkboxes.
     *
     * Generated from protobuf field <code>bool boolean_value = 6;</code>
     * @return bool
     */
    public function getBooleanValue()
    {
        return $this->readOneof(6);
    }

    public function hasBooleanValue()
    {
        return $this->hasOneof(6);
    }

    /**
     * Boolean value. Can be used for entities with binary values, or for
     * checkboxes.
     *
     * Generated from protobuf field <code>bool boolean_value = 6;</code>
     * @param bool $var
     * @return $this
     */
    public function setBooleanValue($var)
    {
        GPBUtil::checkBool($var);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * Integer value.
     *
     * Generated from protobuf field <code>int32 integer_value = 7;</code>
     * @return int
     */
    public function getIntegerValue()
    {
        return $this->readOneof(7);
    }

    public function hasIntegerValue()
    {
        return $this->hasOneof(7);
    }

    /**
     * Integer value.
     *
     * Generated from protobuf field <code>int32 integer_value = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setIntegerValue($var)
    {
        GPBUtil::checkInt32($var);
        $this->writeOneof(7, $var);

        return $this;
    }

    /**
     * Float value.
     *
     * Generated from protobuf field <code>float float_value = 8;</code>
     * @return float
     */
    public function getFloatValue()
    {
        return $this->readOneof(8);
    }

    public function hasFloatValue()
    {
        return $this->hasOneof(8);
    }

    /**
     * Float value.
     *
     * Generated from protobuf field <code>float float_value = 8;</code>
     * @param float $var
     * @return $this
     */
    public function setFloatValue($var)
    {
        GPBUtil::checkFloat($var);
        $this->writeOneof(8, $var);

        return $this;
    }

    /**
     * Optional. An optional field to store a normalized string.
     * For some entity types, one of respective `structured_value` fields may
     * also be populated. Also not all the types of `structured_value` will be
     * normalized. For example, some processors may not generate `float`
     * or `integer` normalized text by default.
     * Below are sample formats mapped to structured values.
     * - Money/Currency type (`money_value`) is in the ISO 4217 text format.
     * - Date type (`date_value`) is in the ISO 8601 text format.
     * - Datetime type (`datetime_value`) is in the ISO 8601 text format.
     *
     * Generated from protobuf field <code>string text = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getText()
    {
        return $this->text;
    }

    /**
     * Optional. An optional field to store a normalized string.
     * For some entity types, one of respective `structured_value` fields may
     * also be populated. Also not all the types of `structured_value` will be
     * normalized. For example, some processors may not generate `float`
     * or `integer` normalized text by default.
     * Below are sample formats mapped to structured values.
     * - Money/Currency type (`money_value`) is in the ISO 4217 text format.
     * - Date type (`date_value`) is in the ISO 8601 text format.
     * - Datetime type (`datetime_value`) is in the ISO 8601 text format.
     *
     * Generated from protobuf field <code>string text = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setText($var)
    {
        GPBUtil::checkString($var, True);
        $this->text = $var;

        return $this;
    }

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

}


