<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/dataflow/v1beta3/streaming.proto

namespace Google\Cloud\Dataflow\V1beta3;

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

/**
 * Describes a stream of data, either as input to be processed or as
 * output of a streaming Dataflow job.
 *
 * Generated from protobuf message <code>google.dataflow.v1beta3.StreamLocation</code>
 */
class StreamLocation extends \Google\Protobuf\Internal\Message
{
    protected $location;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dataflow\V1beta3\StreamingStageLocation $streaming_stage_location
     *           The stream is part of another computation within the current
     *           streaming Dataflow job.
     *     @type \Google\Cloud\Dataflow\V1beta3\PubsubLocation $pubsub_location
     *           The stream is a pubsub stream.
     *     @type \Google\Cloud\Dataflow\V1beta3\StreamingSideInputLocation $side_input_location
     *           The stream is a streaming side input.
     *     @type \Google\Cloud\Dataflow\V1beta3\CustomSourceLocation $custom_source_location
     *           The stream is a custom source.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Dataflow\V1Beta3\Streaming::initOnce();
        parent::__construct($data);
    }

    /**
     * The stream is part of another computation within the current
     * streaming Dataflow job.
     *
     * Generated from protobuf field <code>.google.dataflow.v1beta3.StreamingStageLocation streaming_stage_location = 1;</code>
     * @return \Google\Cloud\Dataflow\V1beta3\StreamingStageLocation|null
     */
    public function getStreamingStageLocation()
    {
        return $this->readOneof(1);
    }

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

    /**
     * The stream is part of another computation within the current
     * streaming Dataflow job.
     *
     * Generated from protobuf field <code>.google.dataflow.v1beta3.StreamingStageLocation streaming_stage_location = 1;</code>
     * @param \Google\Cloud\Dataflow\V1beta3\StreamingStageLocation $var
     * @return $this
     */
    public function setStreamingStageLocation($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataflow\V1beta3\StreamingStageLocation::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * The stream is a pubsub stream.
     *
     * Generated from protobuf field <code>.google.dataflow.v1beta3.PubsubLocation pubsub_location = 2;</code>
     * @return \Google\Cloud\Dataflow\V1beta3\PubsubLocation|null
     */
    public function getPubsubLocation()
    {
        return $this->readOneof(2);
    }

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

    /**
     * The stream is a pubsub stream.
     *
     * Generated from protobuf field <code>.google.dataflow.v1beta3.PubsubLocation pubsub_location = 2;</code>
     * @param \Google\Cloud\Dataflow\V1beta3\PubsubLocation $var
     * @return $this
     */
    public function setPubsubLocation($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataflow\V1beta3\PubsubLocation::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * The stream is a streaming side input.
     *
     * Generated from protobuf field <code>.google.dataflow.v1beta3.StreamingSideInputLocation side_input_location = 3;</code>
     * @return \Google\Cloud\Dataflow\V1beta3\StreamingSideInputLocation|null
     */
    public function getSideInputLocation()
    {
        return $this->readOneof(3);
    }

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

    /**
     * The stream is a streaming side input.
     *
     * Generated from protobuf field <code>.google.dataflow.v1beta3.StreamingSideInputLocation side_input_location = 3;</code>
     * @param \Google\Cloud\Dataflow\V1beta3\StreamingSideInputLocation $var
     * @return $this
     */
    public function setSideInputLocation($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataflow\V1beta3\StreamingSideInputLocation::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * The stream is a custom source.
     *
     * Generated from protobuf field <code>.google.dataflow.v1beta3.CustomSourceLocation custom_source_location = 4;</code>
     * @return \Google\Cloud\Dataflow\V1beta3\CustomSourceLocation|null
     */
    public function getCustomSourceLocation()
    {
        return $this->readOneof(4);
    }

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

    /**
     * The stream is a custom source.
     *
     * Generated from protobuf field <code>.google.dataflow.v1beta3.CustomSourceLocation custom_source_location = 4;</code>
     * @param \Google\Cloud\Dataflow\V1beta3\CustomSourceLocation $var
     * @return $this
     */
    public function setCustomSourceLocation($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataflow\V1beta3\CustomSourceLocation::class);
        $this->writeOneof(4, $var);

        return $this;
    }

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

}

