<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/orchestration/airflow/service/v1/environments.proto

namespace Google\Cloud\Orchestration\Airflow\Service\V1;

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

/**
 * The configuration settings for Cloud Composer maintenance window.
 * The following example:
 * ```
 *    {
 *      "startTime":"2019-08-01T01:00:00Z"
 *      "endTime":"2019-08-01T07:00:00Z"
 *      "recurrence":"FREQ=WEEKLY;BYDAY=TU,WE"
 *    }
 * ```
 * would define a maintenance window between 01 and 07 hours UTC during
 * each Tuesday and Wednesday.
 *
 * Generated from protobuf message <code>google.cloud.orchestration.airflow.service.v1.MaintenanceWindow</code>
 */
class MaintenanceWindow extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Start time of the first recurrence of the maintenance window.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $start_time = null;
    /**
     * Required. Maintenance window end time. It is used only to calculate the
     * duration of the maintenance window. The value for end-time must be in the
     * future, relative to `start_time`.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $end_time = null;
    /**
     * Required. Maintenance window recurrence. Format is a subset of
     * [RFC-5545](https://tools.ietf.org/html/rfc5545) `RRULE`. The only allowed
     * values for `FREQ` field are `FREQ=DAILY` and `FREQ=WEEKLY;BYDAY=...`
     * Example values: `FREQ=WEEKLY;BYDAY=TU,WE`, `FREQ=DAILY`.
     *
     * Generated from protobuf field <code>string recurrence = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $recurrence = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Timestamp $start_time
     *           Required. Start time of the first recurrence of the maintenance window.
     *     @type \Google\Protobuf\Timestamp $end_time
     *           Required. Maintenance window end time. It is used only to calculate the
     *           duration of the maintenance window. The value for end-time must be in the
     *           future, relative to `start_time`.
     *     @type string $recurrence
     *           Required. Maintenance window recurrence. Format is a subset of
     *           [RFC-5545](https://tools.ietf.org/html/rfc5545) `RRULE`. The only allowed
     *           values for `FREQ` field are `FREQ=DAILY` and `FREQ=WEEKLY;BYDAY=...`
     *           Example values: `FREQ=WEEKLY;BYDAY=TU,WE`, `FREQ=DAILY`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Orchestration\Airflow\Service\V1\Environments::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Start time of the first recurrence of the maintenance window.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = REQUIRED];</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);
    }

    /**
     * Required. Start time of the first recurrence of the maintenance window.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = REQUIRED];</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;
    }

    /**
     * Required. Maintenance window end time. It is used only to calculate the
     * duration of the maintenance window. The value for end-time must be in the
     * future, relative to `start_time`.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getEndTime()
    {
        return $this->end_time;
    }

    public function hasEndTime()
    {
        return isset($this->end_time);
    }

    public function clearEndTime()
    {
        unset($this->end_time);
    }

    /**
     * Required. Maintenance window end time. It is used only to calculate the
     * duration of the maintenance window. The value for end-time must be in the
     * future, relative to `start_time`.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setEndTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->end_time = $var;

        return $this;
    }

    /**
     * Required. Maintenance window recurrence. Format is a subset of
     * [RFC-5545](https://tools.ietf.org/html/rfc5545) `RRULE`. The only allowed
     * values for `FREQ` field are `FREQ=DAILY` and `FREQ=WEEKLY;BYDAY=...`
     * Example values: `FREQ=WEEKLY;BYDAY=TU,WE`, `FREQ=DAILY`.
     *
     * Generated from protobuf field <code>string recurrence = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getRecurrence()
    {
        return $this->recurrence;
    }

    /**
     * Required. Maintenance window recurrence. Format is a subset of
     * [RFC-5545](https://tools.ietf.org/html/rfc5545) `RRULE`. The only allowed
     * values for `FREQ` field are `FREQ=DAILY` and `FREQ=WEEKLY;BYDAY=...`
     * Example values: `FREQ=WEEKLY;BYDAY=TU,WE`, `FREQ=DAILY`.
     *
     * Generated from protobuf field <code>string recurrence = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setRecurrence($var)
    {
        GPBUtil::checkString($var, True);
        $this->recurrence = $var;

        return $this;
    }

}

