// Copyright (c) 2020 Temporal Technologies, Inc.
//
// 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.server.api.enums.v1;

option go_package = "go.temporal.io/server/api/enums/v1;enums";

// TaskSource is the source from which a task was produced.
enum TaskSource {
    TASK_SOURCE_UNSPECIFIED = 0;
    // Task produced by history service.
    TASK_SOURCE_HISTORY = 1;
    // Task produced from matching db backlog.
    TASK_SOURCE_DB_BACKLOG = 2;
}

enum TaskCategory {
    TASK_CATEGORY_UNSPECIFIED = 0;
    // Transfer is the task type for transfer task.
    TASK_CATEGORY_TRANSFER = 1;
    // Timer is the task type for timer task.
    TASK_CATEGORY_TIMER = 2;
    // Replication is the task type for replication task.
    TASK_CATEGORY_REPLICATION = 3;
    // Visibility is the task type for visibility task.
    TASK_CATEGORY_VISIBILITY = 4;
}

enum TaskType {
    TASK_TYPE_UNSPECIFIED = 0;
    TASK_TYPE_REPLICATION_HISTORY = 1;
    TASK_TYPE_REPLICATION_SYNC_ACTIVITY = 2;
    TASK_TYPE_TRANSFER_WORKFLOW_TASK = 3;
    TASK_TYPE_TRANSFER_ACTIVITY_TASK = 4;
    TASK_TYPE_TRANSFER_CLOSE_EXECUTION = 5;
    TASK_TYPE_TRANSFER_CANCEL_EXECUTION = 6;
    TASK_TYPE_TRANSFER_START_CHILD_EXECUTION = 7;
    TASK_TYPE_TRANSFER_SIGNAL_EXECUTION = 8;
    reserved 9; // TASK_TYPE_TRANSFER_RECORD_WORKFLOW_STARTED
    TASK_TYPE_TRANSFER_RESET_WORKFLOW = 10;
    reserved 11; // TASK_TYPE_TRANSFER_UPSERT_WORKFLOW_SEARCH_ATTRIBUTES
    TASK_TYPE_WORKFLOW_TASK_TIMEOUT = 12;
    TASK_TYPE_ACTIVITY_TIMEOUT = 13;
    TASK_TYPE_USER_TIMER = 14;
    TASK_TYPE_WORKFLOW_RUN_TIMEOUT = 15;
    TASK_TYPE_DELETE_HISTORY_EVENT = 16;
    TASK_TYPE_ACTIVITY_RETRY_TIMER = 17;
    TASK_TYPE_WORKFLOW_BACKOFF_TIMER = 18;
    TASK_TYPE_VISIBILITY_START_EXECUTION = 19;
    TASK_TYPE_VISIBILITY_UPSERT_EXECUTION = 20;
    TASK_TYPE_VISIBILITY_CLOSE_EXECUTION = 21;
    TASK_TYPE_VISIBILITY_DELETE_EXECUTION = 22;
}
