<?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;

/**
 * Request for [RescheduleMaintenance][google.cloud.memcache.v1.CloudMemcache.RescheduleMaintenance].
 *
 * Generated from protobuf message <code>google.cloud.memcache.v1.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>
     */
    protected $instance = '';
    /**
     * Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well.
     *
     * Generated from protobuf field <code>.google.cloud.memcache.v1.RescheduleMaintenanceRequest.RescheduleType reschedule_type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $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>
     */
    protected $schedule_time = null;

    /**
     * @param 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. Please see
     *                                                   {@see CloudMemcacheClient::instanceName()} for help formatting this field.
     * @param int                        $rescheduleType Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well.
     *                                                   For allowed values, use constants defined on {@see \Google\Cloud\Memcache\V1\RescheduleMaintenanceRequest\RescheduleType}
     * @param \Google\Protobuf\Timestamp $scheduleTime   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`.
     *
     * @return \Google\Cloud\Memcache\V1\RescheduleMaintenanceRequest
     *
     * @experimental
     */
    public static function build(string $instance, int $rescheduleType, \Google\Protobuf\Timestamp $scheduleTime): self
    {
        return (new self())
            ->setInstance($instance)
            ->setRescheduleType($rescheduleType)
            ->setScheduleTime($scheduleTime);
    }

    /**
     * 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\V1\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.v1.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.v1.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\V1\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;
    }

}

