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

namespace Temporal\Api\Enums\V1;

use UnexpectedValueException;

/**
 * Workflow tasks can fail for various reasons. Note that some of these reasons can only originate
 * from the server, and some of them can only originate from the SDK/worker.
 *
 * Protobuf type <code>temporal.api.enums.v1.WorkflowTaskFailedCause</code>
 */
class WorkflowTaskFailedCause
{
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_UNSPECIFIED = 0;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_UNSPECIFIED = 0;
    /**
     * Between starting and completing the workflow task (with a workflow completion command), some
     * new command (like a signal) was processed into workflow history. The outstanding task will be
     * failed with this reason, and a worker must pick up a new task.
     *
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_UNHANDLED_COMMAND = 1;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_UNHANDLED_COMMAND = 1;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_SCHEDULE_ACTIVITY_ATTRIBUTES = 2;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_SCHEDULE_ACTIVITY_ATTRIBUTES = 2;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES = 3;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES = 3;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_START_TIMER_ATTRIBUTES = 4;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_START_TIMER_ATTRIBUTES = 4;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_CANCEL_TIMER_ATTRIBUTES = 5;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_CANCEL_TIMER_ATTRIBUTES = 5;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_RECORD_MARKER_ATTRIBUTES = 6;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_RECORD_MARKER_ATTRIBUTES = 6;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES = 7;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES = 7;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES = 8;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES = 8;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES = 9;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES = 9;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES = 10;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES = 10;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_CONTINUE_AS_NEW_ATTRIBUTES = 11;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_CONTINUE_AS_NEW_ATTRIBUTES = 11;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_START_TIMER_DUPLICATE_ID = 12;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_START_TIMER_DUPLICATE_ID = 12;
    /**
     * The worker wishes to fail the task and have the next one be generated on a normal, not sticky
     * queue. Generally workers should prefer to use the explicit `ResetStickyTaskQueue` RPC call.
     *
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_RESET_STICKY_TASK_QUEUE = 13;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_RESET_STICKY_TASK_QUEUE = 13;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_WORKFLOW_WORKER_UNHANDLED_FAILURE = 14;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_WORKFLOW_WORKER_UNHANDLED_FAILURE = 14;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES = 15;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES = 15;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_START_CHILD_EXECUTION_ATTRIBUTES = 16;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_START_CHILD_EXECUTION_ATTRIBUTES = 16;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_FORCE_CLOSE_COMMAND = 17;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_FORCE_CLOSE_COMMAND = 17;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_FAILOVER_CLOSE_COMMAND = 18;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_FAILOVER_CLOSE_COMMAND = 18;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_SIGNAL_INPUT_SIZE = 19;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_SIGNAL_INPUT_SIZE = 19;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_RESET_WORKFLOW = 20;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_RESET_WORKFLOW = 20;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_BINARY = 21;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_BINARY = 21;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_SCHEDULE_ACTIVITY_DUPLICATE_ID = 22;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_SCHEDULE_ACTIVITY_DUPLICATE_ID = 22;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_SEARCH_ATTRIBUTES = 23;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_SEARCH_ATTRIBUTES = 23;
    /**
     * The worker encountered a mismatch while replaying history between what was expected, and
     * what the workflow code actually did.
     *
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_NON_DETERMINISTIC_ERROR = 24;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_NON_DETERMINISTIC_ERROR = 24;
    /**
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_MODIFY_WORKFLOW_PROPERTIES_ATTRIBUTES = 25;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_MODIFY_WORKFLOW_PROPERTIES_ATTRIBUTES = 25;
    /**
     * We send the below error codes to users when their requests would violate a size constraint
     * of their workflow. We do this to ensure that the state of their workflow does not become too
     * large because that can cause severe performance degradation. You can modify the thresholds for
     * each of these errors within your dynamic config.
     * Spawning a new child workflow would cause this workflow to exceed its limit of pending child
     * workflows.
     *
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_PENDING_CHILD_WORKFLOWS_LIMIT_EXCEEDED = 26;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_PENDING_CHILD_WORKFLOWS_LIMIT_EXCEEDED = 26;
    /**
     * Starting a new activity would cause this workflow to exceed its limit of pending activities
     * that we track.
     *
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_PENDING_ACTIVITIES_LIMIT_EXCEEDED = 27;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_PENDING_ACTIVITIES_LIMIT_EXCEEDED = 27;
    /**
     * A workflow has a buffer of signals that have not yet reached their destination. We return this
     * error when sending a new signal would exceed the capacity of this buffer.
     *
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_PENDING_SIGNALS_LIMIT_EXCEEDED = 28;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_PENDING_SIGNALS_LIMIT_EXCEEDED = 28;
    /**
     * Similarly, we have a buffer of pending requests to cancel other workflows. We return this error
     * when our capacity for pending cancel requests is already reached.
     *
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_PENDING_REQUEST_CANCEL_LIMIT_EXCEEDED = 29;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_PENDING_REQUEST_CANCEL_LIMIT_EXCEEDED = 29;
    /**
     * Workflow execution update message (update.Acceptance, update.Rejection, or update.Response)
     * has wrong format, or missing required fields.
     *
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_UPDATE_WORKFLOW_EXECUTION_MESSAGE = 30;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_UPDATE_WORKFLOW_EXECUTION_MESSAGE = 30;
    /**
     * Similar to WORKFLOW_TASK_FAILED_CAUSE_UNHANDLED_COMMAND, but for updates.
     *
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_UNHANDLED_UPDATE = 31;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_UNHANDLED_UPDATE = 31;
    /**
     * A workflow task completed with an invalid ScheduleNexusOperation command.
     *
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_SCHEDULE_NEXUS_OPERATION_ATTRIBUTES = 32;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_SCHEDULE_NEXUS_OPERATION_ATTRIBUTES = 32;
    /**
     * A workflow task completed requesting to schedule a Nexus Operation exceeding the server configured limit.
     *
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_PENDING_NEXUS_OPERATIONS_LIMIT_EXCEEDED = 33;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_PENDING_NEXUS_OPERATIONS_LIMIT_EXCEEDED = 33;
    /**
     * A workflow task completed with an invalid RequestCancelNexusOperation command.
     *
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_NEXUS_OPERATION_ATTRIBUTES = 34;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_NEXUS_OPERATION_ATTRIBUTES = 34;
    /**
     * A workflow task completed requesting a feature that's disabled on the server (either system wide or - typically -
     * for the workflow's namespace).
     * Check the workflow task failure message for more information.
     *
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_FEATURE_DISABLED = 35;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_FEATURE_DISABLED = 35;
    /**
     * A workflow task failed because a grpc message was too large.
     *
     * Generated from protobuf enum <code>WORKFLOW_TASK_FAILED_CAUSE_GRPC_MESSAGE_TOO_LARGE = 36;</code>
     */
    const WORKFLOW_TASK_FAILED_CAUSE_GRPC_MESSAGE_TOO_LARGE = 36;

    private static $valueToName = [
        self::WORKFLOW_TASK_FAILED_CAUSE_UNSPECIFIED => 'WORKFLOW_TASK_FAILED_CAUSE_UNSPECIFIED',
        self::WORKFLOW_TASK_FAILED_CAUSE_UNHANDLED_COMMAND => 'WORKFLOW_TASK_FAILED_CAUSE_UNHANDLED_COMMAND',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_SCHEDULE_ACTIVITY_ATTRIBUTES => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_SCHEDULE_ACTIVITY_ATTRIBUTES',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_ACTIVITY_ATTRIBUTES',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_START_TIMER_ATTRIBUTES => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_START_TIMER_ATTRIBUTES',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_CANCEL_TIMER_ATTRIBUTES => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_CANCEL_TIMER_ATTRIBUTES',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_RECORD_MARKER_ATTRIBUTES => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_RECORD_MARKER_ATTRIBUTES',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_COMPLETE_WORKFLOW_EXECUTION_ATTRIBUTES',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_FAIL_WORKFLOW_EXECUTION_ATTRIBUTES',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_CANCEL_WORKFLOW_EXECUTION_ATTRIBUTES',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_ATTRIBUTES',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_CONTINUE_AS_NEW_ATTRIBUTES => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_CONTINUE_AS_NEW_ATTRIBUTES',
        self::WORKFLOW_TASK_FAILED_CAUSE_START_TIMER_DUPLICATE_ID => 'WORKFLOW_TASK_FAILED_CAUSE_START_TIMER_DUPLICATE_ID',
        self::WORKFLOW_TASK_FAILED_CAUSE_RESET_STICKY_TASK_QUEUE => 'WORKFLOW_TASK_FAILED_CAUSE_RESET_STICKY_TASK_QUEUE',
        self::WORKFLOW_TASK_FAILED_CAUSE_WORKFLOW_WORKER_UNHANDLED_FAILURE => 'WORKFLOW_TASK_FAILED_CAUSE_WORKFLOW_WORKER_UNHANDLED_FAILURE',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_SIGNAL_WORKFLOW_EXECUTION_ATTRIBUTES',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_START_CHILD_EXECUTION_ATTRIBUTES => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_START_CHILD_EXECUTION_ATTRIBUTES',
        self::WORKFLOW_TASK_FAILED_CAUSE_FORCE_CLOSE_COMMAND => 'WORKFLOW_TASK_FAILED_CAUSE_FORCE_CLOSE_COMMAND',
        self::WORKFLOW_TASK_FAILED_CAUSE_FAILOVER_CLOSE_COMMAND => 'WORKFLOW_TASK_FAILED_CAUSE_FAILOVER_CLOSE_COMMAND',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_SIGNAL_INPUT_SIZE => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_SIGNAL_INPUT_SIZE',
        self::WORKFLOW_TASK_FAILED_CAUSE_RESET_WORKFLOW => 'WORKFLOW_TASK_FAILED_CAUSE_RESET_WORKFLOW',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_BINARY => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_BINARY',
        self::WORKFLOW_TASK_FAILED_CAUSE_SCHEDULE_ACTIVITY_DUPLICATE_ID => 'WORKFLOW_TASK_FAILED_CAUSE_SCHEDULE_ACTIVITY_DUPLICATE_ID',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_SEARCH_ATTRIBUTES => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_SEARCH_ATTRIBUTES',
        self::WORKFLOW_TASK_FAILED_CAUSE_NON_DETERMINISTIC_ERROR => 'WORKFLOW_TASK_FAILED_CAUSE_NON_DETERMINISTIC_ERROR',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_MODIFY_WORKFLOW_PROPERTIES_ATTRIBUTES => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_MODIFY_WORKFLOW_PROPERTIES_ATTRIBUTES',
        self::WORKFLOW_TASK_FAILED_CAUSE_PENDING_CHILD_WORKFLOWS_LIMIT_EXCEEDED => 'WORKFLOW_TASK_FAILED_CAUSE_PENDING_CHILD_WORKFLOWS_LIMIT_EXCEEDED',
        self::WORKFLOW_TASK_FAILED_CAUSE_PENDING_ACTIVITIES_LIMIT_EXCEEDED => 'WORKFLOW_TASK_FAILED_CAUSE_PENDING_ACTIVITIES_LIMIT_EXCEEDED',
        self::WORKFLOW_TASK_FAILED_CAUSE_PENDING_SIGNALS_LIMIT_EXCEEDED => 'WORKFLOW_TASK_FAILED_CAUSE_PENDING_SIGNALS_LIMIT_EXCEEDED',
        self::WORKFLOW_TASK_FAILED_CAUSE_PENDING_REQUEST_CANCEL_LIMIT_EXCEEDED => 'WORKFLOW_TASK_FAILED_CAUSE_PENDING_REQUEST_CANCEL_LIMIT_EXCEEDED',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_UPDATE_WORKFLOW_EXECUTION_MESSAGE => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_UPDATE_WORKFLOW_EXECUTION_MESSAGE',
        self::WORKFLOW_TASK_FAILED_CAUSE_UNHANDLED_UPDATE => 'WORKFLOW_TASK_FAILED_CAUSE_UNHANDLED_UPDATE',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_SCHEDULE_NEXUS_OPERATION_ATTRIBUTES => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_SCHEDULE_NEXUS_OPERATION_ATTRIBUTES',
        self::WORKFLOW_TASK_FAILED_CAUSE_PENDING_NEXUS_OPERATIONS_LIMIT_EXCEEDED => 'WORKFLOW_TASK_FAILED_CAUSE_PENDING_NEXUS_OPERATIONS_LIMIT_EXCEEDED',
        self::WORKFLOW_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_NEXUS_OPERATION_ATTRIBUTES => 'WORKFLOW_TASK_FAILED_CAUSE_BAD_REQUEST_CANCEL_NEXUS_OPERATION_ATTRIBUTES',
        self::WORKFLOW_TASK_FAILED_CAUSE_FEATURE_DISABLED => 'WORKFLOW_TASK_FAILED_CAUSE_FEATURE_DISABLED',
        self::WORKFLOW_TASK_FAILED_CAUSE_GRPC_MESSAGE_TOO_LARGE => 'WORKFLOW_TASK_FAILED_CAUSE_GRPC_MESSAGE_TOO_LARGE',
    ];

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

