<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/firestore/admin/v1/firestore_admin.proto

namespace Google\Cloud\Firestore\Admin\V1;

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

/**
 * The request message for
 * [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.FirestoreAdmin.RestoreDatabase].
 *
 * Generated from protobuf message <code>google.firestore.admin.v1.RestoreDatabaseRequest</code>
 */
class RestoreDatabaseRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The project to restore the database in. Format is
     * `projects/{project_id}`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * Required. The ID to use for the database, which will become the final
     * component of the database's resource name. This database ID must not be
     * associated with an existing database.
     * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
     * with first character a letter and the last a letter or a number. Must not
     * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
     * "(default)" database ID is also valid.
     *
     * Generated from protobuf field <code>string database_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $database_id = '';
    /**
     * Required. Backup to restore from. Must be from the same project as the
     * parent.
     * The restored database will be created in the same location as the source
     * backup.
     * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
     *
     * Generated from protobuf field <code>string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $backup = '';
    /**
     * Optional. Encryption configuration for the restored database.
     * If this field is not specified, the restored database will use
     * the same encryption configuration as the backup, namely
     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
     *
     * Generated from protobuf field <code>.google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $encryption_config = null;
    /**
     * Optional. Immutable. Tags to be bound to the restored database.
     * The tags should be provided in the format of
     * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
     *
     * Generated from protobuf field <code>map<string, string> tags = 10 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $tags;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The project to restore the database in. Format is
     *           `projects/{project_id}`.
     *     @type string $database_id
     *           Required. The ID to use for the database, which will become the final
     *           component of the database's resource name. This database ID must not be
     *           associated with an existing database.
     *           This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
     *           with first character a letter and the last a letter or a number. Must not
     *           be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
     *           "(default)" database ID is also valid.
     *     @type string $backup
     *           Required. Backup to restore from. Must be from the same project as the
     *           parent.
     *           The restored database will be created in the same location as the source
     *           backup.
     *           Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
     *     @type \Google\Cloud\Firestore\Admin\V1\Database\EncryptionConfig $encryption_config
     *           Optional. Encryption configuration for the restored database.
     *           If this field is not specified, the restored database will use
     *           the same encryption configuration as the backup, namely
     *           [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
     *     @type array|\Google\Protobuf\Internal\MapField $tags
     *           Optional. Immutable. Tags to be bound to the restored database.
     *           The tags should be provided in the format of
     *           `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The project to restore the database in. Format is
     * `projects/{project_id}`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The project to restore the database in. Format is
     * `projects/{project_id}`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Required. The ID to use for the database, which will become the final
     * component of the database's resource name. This database ID must not be
     * associated with an existing database.
     * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
     * with first character a letter and the last a letter or a number. Must not
     * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
     * "(default)" database ID is also valid.
     *
     * Generated from protobuf field <code>string database_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getDatabaseId()
    {
        return $this->database_id;
    }

    /**
     * Required. The ID to use for the database, which will become the final
     * component of the database's resource name. This database ID must not be
     * associated with an existing database.
     * This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
     * with first character a letter and the last a letter or a number. Must not
     * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
     * "(default)" database ID is also valid.
     *
     * Generated from protobuf field <code>string database_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setDatabaseId($var)
    {
        GPBUtil::checkString($var, True);
        $this->database_id = $var;

        return $this;
    }

    /**
     * Required. Backup to restore from. Must be from the same project as the
     * parent.
     * The restored database will be created in the same location as the source
     * backup.
     * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
     *
     * Generated from protobuf field <code>string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getBackup()
    {
        return $this->backup;
    }

    /**
     * Required. Backup to restore from. Must be from the same project as the
     * parent.
     * The restored database will be created in the same location as the source
     * backup.
     * Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
     *
     * Generated from protobuf field <code>string backup = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setBackup($var)
    {
        GPBUtil::checkString($var, True);
        $this->backup = $var;

        return $this;
    }

    /**
     * Optional. Encryption configuration for the restored database.
     * If this field is not specified, the restored database will use
     * the same encryption configuration as the backup, namely
     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
     *
     * Generated from protobuf field <code>.google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Firestore\Admin\V1\Database\EncryptionConfig|null
     */
    public function getEncryptionConfig()
    {
        return $this->encryption_config;
    }

    public function hasEncryptionConfig()
    {
        return isset($this->encryption_config);
    }

    public function clearEncryptionConfig()
    {
        unset($this->encryption_config);
    }

    /**
     * Optional. Encryption configuration for the restored database.
     * If this field is not specified, the restored database will use
     * the same encryption configuration as the backup, namely
     * [use_source_encryption][google.firestore.admin.v1.Database.EncryptionConfig.use_source_encryption].
     *
     * Generated from protobuf field <code>.google.firestore.admin.v1.Database.EncryptionConfig encryption_config = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Firestore\Admin\V1\Database\EncryptionConfig $var
     * @return $this
     */
    public function setEncryptionConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Firestore\Admin\V1\Database\EncryptionConfig::class);
        $this->encryption_config = $var;

        return $this;
    }

    /**
     * Optional. Immutable. Tags to be bound to the restored database.
     * The tags should be provided in the format of
     * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
     *
     * Generated from protobuf field <code>map<string, string> tags = 10 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getTags()
    {
        return $this->tags;
    }

    /**
     * Optional. Immutable. Tags to be bound to the restored database.
     * The tags should be provided in the format of
     * `tagKeys/{tag_key_id} -> tagValues/{tag_value_id}`.
     *
     * Generated from protobuf field <code>map<string, string> tags = 10 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OPTIONAL];</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setTags($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->tags = $arr;

        return $this;
    }

}

