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

namespace Google\Cloud\Memcache\V1;

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

/**
 * Maintenance policy per instance.
 *
 * Generated from protobuf message <code>google.cloud.memcache.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 updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $update_time = null;
    /**
     * 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;</code>
     */
    private $description = '';
    /**
     * Required. Maintenance window that is applied to resources covered by this
     * policy. Minimum 1. For the current version, the maximum number of
     * weekly_maintenance_windows is expected to be one.
     *
     * Generated from protobuf field <code>repeated .google.cloud.memcache.v1.WeeklyMaintenanceWindow weekly_maintenance_window = 4 [(.google.api.field_behavior) = REQUIRED];</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 updated.
     *     @type string $description
     *           Description of what this policy is for. Create/Update methods
     *           return INVALID_ARGUMENT if the length is greater than 512.
     *     @type array<\Google\Cloud\Memcache\V1\WeeklyMaintenanceWindow>|\Google\Protobuf\Internal\RepeatedField $weekly_maintenance_window
     *           Required. Maintenance window that is applied to resources covered by this
     *           policy. Minimum 1. For the current version, the maximum number of
     *           weekly_maintenance_windows is expected to be one.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Memcache\V1\CloudMemcache::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 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 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;
    }

    /**
     * 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;</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * 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;</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

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

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

        return $this;
    }

}

