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

namespace Temporal\Api\Common\V1;

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

/**
 * This is used to send commands to a specific worker or a group of workers.
 * Right now, it is used to send commands to a specific worker instance.
 * Will be extended to be able to send command to multiple workers.
 *
 * Generated from protobuf message <code>temporal.api.common.v1.WorkerSelector</code>
 */
class WorkerSelector extends \Google\Protobuf\Internal\Message
{
    protected $selector;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $worker_instance_key
     *           Worker instance key to which the command should be sent.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Common\V1\Message::initOnce();
        parent::__construct($data);
    }

    /**
     * Worker instance key to which the command should be sent.
     *
     * Generated from protobuf field <code>string worker_instance_key = 1;</code>
     * @return string
     */
    public function getWorkerInstanceKey()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Worker instance key to which the command should be sent.
     *
     * Generated from protobuf field <code>string worker_instance_key = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setWorkerInstanceKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

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

}

