<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/privacy/dlp/v2/dlp.proto

namespace Google\Cloud\Dlp\V2;

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

/**
 * Set of primitive values supported by the system.
 * Note that for the purposes of inspection or transformation, the number
 * of bytes considered to comprise a 'Value' is based on its representation
 * as a UTF-8 encoded string. For example, if 'integer_value' is set to
 * 123456789, the number of bytes would be counted as 9, even though an
 * int64 only holds up to 8 bytes of data.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.Value</code>
 */
class Value extends \Google\Protobuf\Internal\Message
{
    protected $type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $integer_value
     *     @type float $float_value
     *     @type string $string_value
     *     @type bool $boolean_value
     *     @type \Google\Protobuf\Timestamp $timestamp_value
     *     @type \Google\Type\TimeOfDay $time_value
     *     @type \Google\Type\Date $date_value
     *     @type int $day_of_week_value
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>int64 integer_value = 1;</code>
     * @return int|string
     */
    public function getIntegerValue()
    {
        return $this->readOneof(1);
    }

    /**
     * Generated from protobuf field <code>int64 integer_value = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setIntegerValue($var)
    {
        GPBUtil::checkInt64($var);
        $this->writeOneof(1, $var);

        return $this;
    }

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

    /**
     * Generated from protobuf field <code>double float_value = 2;</code>
     * @param float $var
     * @return $this
     */
    public function setFloatValue($var)
    {
        GPBUtil::checkDouble($var);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>string string_value = 3;</code>
     * @return string
     */
    public function getStringValue()
    {
        return $this->readOneof(3);
    }

    /**
     * Generated from protobuf field <code>string string_value = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setStringValue($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>bool boolean_value = 4;</code>
     * @return bool
     */
    public function getBooleanValue()
    {
        return $this->readOneof(4);
    }

    /**
     * Generated from protobuf field <code>bool boolean_value = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setBooleanValue($var)
    {
        GPBUtil::checkBool($var);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp timestamp_value = 5;</code>
     * @return \Google\Protobuf\Timestamp
     */
    public function getTimestampValue()
    {
        return $this->readOneof(5);
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp timestamp_value = 5;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setTimestampValue($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.google.type.TimeOfDay time_value = 6;</code>
     * @return \Google\Type\TimeOfDay
     */
    public function getTimeValue()
    {
        return $this->readOneof(6);
    }

    /**
     * Generated from protobuf field <code>.google.type.TimeOfDay time_value = 6;</code>
     * @param \Google\Type\TimeOfDay $var
     * @return $this
     */
    public function setTimeValue($var)
    {
        GPBUtil::checkMessage($var, \Google\Type\TimeOfDay::class);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.google.type.Date date_value = 7;</code>
     * @return \Google\Type\Date
     */
    public function getDateValue()
    {
        return $this->readOneof(7);
    }

    /**
     * Generated from protobuf field <code>.google.type.Date date_value = 7;</code>
     * @param \Google\Type\Date $var
     * @return $this
     */
    public function setDateValue($var)
    {
        GPBUtil::checkMessage($var, \Google\Type\Date::class);
        $this->writeOneof(7, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.google.type.DayOfWeek day_of_week_value = 8;</code>
     * @return int
     */
    public function getDayOfWeekValue()
    {
        return $this->readOneof(8);
    }

    /**
     * Generated from protobuf field <code>.google.type.DayOfWeek day_of_week_value = 8;</code>
     * @param int $var
     * @return $this
     */
    public function setDayOfWeekValue($var)
    {
        GPBUtil::checkEnum($var, \Google\Type\DayOfWeek::class);
        $this->writeOneof(8, $var);

        return $this;
    }

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

}

