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

namespace Temporal\Api\Workflowservice\V1;

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

/**
 * [cleanup-wv-pre-release]
 *
 * Generated from protobuf message <code>temporal.api.workflowservice.v1.UpdateWorkerBuildIdCompatibilityRequest</code>
 */
class UpdateWorkerBuildIdCompatibilityRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string namespace = 1;</code>
     */
    protected $namespace = '';
    /**
     * Must be set, the task queue to apply changes to. Because all workers on a given task queue
     * must have the same set of workflow & activity implementations, there is no reason to specify
     * a task queue type here.
     *
     * Generated from protobuf field <code>string task_queue = 2;</code>
     */
    protected $task_queue = '';
    protected $operation;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $namespace
     *     @type string $task_queue
     *           Must be set, the task queue to apply changes to. Because all workers on a given task queue
     *           must have the same set of workflow & activity implementations, there is no reason to specify
     *           a task queue type here.
     *     @type string $add_new_build_id_in_new_default_set
     *           A new build id. This operation will create a new set which will be the new overall
     *           default version for the queue, with this id as its only member. This new set is
     *           incompatible with all previous sets/versions.
     *           (-- api-linter: core::0140::prepositions=disabled
     *               aip.dev/not-precedent: In makes perfect sense here. --)
     *     @type \Temporal\Api\Workflowservice\V1\UpdateWorkerBuildIdCompatibilityRequest\AddNewCompatibleVersion $add_new_compatible_build_id
     *           Adds a new id to an existing compatible set, see sub-message definition for more.
     *     @type string $promote_set_by_build_id
     *           Promote an existing set to be the current default (if it isn't already) by targeting
     *           an existing build id within it. This field's value is the extant build id.
     *           (-- api-linter: core::0140::prepositions=disabled
     *               aip.dev/not-precedent: Names are hard. --)
     *     @type string $promote_build_id_within_set
     *           Promote an existing build id within some set to be the current default for that set.
     *           (-- api-linter: core::0140::prepositions=disabled
     *               aip.dev/not-precedent: Within makes perfect sense here. --)
     *     @type \Temporal\Api\Workflowservice\V1\UpdateWorkerBuildIdCompatibilityRequest\MergeSets $merge_sets
     *           Merge two existing sets together, thus declaring all build IDs in both sets compatible
     *           with one another. The primary set's default will become the default for the merged set.
     *           This is useful if you've accidentally declared a new ID as incompatible you meant to
     *           declare as compatible. The unusual case of incomplete replication during failover could
     *           also result in a split set, which this operation can repair.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Temporal\Api\Workflowservice\V1\RequestResponse::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>string namespace = 1;</code>
     * @return string
     */
    public function getNamespace()
    {
        return $this->namespace;
    }

    /**
     * Generated from protobuf field <code>string namespace = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setNamespace($var)
    {
        GPBUtil::checkString($var, True);
        $this->namespace = $var;

        return $this;
    }

    /**
     * Must be set, the task queue to apply changes to. Because all workers on a given task queue
     * must have the same set of workflow & activity implementations, there is no reason to specify
     * a task queue type here.
     *
     * Generated from protobuf field <code>string task_queue = 2;</code>
     * @return string
     */
    public function getTaskQueue()
    {
        return $this->task_queue;
    }

    /**
     * Must be set, the task queue to apply changes to. Because all workers on a given task queue
     * must have the same set of workflow & activity implementations, there is no reason to specify
     * a task queue type here.
     *
     * Generated from protobuf field <code>string task_queue = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setTaskQueue($var)
    {
        GPBUtil::checkString($var, True);
        $this->task_queue = $var;

        return $this;
    }

    /**
     * A new build id. This operation will create a new set which will be the new overall
     * default version for the queue, with this id as its only member. This new set is
     * incompatible with all previous sets/versions.
     * (-- api-linter: core::0140::prepositions=disabled
     *     aip.dev/not-precedent: In makes perfect sense here. --)
     *
     * Generated from protobuf field <code>string add_new_build_id_in_new_default_set = 3;</code>
     * @return string
     */
    public function getAddNewBuildIdInNewDefaultSet()
    {
        return $this->readOneof(3);
    }

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

    /**
     * A new build id. This operation will create a new set which will be the new overall
     * default version for the queue, with this id as its only member. This new set is
     * incompatible with all previous sets/versions.
     * (-- api-linter: core::0140::prepositions=disabled
     *     aip.dev/not-precedent: In makes perfect sense here. --)
     *
     * Generated from protobuf field <code>string add_new_build_id_in_new_default_set = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setAddNewBuildIdInNewDefaultSet($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Adds a new id to an existing compatible set, see sub-message definition for more.
     *
     * Generated from protobuf field <code>.temporal.api.workflowservice.v1.UpdateWorkerBuildIdCompatibilityRequest.AddNewCompatibleVersion add_new_compatible_build_id = 4;</code>
     * @return \Temporal\Api\Workflowservice\V1\UpdateWorkerBuildIdCompatibilityRequest\AddNewCompatibleVersion|null
     */
    public function getAddNewCompatibleBuildId()
    {
        return $this->readOneof(4);
    }

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

    /**
     * Adds a new id to an existing compatible set, see sub-message definition for more.
     *
     * Generated from protobuf field <code>.temporal.api.workflowservice.v1.UpdateWorkerBuildIdCompatibilityRequest.AddNewCompatibleVersion add_new_compatible_build_id = 4;</code>
     * @param \Temporal\Api\Workflowservice\V1\UpdateWorkerBuildIdCompatibilityRequest\AddNewCompatibleVersion $var
     * @return $this
     */
    public function setAddNewCompatibleBuildId($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Workflowservice\V1\UpdateWorkerBuildIdCompatibilityRequest\AddNewCompatibleVersion::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Promote an existing set to be the current default (if it isn't already) by targeting
     * an existing build id within it. This field's value is the extant build id.
     * (-- api-linter: core::0140::prepositions=disabled
     *     aip.dev/not-precedent: Names are hard. --)
     *
     * Generated from protobuf field <code>string promote_set_by_build_id = 5;</code>
     * @return string
     */
    public function getPromoteSetByBuildId()
    {
        return $this->readOneof(5);
    }

    public function hasPromoteSetByBuildId()
    {
        return $this->hasOneof(5);
    }

    /**
     * Promote an existing set to be the current default (if it isn't already) by targeting
     * an existing build id within it. This field's value is the extant build id.
     * (-- api-linter: core::0140::prepositions=disabled
     *     aip.dev/not-precedent: Names are hard. --)
     *
     * Generated from protobuf field <code>string promote_set_by_build_id = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setPromoteSetByBuildId($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Promote an existing build id within some set to be the current default for that set.
     * (-- api-linter: core::0140::prepositions=disabled
     *     aip.dev/not-precedent: Within makes perfect sense here. --)
     *
     * Generated from protobuf field <code>string promote_build_id_within_set = 6;</code>
     * @return string
     */
    public function getPromoteBuildIdWithinSet()
    {
        return $this->readOneof(6);
    }

    public function hasPromoteBuildIdWithinSet()
    {
        return $this->hasOneof(6);
    }

    /**
     * Promote an existing build id within some set to be the current default for that set.
     * (-- api-linter: core::0140::prepositions=disabled
     *     aip.dev/not-precedent: Within makes perfect sense here. --)
     *
     * Generated from protobuf field <code>string promote_build_id_within_set = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setPromoteBuildIdWithinSet($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * Merge two existing sets together, thus declaring all build IDs in both sets compatible
     * with one another. The primary set's default will become the default for the merged set.
     * This is useful if you've accidentally declared a new ID as incompatible you meant to
     * declare as compatible. The unusual case of incomplete replication during failover could
     * also result in a split set, which this operation can repair.
     *
     * Generated from protobuf field <code>.temporal.api.workflowservice.v1.UpdateWorkerBuildIdCompatibilityRequest.MergeSets merge_sets = 7;</code>
     * @return \Temporal\Api\Workflowservice\V1\UpdateWorkerBuildIdCompatibilityRequest\MergeSets|null
     */
    public function getMergeSets()
    {
        return $this->readOneof(7);
    }

    public function hasMergeSets()
    {
        return $this->hasOneof(7);
    }

    /**
     * Merge two existing sets together, thus declaring all build IDs in both sets compatible
     * with one another. The primary set's default will become the default for the merged set.
     * This is useful if you've accidentally declared a new ID as incompatible you meant to
     * declare as compatible. The unusual case of incomplete replication during failover could
     * also result in a split set, which this operation can repair.
     *
     * Generated from protobuf field <code>.temporal.api.workflowservice.v1.UpdateWorkerBuildIdCompatibilityRequest.MergeSets merge_sets = 7;</code>
     * @param \Temporal\Api\Workflowservice\V1\UpdateWorkerBuildIdCompatibilityRequest\MergeSets $var
     * @return $this
     */
    public function setMergeSets($var)
    {
        GPBUtil::checkMessage($var, \Temporal\Api\Workflowservice\V1\UpdateWorkerBuildIdCompatibilityRequest\MergeSets::class);
        $this->writeOneof(7, $var);

        return $this;
    }

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

}

