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

namespace Google\Cloud\Sql\V1;

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.v1.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: **canary** (Earlier) or **stable** (Later).
     * [Learn
     * more](https://cloud.google.com/sql/docs/mysql/instance-settings#maintenance-timing-2ndgen).
     *
     * Generated from protobuf field <code>.google.cloud.sql.v1.SqlUpdateTrack update_track = 3;</code>
     */
    private $update_track = 0;
    /**
     * This is always **sql#maintenanceWindow**.
     *
     * 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: **canary** (Earlier) or **stable** (Later).
     *           [Learn
     *           more](https://cloud.google.com/sql/docs/mysql/instance-settings#maintenance-timing-2ndgen).
     *     @type string $kind
     *           This is always **sql#maintenanceWindow**.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Sql\V1\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 $this->hour;
    }

    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 $this->day;
    }

    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: **canary** (Earlier) or **stable** (Later).
     * [Learn
     * more](https://cloud.google.com/sql/docs/mysql/instance-settings#maintenance-timing-2ndgen).
     *
     * Generated from protobuf field <code>.google.cloud.sql.v1.SqlUpdateTrack update_track = 3;</code>
     * @return int
     */
    public function getUpdateTrack()
    {
        return $this->update_track;
    }

    /**
     * Maintenance timing setting: **canary** (Earlier) or **stable** (Later).
     * [Learn
     * more](https://cloud.google.com/sql/docs/mysql/instance-settings#maintenance-timing-2ndgen).
     *
     * Generated from protobuf field <code>.google.cloud.sql.v1.SqlUpdateTrack update_track = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setUpdateTrack($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Sql\V1\SqlUpdateTrack::class);
        $this->update_track = $var;

        return $this;
    }

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

    /**
     * This is always **sql#maintenanceWindow**.
     *
     * 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;
    }

}

