<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: temporal/api/nexus/v1/message.proto

namespace Temporal\Api\Nexus\V1;

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

/**
 * Target to route requests to.
 *
 * Generated from protobuf message <code>temporal.api.nexus.v1.EndpointTarget</code>
 */
class EndpointTarget extends \Google\Protobuf\Internal\Message
{
    protected $variant;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Temporal\Api\Nexus\V1\EndpointTarget\Worker $worker
     *     @type \Temporal\Api\Nexus\V1\EndpointTarget\External $external
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Nexus\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>.temporal.api.nexus.v1.EndpointTarget.Worker worker = 1;</code>
     * @return \Temporal\Api\Nexus\V1\EndpointTarget\Worker|null
     */
    public function getWorker()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Generated from protobuf field <code>.temporal.api.nexus.v1.EndpointTarget.Worker worker = 1;</code>
     * @param \Temporal\Api\Nexus\V1\EndpointTarget\Worker $var
     * @return $this
     */
    public function setWorker($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Nexus\V1\EndpointTarget\Worker::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.temporal.api.nexus.v1.EndpointTarget.External external = 2;</code>
     * @return \Temporal\Api\Nexus\V1\EndpointTarget\External|null
     */
    public function getExternal()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Generated from protobuf field <code>.temporal.api.nexus.v1.EndpointTarget.External external = 2;</code>
     * @param \Temporal\Api\Nexus\V1\EndpointTarget\External $var
     * @return $this
     */
    public function setExternal($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Nexus\V1\EndpointTarget\External::class);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

