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

namespace Google\Cloud\Redis\Cluster\V1;

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

/**
 * Request for [BackupCluster].
 *
 * Generated from protobuf message <code>google.cloud.redis.cluster.v1.BackupClusterRequest</code>
 */
class BackupClusterRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Redis cluster resource name using the form:
     *  `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
     * where `location_id` refers to a GCP region.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $name = '';
    /**
     * Optional. TTL for the backup to expire. Value range is 1 day to 100 years.
     * If not specified, the default value is 100 years.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration ttl = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $ttl = null;
    /**
     * Optional. The id of the backup to be created. If not specified, the
     * default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used.
     *
     * Generated from protobuf field <code>optional string backup_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $backup_id = null;

    /**
     * @param string $name Required. Redis cluster resource name using the form:
     *                     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
     *                     where `location_id` refers to a GCP region. Please see
     *                     {@see CloudRedisClusterClient::clusterName()} for help formatting this field.
     *
     * @return \Google\Cloud\Redis\Cluster\V1\BackupClusterRequest
     *
     * @experimental
     */
    public static function build(string $name): self
    {
        return (new self())
            ->setName($name);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. Redis cluster resource name using the form:
     *            `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
     *           where `location_id` refers to a GCP region.
     *     @type \Google\Protobuf\Duration $ttl
     *           Optional. TTL for the backup to expire. Value range is 1 day to 100 years.
     *           If not specified, the default value is 100 years.
     *     @type string $backup_id
     *           Optional. The id of the backup to be created. If not specified, the
     *           default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce();
        parent::__construct($data);
    }

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

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

        return $this;
    }

    /**
     * Optional. TTL for the backup to expire. Value range is 1 day to 100 years.
     * If not specified, the default value is 100 years.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration ttl = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getTtl()
    {
        return $this->ttl;
    }

    public function hasTtl()
    {
        return isset($this->ttl);
    }

    public function clearTtl()
    {
        unset($this->ttl);
    }

    /**
     * Optional. TTL for the backup to expire. Value range is 1 day to 100 years.
     * If not specified, the default value is 100 years.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration ttl = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setTtl($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->ttl = $var;

        return $this;
    }

    /**
     * Optional. The id of the backup to be created. If not specified, the
     * default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used.
     *
     * Generated from protobuf field <code>optional string backup_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getBackupId()
    {
        return isset($this->backup_id) ? $this->backup_id : '';
    }

    public function hasBackupId()
    {
        return isset($this->backup_id);
    }

    public function clearBackupId()
    {
        unset($this->backup_id);
    }

    /**
     * Optional. The id of the backup to be created. If not specified, the
     * default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used.
     *
     * Generated from protobuf field <code>optional string backup_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setBackupId($var)
    {
        GPBUtil::checkString($var, True);
        $this->backup_id = $var;

        return $this;
    }

}

