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

namespace Google\Cloud\Redis\V1;

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

/**
 * Maintenance policy for an instance.
 *
 * Generated from protobuf message <code>google.cloud.redis.v1.MaintenancePolicy</code>
 */
class MaintenancePolicy extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The time when the policy was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $create_time = null;
    /**
     * Output only. The time when the policy was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $update_time = null;
    /**
     * Optional. Description of what this policy is for. Create/Update methods
     * return INVALID_ARGUMENT if the length is greater than 512.
     *
     * Generated from protobuf field <code>string description = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $description = '';
    /**
     * Optional. Maintenance window that is applied to resources covered by this
     * policy. Minimum 1. For the current version, the maximum number of
     * weekly_window is expected to be one.
     *
     * Generated from protobuf field <code>repeated .google.cloud.redis.v1.WeeklyMaintenanceWindow weekly_maintenance_window = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $weekly_maintenance_window;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The time when the policy was created.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. The time when the policy was last updated.
     *     @type string $description
     *           Optional. Description of what this policy is for. Create/Update methods
     *           return INVALID_ARGUMENT if the length is greater than 512.
     *     @type array<\Google\Cloud\Redis\V1\WeeklyMaintenanceWindow>|\Google\Protobuf\Internal\RepeatedField $weekly_maintenance_window
     *           Optional. Maintenance window that is applied to resources covered by this
     *           policy. Minimum 1. For the current version, the maximum number of
     *           weekly_window is expected to be one.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Redis\V1\CloudRedis::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The time when the policy was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. The time when the policy was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Output only. The time when the policy was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * Output only. The time when the policy was last updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

    /**
     * Optional. Description of what this policy is for. Create/Update methods
     * return INVALID_ARGUMENT if the length is greater than 512.
     *
     * Generated from protobuf field <code>string description = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Optional. Description of what this policy is for. Create/Update methods
     * return INVALID_ARGUMENT if the length is greater than 512.
     *
     * Generated from protobuf field <code>string description = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * Optional. Maintenance window that is applied to resources covered by this
     * policy. Minimum 1. For the current version, the maximum number of
     * weekly_window is expected to be one.
     *
     * Generated from protobuf field <code>repeated .google.cloud.redis.v1.WeeklyMaintenanceWindow weekly_maintenance_window = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getWeeklyMaintenanceWindow()
    {
        return $this->weekly_maintenance_window;
    }

    /**
     * Optional. Maintenance window that is applied to resources covered by this
     * policy. Minimum 1. For the current version, the maximum number of
     * weekly_window is expected to be one.
     *
     * Generated from protobuf field <code>repeated .google.cloud.redis.v1.WeeklyMaintenanceWindow weekly_maintenance_window = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<\Google\Cloud\Redis\V1\WeeklyMaintenanceWindow>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setWeeklyMaintenanceWindow($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Redis\V1\WeeklyMaintenanceWindow::class);
        $this->weekly_maintenance_window = $arr;

        return $this;
    }

}

