// The MIT License
//
// Copyright (c) 2020 Temporal Technologies Inc.  All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

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

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

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