<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/sql/v1beta4/cloud_sql_resources.proto

namespace Google\Cloud\Sql\V1beta4;

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

/**
 * Maintenance window. This specifies when a Cloud SQL instance
 * is restarted for system maintenance purposes.
 *
 * Generated from protobuf message <code>google.cloud.sql.v1beta4.MaintenanceWindow</code>
 */
class MaintenanceWindow extends \Google\Protobuf\Internal\Message
{
    /**
     * hour of day - 0 to 23.
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value hour = 1;</code>
     */
    private $hour = null;
    /**
     * day of week (1-7), starting on Monday.
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value day = 2;</code>
     */
    private $day = null;
    /**
     * Maintenance timing setting: <b>canary</b> (Earlier) or
     * <b>stable</b> (Later). <br /><a
     * href="/sql/docs/db_path/instance-settings#maintenance-timing-2ndgen">
     * Learn more</a>.
     *
     * Generated from protobuf field <code>.google.cloud.sql.v1beta4.SqlUpdateTrack update_track = 3;</code>
     */
    private $update_track = 0;
    /**
     * This is always <b>sql#maintenanceWindow</b>.
     *
     * Generated from protobuf field <code>string kind = 4;</code>
     */
    private $kind = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Int32Value $hour
     *           hour of day - 0 to 23.
     *     @type \Google\Protobuf\Int32Value $day
     *           day of week (1-7), starting on Monday.
     *     @type int $update_track
     *           Maintenance timing setting: <b>canary</b> (Earlier) or
     *           <b>stable</b> (Later). <br /><a
     *           href="/sql/docs/db_path/instance-settings#maintenance-timing-2ndgen">
     *           Learn more</a>.
     *     @type string $kind
     *           This is always <b>sql#maintenanceWindow</b>.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Sql\V1Beta4\CloudSqlResources::initOnce();
        parent::__construct($data);
    }

    /**
     * hour of day - 0 to 23.
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value hour = 1;</code>
     * @return \Google\Protobuf\Int32Value|null
     */
    public function getHour()
    {
        return isset($this->hour) ? $this->hour : null;
    }

    public function hasHour()
    {
        return isset($this->hour);
    }

    public function clearHour()
    {
        unset($this->hour);
    }

    /**
     * Returns the unboxed value from <code>getHour()</code>

     * hour of day - 0 to 23.
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value hour = 1;</code>
     * @return int|null
     */
    public function getHourValue()
    {
        return $this->readWrapperValue("hour");
    }

    /**
     * hour of day - 0 to 23.
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value hour = 1;</code>
     * @param \Google\Protobuf\Int32Value $var
     * @return $this
     */
    public function setHour($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class);
        $this->hour = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object.

     * hour of day - 0 to 23.
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value hour = 1;</code>
     * @param int|null $var
     * @return $this
     */
    public function setHourValue($var)
    {
        $this->writeWrapperValue("hour", $var);
        return $this;}

    /**
     * day of week (1-7), starting on Monday.
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value day = 2;</code>
     * @return \Google\Protobuf\Int32Value|null
     */
    public function getDay()
    {
        return isset($this->day) ? $this->day : null;
    }

    public function hasDay()
    {
        return isset($this->day);
    }

    public function clearDay()
    {
        unset($this->day);
    }

    /**
     * Returns the unboxed value from <code>getDay()</code>

     * day of week (1-7), starting on Monday.
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value day = 2;</code>
     * @return int|null
     */
    public function getDayValue()
    {
        return $this->readWrapperValue("day");
    }

    /**
     * day of week (1-7), starting on Monday.
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value day = 2;</code>
     * @param \Google\Protobuf\Int32Value $var
     * @return $this
     */
    public function setDay($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class);
        $this->day = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object.

     * day of week (1-7), starting on Monday.
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value day = 2;</code>
     * @param int|null $var
     * @return $this
     */
    public function setDayValue($var)
    {
        $this->writeWrapperValue("day", $var);
        return $this;}

    /**
     * Maintenance timing setting: <b>canary</b> (Earlier) or
     * <b>stable</b> (Later). <br /><a
     * href="/sql/docs/db_path/instance-settings#maintenance-timing-2ndgen">
     * Learn more</a>.
     *
     * Generated from protobuf field <code>.google.cloud.sql.v1beta4.SqlUpdateTrack update_track = 3;</code>
     * @return int
     */
    public function getUpdateTrack()
    {
        return $this->update_track;
    }

    /**
     * Maintenance timing setting: <b>canary</b> (Earlier) or
     * <b>stable</b> (Later). <br /><a
     * href="/sql/docs/db_path/instance-settings#maintenance-timing-2ndgen">
     * Learn more</a>.
     *
     * Generated from protobuf field <code>.google.cloud.sql.v1beta4.SqlUpdateTrack update_track = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setUpdateTrack($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Sql\V1beta4\SqlUpdateTrack::class);
        $this->update_track = $var;

        return $this;
    }

    /**
     * This is always <b>sql#maintenanceWindow</b>.
     *
     * Generated from protobuf field <code>string kind = 4;</code>
     * @return string
     */
    public function getKind()
    {
        return $this->kind;
    }

    /**
     * This is always <b>sql#maintenanceWindow</b>.
     *
     * Generated from protobuf field <code>string kind = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setKind($var)
    {
        GPBUtil::checkString($var, True);
        $this->kind = $var;

        return $this;
    }

}

