syntax = "proto3";

package temporal.api.enums.v1;

option go_package = "go.temporal.io/api/enums/v1;enums";
option java_package = "io.temporal.api.enums.v1";
option java_multiple_files = true;
option java_outer_classname = "CommonProto";
option ruby_package = "Temporalio::Api::Enums::V1";
option csharp_namespace = "Temporalio.Api.Enums.V1";

enum EncodingType {
    ENCODING_TYPE_UNSPECIFIED = 0;
    ENCODING_TYPE_PROTO3 = 1;
    ENCODING_TYPE_JSON = 2;
}

enum IndexedValueType {
    INDEXED_VALUE_TYPE_UNSPECIFIED = 0;
    INDEXED_VALUE_TYPE_TEXT = 1;
    INDEXED_VALUE_TYPE_KEYWORD = 2;
    INDEXED_VALUE_TYPE_INT = 3;
    INDEXED_VALUE_TYPE_DOUBLE = 4;
    INDEXED_VALUE_TYPE_BOOL = 5;
    INDEXED_VALUE_TYPE_DATETIME = 6;
    INDEXED_VALUE_TYPE_KEYWORD_LIST = 7;
}

enum Severity {
    SEVERITY_UNSPECIFIED = 0;
    SEVERITY_HIGH = 1;
    SEVERITY_MEDIUM = 2;
    SEVERITY_LOW = 3;
}

// State of a callback.
enum CallbackState {
    // Default value, unspecified state.
    CALLBACK_STATE_UNSPECIFIED = 0;
    // Callback is standing by, waiting to be triggered.
    CALLBACK_STATE_STANDBY = 1;
    // Callback is in the queue waiting to be executed or is currently executing.
    CALLBACK_STATE_SCHEDULED = 2;
    // Callback has failed with a retryable error and is backing off before the next attempt.
    CALLBACK_STATE_BACKING_OFF = 3;
    // Callback has failed.
    CALLBACK_STATE_FAILED = 4;
    // Callback has succeeded.
    CALLBACK_STATE_SUCCEEDED = 5;
    // Callback is blocked (eg: by circuit breaker).
    CALLBACK_STATE_BLOCKED = 6;
}

// State of a pending Nexus operation.
enum PendingNexusOperationState {
    // Default value, unspecified state.
    PENDING_NEXUS_OPERATION_STATE_UNSPECIFIED = 0;
    // Operation is in the queue waiting to be executed or is currently executing.
    PENDING_NEXUS_OPERATION_STATE_SCHEDULED = 1;
    // Operation has failed with a retryable error and is backing off before the next attempt.
    PENDING_NEXUS_OPERATION_STATE_BACKING_OFF = 2;
    // Operation was started and will complete asynchronously.
    PENDING_NEXUS_OPERATION_STATE_STARTED = 3;
    // Operation is blocked (eg: by circuit breaker).
    PENDING_NEXUS_OPERATION_STATE_BLOCKED = 4;
}

// State of a Nexus operation cancellation.
enum NexusOperationCancellationState {
    // Default value, unspecified state.
    NEXUS_OPERATION_CANCELLATION_STATE_UNSPECIFIED = 0;
    // Cancellation request is in the queue waiting to be executed or is currently executing.
    NEXUS_OPERATION_CANCELLATION_STATE_SCHEDULED = 1;
    // Cancellation request has failed with a retryable error and is backing off before the next attempt.
    NEXUS_OPERATION_CANCELLATION_STATE_BACKING_OFF = 2;
    // Cancellation request succeeded.
    NEXUS_OPERATION_CANCELLATION_STATE_SUCCEEDED = 3;
    // Cancellation request failed with a non-retryable error.
    NEXUS_OPERATION_CANCELLATION_STATE_FAILED = 4;
    // The associated operation timed out - exceeded the user supplied schedule-to-close timeout.
    NEXUS_OPERATION_CANCELLATION_STATE_TIMED_OUT = 5;
    // Cancellation request is blocked (eg: by circuit breaker).
    NEXUS_OPERATION_CANCELLATION_STATE_BLOCKED = 6;
}

enum WorkflowRuleActionScope {
    // Default value, unspecified scope.
    WORKFLOW_RULE_ACTION_SCOPE_UNSPECIFIED = 0;
    // The action will be applied to the entire workflow.
    WORKFLOW_RULE_ACTION_SCOPE_WORKFLOW = 1;
    // The action will be applied to a specific activity.
    WORKFLOW_RULE_ACTION_SCOPE_ACTIVITY = 2;
}

enum ApplicationErrorCategory {
    APPLICATION_ERROR_CATEGORY_UNSPECIFIED = 0;
    // Expected application error with little/no severity.
    APPLICATION_ERROR_CATEGORY_BENIGN = 1;
}

// (-- api-linter: core::0216::synonyms=disabled
//     aip.dev/not-precedent: It seems we have both state and status, and status is a better fit for workers. --)
enum WorkerStatus {
    WORKER_STATUS_UNSPECIFIED = 0;
    WORKER_STATUS_RUNNING = 1;
    WORKER_STATUS_SHUTTING_DOWN = 2;
    WORKER_STATUS_SHUTDOWN = 3;
}
