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

namespace Google\Cloud\Memcache\V1beta2;

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

/**
 * Request for [RescheduleMaintenance][google.cloud.memcache.v1beta2.CloudMemcache.RescheduleMaintenance].
 *
 * Generated from protobuf message <code>google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest</code>
 */
class RescheduleMaintenanceRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Memcache instance resource name using the form:
     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
     * where `location_id` refers to a GCP region.
     *
     * Generated from protobuf field <code>string instance = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $instance = '';
    /**
     * Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well.
     *
     * Generated from protobuf field <code>.google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest.RescheduleType reschedule_type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $reschedule_type = 0;
    /**
     * Timestamp when the maintenance shall be rescheduled to if
     * reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for
     * example `2012-11-15T16:19:00.094Z`.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp schedule_time = 3;</code>
     */
    private $schedule_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $instance
     *           Required. Memcache instance resource name using the form:
     *               `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
     *           where `location_id` refers to a GCP region.
     *     @type int $reschedule_type
     *           Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well.
     *     @type \Google\Protobuf\Timestamp $schedule_time
     *           Timestamp when the maintenance shall be rescheduled to if
     *           reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for
     *           example `2012-11-15T16:19:00.094Z`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Memcache\V1Beta2\CloudMemcache::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Memcache instance resource name using the form:
     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
     * where `location_id` refers to a GCP region.
     *
     * Generated from protobuf field <code>string instance = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getInstance()
    {
        return $this->instance;
    }

    /**
     * Required. Memcache instance resource name using the form:
     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
     * where `location_id` refers to a GCP region.
     *
     * Generated from protobuf field <code>string instance = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setInstance($var)
    {
        GPBUtil::checkString($var, True);
        $this->instance = $var;

        return $this;
    }

    /**
     * Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well.
     *
     * Generated from protobuf field <code>.google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest.RescheduleType reschedule_type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getRescheduleType()
    {
        return $this->reschedule_type;
    }

    /**
     * Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well.
     *
     * Generated from protobuf field <code>.google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest.RescheduleType reschedule_type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setRescheduleType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Memcache\V1beta2\RescheduleMaintenanceRequest\RescheduleType::class);
        $this->reschedule_type = $var;

        return $this;
    }

    /**
     * Timestamp when the maintenance shall be rescheduled to if
     * reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for
     * example `2012-11-15T16:19:00.094Z`.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp schedule_time = 3;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getScheduleTime()
    {
        return $this->schedule_time;
    }

    public function hasScheduleTime()
    {
        return isset($this->schedule_time);
    }

    public function clearScheduleTime()
    {
        unset($this->schedule_time);
    }

    /**
     * Timestamp when the maintenance shall be rescheduled to if
     * reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for
     * example `2012-11-15T16:19:00.094Z`.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp schedule_time = 3;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setScheduleTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->schedule_time = $var;

        return $this;
    }

}

