syntax = "proto3";

package temporal.api.cloud.operation.v1;

option go_package = "go.temporal.io/api/cloud/operation/v1;operation";
option java_package = "io.temporal.api.cloud.operation.v1";
option java_multiple_files = true;
option java_outer_classname = "MessageProto";
option ruby_package = "Temporalio::Api::Cloud::Operation::V1";
option csharp_namespace = "Temporalio.Api.Cloud.Operation.V1";

import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/any.proto";

message AsyncOperation {
    // The operation id
    string id = 1;
    // The current state of this operation
    // Possible values are: pending, in_progress, failed, cancelled, fulfilled
    string state = 2;
    // The recommended duration to check back for an update in the operation's state
    google.protobuf.Duration check_duration = 3;
    // The type of operation being performed
    string operation_type = 4;
    // The input to the operation being performed
    //
    // (-- api-linter: core::0146::any=disabled --)
    google.protobuf.Any operation_input = 5;
    // If the operation failed, the reason for the failure
    string failure_reason = 6;
    // The date and time when the operation initiated
    google.protobuf.Timestamp started_time = 7;
    // The date and time when the operation completed
    google.protobuf.Timestamp finished_time = 8;
}
