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

namespace Google\Cloud\Bigtable\Admin\V2;

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

/**
 * A named collection of related schemas.
 *
 * Generated from protobuf message <code>google.bigtable.admin.v2.SchemaBundle</code>
 */
class SchemaBundle extends \Google\Protobuf\Internal\Message
{
    /**
     * Identifier. The unique name identifying this schema bundle.
     * Values are of the form
     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     */
    protected $name = '';
    /**
     * Optional. The etag for this schema bundle.
     * This may be sent on update and delete requests to ensure 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 = '';
    protected $type;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Identifier. The unique name identifying this schema bundle.
     *           Values are of the form
     *           `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
     *     @type \Google\Cloud\Bigtable\Admin\V2\ProtoSchema $proto_schema
     *           Schema for Protobufs.
     *     @type string $etag
     *           Optional. The etag for this schema bundle.
     *           This may be sent on update and delete requests to ensure the
     *           client has an up-to-date value before proceeding. The server
     *           returns an ABORTED error on a mismatched etag.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Bigtable\Admin\V2\Table::initOnce();
        parent::__construct($data);
    }

    /**
     * Identifier. The unique name identifying this schema bundle.
     * Values are of the form
     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
     *
     * 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 identifying this schema bundle.
     * Values are of the form
     * `projects/{project}/instances/{instance}/tables/{table}/schemaBundles/{schema_bundle}`
     *
     * 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;
    }

    /**
     * Schema for Protobufs.
     *
     * Generated from protobuf field <code>.google.bigtable.admin.v2.ProtoSchema proto_schema = 2;</code>
     * @return \Google\Cloud\Bigtable\Admin\V2\ProtoSchema|null
     */
    public function getProtoSchema()
    {
        return $this->readOneof(2);
    }

    public function hasProtoSchema()
    {
        return $this->hasOneof(2);
    }

    /**
     * Schema for Protobufs.
     *
     * Generated from protobuf field <code>.google.bigtable.admin.v2.ProtoSchema proto_schema = 2;</code>
     * @param \Google\Cloud\Bigtable\Admin\V2\ProtoSchema $var
     * @return $this
     */
    public function setProtoSchema($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\ProtoSchema::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Optional. The etag for this schema bundle.
     * This may be sent on update and delete requests to ensure 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 schema bundle.
     * This may be sent on update and delete requests to ensure 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;
    }

    /**
     * @return string
     */
    public function getType()
    {
        return $this->whichOneof("type");
    }

}

