<?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\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * The request for
 * [FirestoreAdmin.BulkDeleteDocuments][google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments].
 * When both collection_ids and namespace_ids are set, only documents satisfying
 * both conditions will be deleted.
 * Requests with namespace_ids and collection_ids both empty will be rejected.
 * Please use
 * [FirestoreAdmin.DeleteDatabase][google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase]
 * instead.
 *
 * Generated from protobuf message <code>google.firestore.admin.v1.BulkDeleteDocumentsRequest</code>
 */
class BulkDeleteDocumentsRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Database to operate. Should be of the form:
     * `projects/{project_id}/databases/{database_id}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $name = '';
    /**
     * Optional. IDs of the collection groups to delete. Unspecified means all
     * collection groups.
     * Each collection group in this list must be unique.
     *
     * Generated from protobuf field <code>repeated string collection_ids = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $collection_ids;
    /**
     * Optional. Namespaces to delete.
     * An empty list means all namespaces. This is the recommended
     * usage for databases that don't use namespaces.
     * An empty string element represents the default namespace. This should be
     * used if the database has data in non-default namespaces, but doesn't want
     * to delete from them.
     * Each namespace in this list must be unique.
     *
     * Generated from protobuf field <code>repeated string namespace_ids = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $namespace_ids;

    /**
     * @param string $name Required. Database to operate. Should be of the form:
     *                     `projects/{project_id}/databases/{database_id}`. Please see
     *                     {@see FirestoreAdminClient::databaseName()} for help formatting this field.
     *
     * @return \Google\Cloud\Firestore\Admin\V1\BulkDeleteDocumentsRequest
     *
     * @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. Database to operate. Should be of the form:
     *           `projects/{project_id}/databases/{database_id}`.
     *     @type string[] $collection_ids
     *           Optional. IDs of the collection groups to delete. Unspecified means all
     *           collection groups.
     *           Each collection group in this list must be unique.
     *     @type string[] $namespace_ids
     *           Optional. Namespaces to delete.
     *           An empty list means all namespaces. This is the recommended
     *           usage for databases that don't use namespaces.
     *           An empty string element represents the default namespace. This should be
     *           used if the database has data in non-default namespaces, but doesn't want
     *           to delete from them.
     *           Each namespace in this list must be unique.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Firestore\Admin\V1\FirestoreAdmin::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Database to operate. Should be of the form:
     * `projects/{project_id}/databases/{database_id}`.
     *
     * 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. Database to operate. Should be of the form:
     * `projects/{project_id}/databases/{database_id}`.
     *
     * 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. IDs of the collection groups to delete. Unspecified means all
     * collection groups.
     * Each collection group in this list must be unique.
     *
     * Generated from protobuf field <code>repeated string collection_ids = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return RepeatedField<string>
     */
    public function getCollectionIds()
    {
        return $this->collection_ids;
    }

    /**
     * Optional. IDs of the collection groups to delete. Unspecified means all
     * collection groups.
     * Each collection group in this list must be unique.
     *
     * Generated from protobuf field <code>repeated string collection_ids = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string[] $var
     * @return $this
     */
    public function setCollectionIds($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->collection_ids = $arr;

        return $this;
    }

    /**
     * Optional. Namespaces to delete.
     * An empty list means all namespaces. This is the recommended
     * usage for databases that don't use namespaces.
     * An empty string element represents the default namespace. This should be
     * used if the database has data in non-default namespaces, but doesn't want
     * to delete from them.
     * Each namespace in this list must be unique.
     *
     * Generated from protobuf field <code>repeated string namespace_ids = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return RepeatedField<string>
     */
    public function getNamespaceIds()
    {
        return $this->namespace_ids;
    }

    /**
     * Optional. Namespaces to delete.
     * An empty list means all namespaces. This is the recommended
     * usage for databases that don't use namespaces.
     * An empty string element represents the default namespace. This should be
     * used if the database has data in non-default namespaces, but doesn't want
     * to delete from them.
     * Each namespace in this list must be unique.
     *
     * Generated from protobuf field <code>repeated string namespace_ids = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string[] $var
     * @return $this
     */
    public function setNamespaceIds($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->namespace_ids = $arr;

        return $this;
    }

}

