<?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;

/**
 * Message for a date time object.
 * e.g. 2018-01-01, 5th August.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.DateTime</code>
 */
class DateTime extends \Google\Protobuf\Internal\Message
{
    /**
     * One or more of the following must be set.
     * Must be a valid date or time value.
     *
     * Generated from protobuf field <code>.google.type.Date date = 1;</code>
     */
    private $date = null;
    /**
     * Day of week
     *
     * Generated from protobuf field <code>.google.type.DayOfWeek day_of_week = 2;</code>
     */
    private $day_of_week = 0;
    /**
     * Time of day
     *
     * Generated from protobuf field <code>.google.type.TimeOfDay time = 3;</code>
     */
    private $time = null;
    /**
     * Time zone
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.DateTime.TimeZone time_zone = 4;</code>
     */
    private $time_zone = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Type\Date $date
     *           One or more of the following must be set.
     *           Must be a valid date or time value.
     *     @type int $day_of_week
     *           Day of week
     *     @type \Google\Type\TimeOfDay $time
     *           Time of day
     *     @type \Google\Cloud\Dlp\V2\DateTime\TimeZone $time_zone
     *           Time zone
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * One or more of the following must be set.
     * Must be a valid date or time value.
     *
     * Generated from protobuf field <code>.google.type.Date date = 1;</code>
     * @return \Google\Type\Date
     */
    public function getDate()
    {
        return isset($this->date) ? $this->date : null;
    }

    public function hasDate()
    {
        return isset($this->date);
    }

    public function clearDate()
    {
        unset($this->date);
    }

    /**
     * One or more of the following must be set.
     * Must be a valid date or time value.
     *
     * Generated from protobuf field <code>.google.type.Date date = 1;</code>
     * @param \Google\Type\Date $var
     * @return $this
     */
    public function setDate($var)
    {
        GPBUtil::checkMessage($var, \Google\Type\Date::class);
        $this->date = $var;

        return $this;
    }

    /**
     * Day of week
     *
     * Generated from protobuf field <code>.google.type.DayOfWeek day_of_week = 2;</code>
     * @return int
     */
    public function getDayOfWeek()
    {
        return $this->day_of_week;
    }

    /**
     * Day of week
     *
     * Generated from protobuf field <code>.google.type.DayOfWeek day_of_week = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setDayOfWeek($var)
    {
        GPBUtil::checkEnum($var, \Google\Type\DayOfWeek::class);
        $this->day_of_week = $var;

        return $this;
    }

    /**
     * Time of day
     *
     * Generated from protobuf field <code>.google.type.TimeOfDay time = 3;</code>
     * @return \Google\Type\TimeOfDay
     */
    public function getTime()
    {
        return isset($this->time) ? $this->time : null;
    }

    public function hasTime()
    {
        return isset($this->time);
    }

    public function clearTime()
    {
        unset($this->time);
    }

    /**
     * Time of day
     *
     * Generated from protobuf field <code>.google.type.TimeOfDay time = 3;</code>
     * @param \Google\Type\TimeOfDay $var
     * @return $this
     */
    public function setTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Type\TimeOfDay::class);
        $this->time = $var;

        return $this;
    }

    /**
     * Time zone
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.DateTime.TimeZone time_zone = 4;</code>
     * @return \Google\Cloud\Dlp\V2\DateTime\TimeZone
     */
    public function getTimeZone()
    {
        return isset($this->time_zone) ? $this->time_zone : null;
    }

    public function hasTimeZone()
    {
        return isset($this->time_zone);
    }

    public function clearTimeZone()
    {
        unset($this->time_zone);
    }

    /**
     * Time zone
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.DateTime.TimeZone time_zone = 4;</code>
     * @param \Google\Cloud\Dlp\V2\DateTime\TimeZone $var
     * @return $this
     */
    public function setTimeZone($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\DateTime\TimeZone::class);
        $this->time_zone = $var;

        return $this;
    }

}

