<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/datacatalog/v1/physical_schema.proto

namespace Google\Cloud\DataCatalog\V1;

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

/**
 * Native schema used by a resource represented as an entry. Used by query
 * engines for deserializing and parsing source data.
 *
 * Generated from protobuf message <code>google.cloud.datacatalog.v1.PhysicalSchema</code>
 */
class PhysicalSchema extends \Google\Protobuf\Internal\Message
{
    protected $schema;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\DataCatalog\V1\PhysicalSchema\AvroSchema $avro
     *           Schema in Avro JSON format.
     *     @type \Google\Cloud\DataCatalog\V1\PhysicalSchema\ThriftSchema $thrift
     *           Schema in Thrift format.
     *     @type \Google\Cloud\DataCatalog\V1\PhysicalSchema\ProtobufSchema $protobuf
     *           Schema in protocol buffer format.
     *     @type \Google\Cloud\DataCatalog\V1\PhysicalSchema\ParquetSchema $parquet
     *           Marks a Parquet-encoded data source.
     *     @type \Google\Cloud\DataCatalog\V1\PhysicalSchema\OrcSchema $orc
     *           Marks an ORC-encoded data source.
     *     @type \Google\Cloud\DataCatalog\V1\PhysicalSchema\CsvSchema $csv
     *           Marks a CSV-encoded data source.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Datacatalog\V1\PhysicalSchema::initOnce();
        parent::__construct($data);
    }

    /**
     * Schema in Avro JSON format.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.PhysicalSchema.AvroSchema avro = 1;</code>
     * @return \Google\Cloud\DataCatalog\V1\PhysicalSchema\AvroSchema|null
     */
    public function getAvro()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Schema in Avro JSON format.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.PhysicalSchema.AvroSchema avro = 1;</code>
     * @param \Google\Cloud\DataCatalog\V1\PhysicalSchema\AvroSchema $var
     * @return $this
     */
    public function setAvro($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\V1\PhysicalSchema\AvroSchema::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Schema in Thrift format.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.PhysicalSchema.ThriftSchema thrift = 2;</code>
     * @return \Google\Cloud\DataCatalog\V1\PhysicalSchema\ThriftSchema|null
     */
    public function getThrift()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Schema in Thrift format.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.PhysicalSchema.ThriftSchema thrift = 2;</code>
     * @param \Google\Cloud\DataCatalog\V1\PhysicalSchema\ThriftSchema $var
     * @return $this
     */
    public function setThrift($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\V1\PhysicalSchema\ThriftSchema::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Schema in protocol buffer format.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.PhysicalSchema.ProtobufSchema protobuf = 3;</code>
     * @return \Google\Cloud\DataCatalog\V1\PhysicalSchema\ProtobufSchema|null
     */
    public function getProtobuf()
    {
        return $this->readOneof(3);
    }

    public function hasProtobuf()
    {
        return $this->hasOneof(3);
    }

    /**
     * Schema in protocol buffer format.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.PhysicalSchema.ProtobufSchema protobuf = 3;</code>
     * @param \Google\Cloud\DataCatalog\V1\PhysicalSchema\ProtobufSchema $var
     * @return $this
     */
    public function setProtobuf($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\V1\PhysicalSchema\ProtobufSchema::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Marks a Parquet-encoded data source.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.PhysicalSchema.ParquetSchema parquet = 4;</code>
     * @return \Google\Cloud\DataCatalog\V1\PhysicalSchema\ParquetSchema|null
     */
    public function getParquet()
    {
        return $this->readOneof(4);
    }

    public function hasParquet()
    {
        return $this->hasOneof(4);
    }

    /**
     * Marks a Parquet-encoded data source.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.PhysicalSchema.ParquetSchema parquet = 4;</code>
     * @param \Google\Cloud\DataCatalog\V1\PhysicalSchema\ParquetSchema $var
     * @return $this
     */
    public function setParquet($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\V1\PhysicalSchema\ParquetSchema::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Marks an ORC-encoded data source.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.PhysicalSchema.OrcSchema orc = 5;</code>
     * @return \Google\Cloud\DataCatalog\V1\PhysicalSchema\OrcSchema|null
     */
    public function getOrc()
    {
        return $this->readOneof(5);
    }

    public function hasOrc()
    {
        return $this->hasOneof(5);
    }

    /**
     * Marks an ORC-encoded data source.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.PhysicalSchema.OrcSchema orc = 5;</code>
     * @param \Google\Cloud\DataCatalog\V1\PhysicalSchema\OrcSchema $var
     * @return $this
     */
    public function setOrc($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\V1\PhysicalSchema\OrcSchema::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Marks a CSV-encoded data source.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.PhysicalSchema.CsvSchema csv = 6;</code>
     * @return \Google\Cloud\DataCatalog\V1\PhysicalSchema\CsvSchema|null
     */
    public function getCsv()
    {
        return $this->readOneof(6);
    }

    public function hasCsv()
    {
        return $this->hasOneof(6);
    }

    /**
     * Marks a CSV-encoded data source.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.PhysicalSchema.CsvSchema csv = 6;</code>
     * @param \Google\Cloud\DataCatalog\V1\PhysicalSchema\CsvSchema $var
     * @return $this
     */
    public function setCsv($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\V1\PhysicalSchema\CsvSchema::class);
        $this->writeOneof(6, $var);

        return $this;
    }

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

}

