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

namespace Google\Cloud\DataCatalog\V1;

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

/**
 * Physical location of an entry.
 *
 * Generated from protobuf message <code>google.cloud.datacatalog.v1.DataSource</code>
 */
class DataSource extends \Google\Protobuf\Internal\Message
{
    /**
     * Service that physically stores the data.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.DataSource.Service service = 1;</code>
     */
    private $service = 0;
    /**
     * Full name of a resource as defined by the service. For example:
     * `//bigquery.googleapis.com/projects/{PROJECT_ID}/locations/{LOCATION}/datasets/{DATASET_ID}/tables/{TABLE_ID}`
     *
     * Generated from protobuf field <code>string resource = 2;</code>
     */
    private $resource = '';
    /**
     * Output only. Data Catalog entry name, if applicable.
     *
     * Generated from protobuf field <code>string source_entry = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $source_entry = '';
    protected $properties;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $service
     *           Service that physically stores the data.
     *     @type string $resource
     *           Full name of a resource as defined by the service. For example:
     *           `//bigquery.googleapis.com/projects/{PROJECT_ID}/locations/{LOCATION}/datasets/{DATASET_ID}/tables/{TABLE_ID}`
     *     @type string $source_entry
     *           Output only. Data Catalog entry name, if applicable.
     *     @type \Google\Cloud\DataCatalog\V1\StorageProperties $storage_properties
     *           Detailed properties of the underlying storage.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Datacatalog\V1\DataSource::initOnce();
        parent::__construct($data);
    }

    /**
     * Service that physically stores the data.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.DataSource.Service service = 1;</code>
     * @return int
     */
    public function getService()
    {
        return $this->service;
    }

    /**
     * Service that physically stores the data.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.DataSource.Service service = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setService($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\V1\DataSource\Service::class);
        $this->service = $var;

        return $this;
    }

    /**
     * Full name of a resource as defined by the service. For example:
     * `//bigquery.googleapis.com/projects/{PROJECT_ID}/locations/{LOCATION}/datasets/{DATASET_ID}/tables/{TABLE_ID}`
     *
     * Generated from protobuf field <code>string resource = 2;</code>
     * @return string
     */
    public function getResource()
    {
        return $this->resource;
    }

    /**
     * Full name of a resource as defined by the service. For example:
     * `//bigquery.googleapis.com/projects/{PROJECT_ID}/locations/{LOCATION}/datasets/{DATASET_ID}/tables/{TABLE_ID}`
     *
     * Generated from protobuf field <code>string resource = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setResource($var)
    {
        GPBUtil::checkString($var, True);
        $this->resource = $var;

        return $this;
    }

    /**
     * Output only. Data Catalog entry name, if applicable.
     *
     * Generated from protobuf field <code>string source_entry = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getSourceEntry()
    {
        return $this->source_entry;
    }

    /**
     * Output only. Data Catalog entry name, if applicable.
     *
     * Generated from protobuf field <code>string source_entry = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setSourceEntry($var)
    {
        GPBUtil::checkString($var, True);
        $this->source_entry = $var;

        return $this;
    }

    /**
     * Detailed properties of the underlying storage.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.StorageProperties storage_properties = 4;</code>
     * @return \Google\Cloud\DataCatalog\V1\StorageProperties|null
     */
    public function getStorageProperties()
    {
        return $this->readOneof(4);
    }

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

    /**
     * Detailed properties of the underlying storage.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.StorageProperties storage_properties = 4;</code>
     * @param \Google\Cloud\DataCatalog\V1\StorageProperties $var
     * @return $this
     */
    public function setStorageProperties($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DataCatalog\V1\StorageProperties::class);
        $this->writeOneof(4, $var);

        return $this;
    }

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

}

