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

namespace Google\Cloud\Bigtable\V2\Type\Bytes;

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

/**
 * Rules used to convert to or from lower level types.
 *
 * Generated from protobuf message <code>google.bigtable.v2.Type.Bytes.Encoding</code>
 */
class Encoding extends \Google\Protobuf\Internal\Message
{
    protected $encoding;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Bigtable\V2\Type\Bytes\Encoding\Raw $raw
     *           Use `Raw` encoding.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Bigtable\V2\Types::initOnce();
        parent::__construct($data);
    }

    /**
     * Use `Raw` encoding.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1;</code>
     * @return \Google\Cloud\Bigtable\V2\Type\Bytes\Encoding\Raw|null
     */
    public function getRaw()
    {
        return $this->readOneof(1);
    }

    public function hasRaw()
    {
        return $this->hasOneof(1);
    }

    /**
     * Use `Raw` encoding.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type.Bytes.Encoding.Raw raw = 1;</code>
     * @param \Google\Cloud\Bigtable\V2\Type\Bytes\Encoding\Raw $var
     * @return $this
     */
    public function setRaw($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type\Bytes\Encoding\Raw::class);
        $this->writeOneof(1, $var);

        return $this;
    }

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

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Encoding::class, \Google\Cloud\Bigtable\V2\Type_Bytes_Encoding::class);

