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

namespace Temporal\Api\Enums\V1;

use UnexpectedValueException;

/**
 * (-- api-linter: core::0216::synonyms=disabled
 *     aip.dev/not-precedent: Call this status because it is . --)
 * Specify the status of a Worker Deployment Version.
 * Experimental. Worker Deployments are experimental and might significantly change in the future.
 *
 * Protobuf type <code>temporal.api.enums.v1.WorkerDeploymentVersionStatus</code>
 */
class WorkerDeploymentVersionStatus
{
    /**
     * Generated from protobuf enum <code>WORKER_DEPLOYMENT_VERSION_STATUS_UNSPECIFIED = 0;</code>
     */
    const WORKER_DEPLOYMENT_VERSION_STATUS_UNSPECIFIED = 0;
    /**
     * The Worker Deployment Version has been created inside the Worker Deployment but is not used by any
     * workflow executions. These Versions can still have workflows if they have an explicit Versioning Override targeting
     * this Version. Such Versioning Override could be set at workflow start time, or at a later time via `UpdateWorkflowExecutionOptions`.
     *
     * Generated from protobuf enum <code>WORKER_DEPLOYMENT_VERSION_STATUS_INACTIVE = 1;</code>
     */
    const WORKER_DEPLOYMENT_VERSION_STATUS_INACTIVE = 1;
    /**
     * The Worker Deployment Version is the current version of the Worker Deployment. All new workflow executions 
     * and tasks of existing unversioned or AutoUpgrade workflows are routed to this version.
     *
     * Generated from protobuf enum <code>WORKER_DEPLOYMENT_VERSION_STATUS_CURRENT = 2;</code>
     */
    const WORKER_DEPLOYMENT_VERSION_STATUS_CURRENT = 2;
    /**
     * The Worker Deployment Version is the ramping version of the Worker Deployment. A subset of new Pinned workflow executions are 
     * routed to this version. Moreover, a portion of existing unversioned or AutoUpgrade workflow executions are also routed to this version.
     *
     * Generated from protobuf enum <code>WORKER_DEPLOYMENT_VERSION_STATUS_RAMPING = 3;</code>
     */
    const WORKER_DEPLOYMENT_VERSION_STATUS_RAMPING = 3;
    /**
     * The Worker Deployment Version is not used by new workflows but is still used by
     * open pinned workflows. The version cannot be decommissioned safely.
     *
     * Generated from protobuf enum <code>WORKER_DEPLOYMENT_VERSION_STATUS_DRAINING = 4;</code>
     */
    const WORKER_DEPLOYMENT_VERSION_STATUS_DRAINING = 4;
    /**
     * The Worker Deployment Version is not used by new or open workflows, but might be still needed by
     * Queries sent to closed workflows. The version can be decommissioned safely if user does
     * not query closed workflows. If the user does query closed workflows for some time x after
     * workflows are closed, they should decommission the version after it has been drained for that duration.
     *
     * Generated from protobuf enum <code>WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED = 5;</code>
     */
    const WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED = 5;

    private static $valueToName = [
        self::WORKER_DEPLOYMENT_VERSION_STATUS_UNSPECIFIED => 'WORKER_DEPLOYMENT_VERSION_STATUS_UNSPECIFIED',
        self::WORKER_DEPLOYMENT_VERSION_STATUS_INACTIVE => 'WORKER_DEPLOYMENT_VERSION_STATUS_INACTIVE',
        self::WORKER_DEPLOYMENT_VERSION_STATUS_CURRENT => 'WORKER_DEPLOYMENT_VERSION_STATUS_CURRENT',
        self::WORKER_DEPLOYMENT_VERSION_STATUS_RAMPING => 'WORKER_DEPLOYMENT_VERSION_STATUS_RAMPING',
        self::WORKER_DEPLOYMENT_VERSION_STATUS_DRAINING => 'WORKER_DEPLOYMENT_VERSION_STATUS_DRAINING',
        self::WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED => 'WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

