<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/bigtable/admin/v2/instance.proto

namespace Google\Cloud\Bigtable\Admin\V2;

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

/**
 * A SQL logical view object that can be referenced in SQL queries.
 *
 * Generated from protobuf message <code>google.bigtable.admin.v2.LogicalView</code>
 */
class LogicalView extends \Google\Protobuf\Internal\Message
{
    /**
     * Identifier. The unique name of the logical view.
     * Format:
     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     */
    protected $name = '';
    /**
     * Required. The logical view's select query.
     *
     * Generated from protobuf field <code>string query = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $query = '';
    /**
     * Optional. The etag for this logical view.
     * This may be sent on update requests to ensure that the client has an
     * up-to-date value before proceeding. The server returns an ABORTED error on
     * a mismatched etag.
     *
     * Generated from protobuf field <code>string etag = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $etag = '';
    /**
     * Optional. Set to true to make the LogicalView protected against deletion.
     *
     * Generated from protobuf field <code>bool deletion_protection = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $deletion_protection = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Identifier. The unique name of the logical view.
     *           Format:
     *           `projects/{project}/instances/{instance}/logicalViews/{logical_view}`
     *     @type string $query
     *           Required. The logical view's select query.
     *     @type string $etag
     *           Optional. The etag for this logical view.
     *           This may be sent on update requests to ensure that the client has an
     *           up-to-date value before proceeding. The server returns an ABORTED error on
     *           a mismatched etag.
     *     @type bool $deletion_protection
     *           Optional. Set to true to make the LogicalView protected against deletion.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Bigtable\Admin\V2\Instance::initOnce();
        parent::__construct($data);
    }

    /**
     * Identifier. The unique name of the logical view.
     * Format:
     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Identifier. The unique name of the logical view.
     * Format:
     * `projects/{project}/instances/{instance}/logicalViews/{logical_view}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Required. The logical view's select query.
     *
     * Generated from protobuf field <code>string query = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getQuery()
    {
        return $this->query;
    }

    /**
     * Required. The logical view's select query.
     *
     * Generated from protobuf field <code>string query = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setQuery($var)
    {
        GPBUtil::checkString($var, True);
        $this->query = $var;

        return $this;
    }

    /**
     * Optional. The etag for this logical view.
     * This may be sent on update requests to ensure that the client has an
     * up-to-date value before proceeding. The server returns an ABORTED error on
     * a mismatched etag.
     *
     * Generated from protobuf field <code>string etag = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getEtag()
    {
        return $this->etag;
    }

    /**
     * Optional. The etag for this logical view.
     * This may be sent on update requests to ensure that the client has an
     * up-to-date value before proceeding. The server returns an ABORTED error on
     * a mismatched etag.
     *
     * Generated from protobuf field <code>string etag = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setEtag($var)
    {
        GPBUtil::checkString($var, True);
        $this->etag = $var;

        return $this;
    }

    /**
     * Optional. Set to true to make the LogicalView protected against deletion.
     *
     * Generated from protobuf field <code>bool deletion_protection = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool
     */
    public function getDeletionProtection()
    {
        return $this->deletion_protection;
    }

    /**
     * Optional. Set to true to make the LogicalView protected against deletion.
     *
     * Generated from protobuf field <code>bool deletion_protection = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool $var
     * @return $this
     */
    public function setDeletionProtection($var)
    {
        GPBUtil::checkBool($var);
        $this->deletion_protection = $var;

        return $this;
    }

}

