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

namespace Temporal\Api\Enums\V1;

use UnexpectedValueException;

/**
 * Protobuf type <code>temporal.api.enums.v1.TaskQueueType</code>
 */
class TaskQueueType
{
    /**
     * Generated from protobuf enum <code>TASK_QUEUE_TYPE_UNSPECIFIED = 0;</code>
     */
    const TASK_QUEUE_TYPE_UNSPECIFIED = 0;
    /**
     * Workflow type of task queue.
     *
     * Generated from protobuf enum <code>TASK_QUEUE_TYPE_WORKFLOW = 1;</code>
     */
    const TASK_QUEUE_TYPE_WORKFLOW = 1;
    /**
     * Activity type of task queue.
     *
     * Generated from protobuf enum <code>TASK_QUEUE_TYPE_ACTIVITY = 2;</code>
     */
    const TASK_QUEUE_TYPE_ACTIVITY = 2;
    /**
     * Task queue type for dispatching Nexus requests.
     *
     * Generated from protobuf enum <code>TASK_QUEUE_TYPE_NEXUS = 3;</code>
     */
    const TASK_QUEUE_TYPE_NEXUS = 3;

    private static $valueToName = [
        self::TASK_QUEUE_TYPE_UNSPECIFIED => 'TASK_QUEUE_TYPE_UNSPECIFIED',
        self::TASK_QUEUE_TYPE_WORKFLOW => 'TASK_QUEUE_TYPE_WORKFLOW',
        self::TASK_QUEUE_TYPE_ACTIVITY => 'TASK_QUEUE_TYPE_ACTIVITY',
        self::TASK_QUEUE_TYPE_NEXUS => 'TASK_QUEUE_TYPE_NEXUS',
    ];

    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);
    }
}

