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

namespace Google\Cloud\Sql\V1beta4\DatabaseInstance;

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

/**
 * Any scheduled maintenancce for this instance.
 *
 * Generated from protobuf message <code>google.cloud.sql.v1beta4.DatabaseInstance.SqlScheduledMaintenance</code>
 */
class SqlScheduledMaintenance extends \Google\Protobuf\Internal\Message
{
    /**
     * The start time of any upcoming scheduled maintenance for this instance.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 1;</code>
     */
    private $start_time = null;
    /**
     * Generated from protobuf field <code>bool can_defer = 2 [deprecated = true];</code>
     * @deprecated
     */
    protected $can_defer = false;
    /**
     * If the scheduled maintenance can be rescheduled.
     *
     * Generated from protobuf field <code>bool can_reschedule = 3;</code>
     */
    private $can_reschedule = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Timestamp $start_time
     *           The start time of any upcoming scheduled maintenance for this instance.
     *     @type bool $can_defer
     *     @type bool $can_reschedule
     *           If the scheduled maintenance can be rescheduled.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Sql\V1Beta4\CloudSqlResources::initOnce();
        parent::__construct($data);
    }

    /**
     * The start time of any upcoming scheduled maintenance for this instance.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 1;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getStartTime()
    {
        return $this->start_time;
    }

    public function hasStartTime()
    {
        return isset($this->start_time);
    }

    public function clearStartTime()
    {
        unset($this->start_time);
    }

    /**
     * The start time of any upcoming scheduled maintenance for this instance.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 1;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setStartTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->start_time = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bool can_defer = 2 [deprecated = true];</code>
     * @return bool
     * @deprecated
     */
    public function getCanDefer()
    {
        @trigger_error('can_defer is deprecated.', E_USER_DEPRECATED);
        return $this->can_defer;
    }

    /**
     * Generated from protobuf field <code>bool can_defer = 2 [deprecated = true];</code>
     * @param bool $var
     * @return $this
     * @deprecated
     */
    public function setCanDefer($var)
    {
        @trigger_error('can_defer is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkBool($var);
        $this->can_defer = $var;

        return $this;
    }

    /**
     * If the scheduled maintenance can be rescheduled.
     *
     * Generated from protobuf field <code>bool can_reschedule = 3;</code>
     * @return bool
     */
    public function getCanReschedule()
    {
        return $this->can_reschedule;
    }

    /**
     * If the scheduled maintenance can be rescheduled.
     *
     * Generated from protobuf field <code>bool can_reschedule = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setCanReschedule($var)
    {
        GPBUtil::checkBool($var);
        $this->can_reschedule = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(SqlScheduledMaintenance::class, \Google\Cloud\Sql\V1beta4\DatabaseInstance_SqlScheduledMaintenance::class);

