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

namespace Temporal\Api\Enums\V1;

use UnexpectedValueException;

/**
 * Whenever this list of command types is changed do change the function shouldBufferEvent in mutableStateBuilder.go to make sure to do the correct event ordering.
 *
 * Protobuf type <code>temporal.api.enums.v1.CommandType</code>
 */
class CommandType
{
    /**
     * Generated from protobuf enum <code>COMMAND_TYPE_UNSPECIFIED = 0;</code>
     */
    const COMMAND_TYPE_UNSPECIFIED = 0;
    /**
     * Generated from protobuf enum <code>COMMAND_TYPE_SCHEDULE_ACTIVITY_TASK = 1;</code>
     */
    const COMMAND_TYPE_SCHEDULE_ACTIVITY_TASK = 1;
    /**
     * Generated from protobuf enum <code>COMMAND_TYPE_REQUEST_CANCEL_ACTIVITY_TASK = 2;</code>
     */
    const COMMAND_TYPE_REQUEST_CANCEL_ACTIVITY_TASK = 2;
    /**
     * Generated from protobuf enum <code>COMMAND_TYPE_START_TIMER = 3;</code>
     */
    const COMMAND_TYPE_START_TIMER = 3;
    /**
     * Generated from protobuf enum <code>COMMAND_TYPE_COMPLETE_WORKFLOW_EXECUTION = 4;</code>
     */
    const COMMAND_TYPE_COMPLETE_WORKFLOW_EXECUTION = 4;
    /**
     * Generated from protobuf enum <code>COMMAND_TYPE_FAIL_WORKFLOW_EXECUTION = 5;</code>
     */
    const COMMAND_TYPE_FAIL_WORKFLOW_EXECUTION = 5;
    /**
     * Generated from protobuf enum <code>COMMAND_TYPE_CANCEL_TIMER = 6;</code>
     */
    const COMMAND_TYPE_CANCEL_TIMER = 6;
    /**
     * Generated from protobuf enum <code>COMMAND_TYPE_CANCEL_WORKFLOW_EXECUTION = 7;</code>
     */
    const COMMAND_TYPE_CANCEL_WORKFLOW_EXECUTION = 7;
    /**
     * Generated from protobuf enum <code>COMMAND_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION = 8;</code>
     */
    const COMMAND_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION = 8;
    /**
     * Generated from protobuf enum <code>COMMAND_TYPE_RECORD_MARKER = 9;</code>
     */
    const COMMAND_TYPE_RECORD_MARKER = 9;
    /**
     * Generated from protobuf enum <code>COMMAND_TYPE_CONTINUE_AS_NEW_WORKFLOW_EXECUTION = 10;</code>
     */
    const COMMAND_TYPE_CONTINUE_AS_NEW_WORKFLOW_EXECUTION = 10;
    /**
     * Generated from protobuf enum <code>COMMAND_TYPE_START_CHILD_WORKFLOW_EXECUTION = 11;</code>
     */
    const COMMAND_TYPE_START_CHILD_WORKFLOW_EXECUTION = 11;
    /**
     * Generated from protobuf enum <code>COMMAND_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION = 12;</code>
     */
    const COMMAND_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION = 12;
    /**
     * Generated from protobuf enum <code>COMMAND_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES = 13;</code>
     */
    const COMMAND_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES = 13;
    /**
     * Generated from protobuf enum <code>COMMAND_TYPE_PROTOCOL_MESSAGE = 14;</code>
     */
    const COMMAND_TYPE_PROTOCOL_MESSAGE = 14;
    /**
     * Generated from protobuf enum <code>COMMAND_TYPE_MODIFY_WORKFLOW_PROPERTIES = 16;</code>
     */
    const COMMAND_TYPE_MODIFY_WORKFLOW_PROPERTIES = 16;
    /**
     * Generated from protobuf enum <code>COMMAND_TYPE_SCHEDULE_NEXUS_OPERATION = 17;</code>
     */
    const COMMAND_TYPE_SCHEDULE_NEXUS_OPERATION = 17;
    /**
     * Generated from protobuf enum <code>COMMAND_TYPE_REQUEST_CANCEL_NEXUS_OPERATION = 18;</code>
     */
    const COMMAND_TYPE_REQUEST_CANCEL_NEXUS_OPERATION = 18;

    private static $valueToName = [
        self::COMMAND_TYPE_UNSPECIFIED => 'COMMAND_TYPE_UNSPECIFIED',
        self::COMMAND_TYPE_SCHEDULE_ACTIVITY_TASK => 'COMMAND_TYPE_SCHEDULE_ACTIVITY_TASK',
        self::COMMAND_TYPE_REQUEST_CANCEL_ACTIVITY_TASK => 'COMMAND_TYPE_REQUEST_CANCEL_ACTIVITY_TASK',
        self::COMMAND_TYPE_START_TIMER => 'COMMAND_TYPE_START_TIMER',
        self::COMMAND_TYPE_COMPLETE_WORKFLOW_EXECUTION => 'COMMAND_TYPE_COMPLETE_WORKFLOW_EXECUTION',
        self::COMMAND_TYPE_FAIL_WORKFLOW_EXECUTION => 'COMMAND_TYPE_FAIL_WORKFLOW_EXECUTION',
        self::COMMAND_TYPE_CANCEL_TIMER => 'COMMAND_TYPE_CANCEL_TIMER',
        self::COMMAND_TYPE_CANCEL_WORKFLOW_EXECUTION => 'COMMAND_TYPE_CANCEL_WORKFLOW_EXECUTION',
        self::COMMAND_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION => 'COMMAND_TYPE_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION',
        self::COMMAND_TYPE_RECORD_MARKER => 'COMMAND_TYPE_RECORD_MARKER',
        self::COMMAND_TYPE_CONTINUE_AS_NEW_WORKFLOW_EXECUTION => 'COMMAND_TYPE_CONTINUE_AS_NEW_WORKFLOW_EXECUTION',
        self::COMMAND_TYPE_START_CHILD_WORKFLOW_EXECUTION => 'COMMAND_TYPE_START_CHILD_WORKFLOW_EXECUTION',
        self::COMMAND_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION => 'COMMAND_TYPE_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION',
        self::COMMAND_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES => 'COMMAND_TYPE_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES',
        self::COMMAND_TYPE_PROTOCOL_MESSAGE => 'COMMAND_TYPE_PROTOCOL_MESSAGE',
        self::COMMAND_TYPE_MODIFY_WORKFLOW_PROPERTIES => 'COMMAND_TYPE_MODIFY_WORKFLOW_PROPERTIES',
        self::COMMAND_TYPE_SCHEDULE_NEXUS_OPERATION => 'COMMAND_TYPE_SCHEDULE_NEXUS_OPERATION',
        self::COMMAND_TYPE_REQUEST_CANCEL_NEXUS_OPERATION => 'COMMAND_TYPE_REQUEST_CANCEL_NEXUS_OPERATION',
    ];

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

