// This file is @generated by prost-build.
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Command {
    #[prost(oneof = "command::Type", tags = "1, 2, 3, 4")]
    pub r#type: ::core::option::Option<command::Type>,
}
/// Nested message and enum types in `Command`.
pub mod command {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[serde(rename_all = "snake_case")]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Type {
        /// 系统命令（连接、心跳、错误等）
        #[prost(message, tag = "1")]
        System(super::SystemCommand),
        /// 载荷命令（message/event/ack/data）
        #[prost(message, tag = "2")]
        Payload(super::PayloadCommand),
        /// 通知命令（广播、用户状态等）
        #[prost(message, tag = "3")]
        Notification(super::NotificationCommand),
        /// 自定义命令（业务扩展）
        #[prost(message, tag = "4")]
        Custom(super::CustomCommand),
    }
}
/// ---
///
/// ## 系统命令
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SystemCommand {
    /// 命令类型（必需）
    #[prost(enumeration = "system_command::Type", tag = "1")]
    pub r#type: i32,
    /// 序列化格式（仅 CONNECT/CONNECT_ACK）
    #[prost(enumeration = "system_command::SerializationFormat", tag = "2")]
    pub format: i32,
    /// 说明信息（ERROR、EVENT、CLOSE、AUTH_ACK）
    #[prost(string, tag = "3")]
    pub message: ::prost::alloc::string::String,
    /// 附加参数（CONNECT、AUTH等）
    #[prost(map = "string, bytes", tag = "4")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::vec::Vec<u8>,
    >,
    /// 数据载荷（EVENT、AUTH等）
    #[prost(bytes = "vec", tag = "5")]
    pub data: ::prost::alloc::vec::Vec<u8>,
    /// 压缩算法（仅 CONNECT_ACK，必须是已注册的算法）
    #[prost(string, tag = "6")]
    pub compression: ::prost::alloc::string::String,
    /// 加密方式（仅 CONNECT_ACK，为未来扩展预留）
    #[prost(string, tag = "7")]
    pub encryption: ::prost::alloc::string::String,
}
/// Nested message and enum types in `SystemCommand`.
pub mod system_command {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[serde(rename_all = "snake_case")]
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Type {
        Unspecified = 0,
        /// 客户端请求连接 / 握手（需要 format、metadata）
        Connect = 1,
        /// 服务端确认连接（需要 format、metadata）
        ConnectAck = 2,
        /// 关闭连接（可选 message、metadata）
        Close = 3,
        /// 心跳请求（仅需 type）
        Ping = 4,
        /// 心跳响应（仅需 type）
        Pong = 5,
        /// 错误通知（需要 message，可选 metadata）
        Error = 6,
        /// 系统事件（需要 message，可选 metadata、data）
        Event = 7,
        /// 鉴权请求（需要 metadata，可选 data）
        Auth = 8,
        /// 鉴权响应（可选 message、metadata）
        AuthAck = 9,
        /// 被踢下线（需要 message 说明原因，可选 metadata）
        Kicked = 10,
        /// 协商完成确认（客户端收到 CONNECT_ACK 后发送，表示已准备好使用协商好的加密方式）
        NegotiationReady = 11,
    }
    impl Type {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "UNSPECIFIED",
                Self::Connect => "CONNECT",
                Self::ConnectAck => "CONNECT_ACK",
                Self::Close => "CLOSE",
                Self::Ping => "PING",
                Self::Pong => "PONG",
                Self::Error => "ERROR",
                Self::Event => "EVENT",
                Self::Auth => "AUTH",
                Self::AuthAck => "AUTH_ACK",
                Self::Kicked => "KICKED",
                Self::NegotiationReady => "NEGOTIATION_READY",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "UNSPECIFIED" => Some(Self::Unspecified),
                "CONNECT" => Some(Self::Connect),
                "CONNECT_ACK" => Some(Self::ConnectAck),
                "CLOSE" => Some(Self::Close),
                "PING" => Some(Self::Ping),
                "PONG" => Some(Self::Pong),
                "ERROR" => Some(Self::Error),
                "EVENT" => Some(Self::Event),
                "AUTH" => Some(Self::Auth),
                "AUTH_ACK" => Some(Self::AuthAck),
                "KICKED" => Some(Self::Kicked),
                "NEGOTIATION_READY" => Some(Self::NegotiationReady),
                _ => None,
            }
        }
    }
    /// 序列化格式（仅在 CONNECT/CONNECT_ACK 时使用）
    #[derive(serde::Serialize, serde::Deserialize)]
    #[serde(rename_all = "snake_case")]
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum SerializationFormat {
        /// Protobuf 序列化
        Protobuf = 0,
        /// JSON 序列化
        Json = 1,
    }
    impl SerializationFormat {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Protobuf => "PROTOBUF",
                Self::Json => "JSON",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "PROTOBUF" => Some(Self::Protobuf),
                "JSON" => Some(Self::Json),
                _ => None,
            }
        }
    }
}
/// ---
///
/// ## 载荷命令（信道层：在信道上传输的四类载荷）
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PayloadCommand {
    #[prost(enumeration = "payload_command::Type", tag = "1")]
    pub r#type: i32,
    /// 消息/请求唯一 ID（MESSAGE/ACK 必填，EVENT 可选）
    #[prost(string, tag = "2")]
    pub message_id: ::prost::alloc::string::String,
    /// 载荷内容
    #[prost(bytes = "vec", tag = "3")]
    pub payload: ::prost::alloc::vec::Vec<u8>,
    /// 元信息（统一为 bytes 类型）
    #[prost(map = "string, bytes", tag = "4")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::vec::Vec<u8>,
    >,
    /// 序列号（可用于有序传输，MESSAGE 常用）
    #[prost(uint64, tag = "5")]
    pub seq: u64,
}
/// Nested message and enum types in `PayloadCommand`.
pub mod payload_command {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[serde(rename_all = "snake_case")]
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Type {
        Unspecified = 0,
        /// 业务消息（需 ACK，有序）
        Message = 1,
        /// 事件（状态变更、通知等，可选 message_id/seq）
        Event = 2,
        /// 确认（对 MESSAGE 或请求的确认）
        Ack = 3,
        /// 普通数据传输（无需 ACK）
        Data = 4,
    }
    impl Type {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "UNSPECIFIED",
                Self::Message => "MESSAGE",
                Self::Event => "EVENT",
                Self::Ack => "ACK",
                Self::Data => "DATA",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "UNSPECIFIED" => Some(Self::Unspecified),
                "MESSAGE" => Some(Self::Message),
                "EVENT" => Some(Self::Event),
                "ACK" => Some(Self::Ack),
                "DATA" => Some(Self::Data),
                _ => None,
            }
        }
    }
}
/// ---
///
/// ## 通知命令
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NotificationCommand {
    #[prost(enumeration = "notification_command::Type", tag = "1")]
    pub r#type: i32,
    /// 通知标题
    #[prost(string, tag = "2")]
    pub title: ::prost::alloc::string::String,
    /// 通知内容
    #[prost(bytes = "vec", tag = "3")]
    pub content: ::prost::alloc::vec::Vec<u8>,
    /// 附加信息（跳转参数等，统一为bytes类型）
    #[prost(map = "string, bytes", tag = "4")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::vec::Vec<u8>,
    >,
}
/// Nested message and enum types in `NotificationCommand`.
pub mod notification_command {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[serde(rename_all = "snake_case")]
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Type {
        /// 系统通知（维护、更新等）
        System = 0,
        /// 广播消息
        Broadcast = 1,
        /// 警告提示
        Alert = 2,
        /// 用户状态变化
        User = 3,
        /// 连接事件（如重连）
        Connection = 4,
    }
    impl Type {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::System => "SYSTEM",
                Self::Broadcast => "BROADCAST",
                Self::Alert => "ALERT",
                Self::User => "USER",
                Self::Connection => "CONNECTION",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "SYSTEM" => Some(Self::System),
                "BROADCAST" => Some(Self::Broadcast),
                "ALERT" => Some(Self::Alert),
                "USER" => Some(Self::User),
                "CONNECTION" => Some(Self::Connection),
                _ => None,
            }
        }
    }
}
/// ---
///
/// ## 自定义命令
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CustomCommand {
    /// 自定义命令名
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// 自定义数据内容（JSON、protobuf等）
    #[prost(bytes = "vec", tag = "2")]
    pub data: ::prost::alloc::vec::Vec<u8>,
    /// 扩展元信息（统一为bytes类型）
    #[prost(map = "string, bytes", tag = "3")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::vec::Vec<u8>,
    >,
}
