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

namespace Google\Cloud\Dataform\V1;

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

/**
 * Represents a single entry in a directory.
 *
 * Generated from protobuf message <code>google.cloud.dataform.v1.DirectoryEntry</code>
 */
class DirectoryEntry extends \Google\Protobuf\Internal\Message
{
    /**
     * Entry with metadata.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1.FilesystemEntryMetadata metadata = 3;</code>
     */
    protected $metadata = null;
    protected $entry;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $file
     *           A file in the directory.
     *     @type string $directory
     *           A child directory in the directory.
     *     @type \Google\Cloud\Dataform\V1\FilesystemEntryMetadata $metadata
     *           Entry with metadata.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dataform\V1\Dataform::initOnce();
        parent::__construct($data);
    }

    /**
     * A file in the directory.
     *
     * Generated from protobuf field <code>string file = 1;</code>
     * @return string
     */
    public function getFile()
    {
        return $this->readOneof(1);
    }

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

    /**
     * A file in the directory.
     *
     * Generated from protobuf field <code>string file = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setFile($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * A child directory in the directory.
     *
     * Generated from protobuf field <code>string directory = 2;</code>
     * @return string
     */
    public function getDirectory()
    {
        return $this->readOneof(2);
    }

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

    /**
     * A child directory in the directory.
     *
     * Generated from protobuf field <code>string directory = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setDirectory($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Entry with metadata.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1.FilesystemEntryMetadata metadata = 3;</code>
     * @return \Google\Cloud\Dataform\V1\FilesystemEntryMetadata|null
     */
    public function getMetadata()
    {
        return $this->metadata;
    }

    public function hasMetadata()
    {
        return isset($this->metadata);
    }

    public function clearMetadata()
    {
        unset($this->metadata);
    }

    /**
     * Entry with metadata.
     *
     * Generated from protobuf field <code>.google.cloud.dataform.v1.FilesystemEntryMetadata metadata = 3;</code>
     * @param \Google\Cloud\Dataform\V1\FilesystemEntryMetadata $var
     * @return $this
     */
    public function setMetadata($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataform\V1\FilesystemEntryMetadata::class);
        $this->metadata = $var;

        return $this;
    }

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

}

