syntax = "proto3";

package temporal.api.protocol.v1;

option go_package = "go.temporal.io/api/protocol/v1;protocol";
option java_package = "io.temporal.api.protocol.v1";
option java_multiple_files = true;
option java_outer_classname = "MessageProto";
option ruby_package = "Temporalio::Api::Protocol::V1";
option csharp_namespace = "Temporalio.Api.Protocol.V1";

import "google/protobuf/any.proto";

// (-- api-linter: core::0146::any=disabled
//     aip.dev/not-precedent: We want runtime extensibility for the body field --)
message Message {
    // An ID for this specific message.
    string id = 1;

    // Identifies the specific instance of a protocol to which this message
    // belongs.
    string protocol_instance_id = 2;

    // The event ID or command ID after which this message can be delivered. The
    // effects of history up to and including this event ID should be visible to
    // the code that handles this message. Omit to opt out of sequencing.
    oneof sequencing_id {
        int64 event_id = 3;
        int64 command_index = 4;
    };
    
    // The opaque data carried by this message. The protocol type can be
    // extracted from the package name of the message carried inside the Any.
    google.protobuf.Any body = 5;
}
