#[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>,
}
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),
#[prost(message, tag = "2")]
Message(super::MessageCommand),
#[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,
#[prost(enumeration = "system_command::SerializationFormat", tag = "2")]
pub format: i32,
#[prost(string, tag = "3")]
pub message: ::prost::alloc::string::String,
#[prost(map = "string, bytes", tag = "4")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::vec::Vec<u8>,
>,
#[prost(bytes = "vec", tag = "5")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
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,
Connect = 1,
ConnectAck = 2,
Close = 3,
Ping = 4,
Pong = 5,
Error = 6,
Event = 7,
Auth = 8,
AuthAck = 9,
Kicked = 10,
}
impl Type {
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",
}
}
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),
_ => None,
}
}
}
#[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 = 0,
Json = 1,
}
impl SerializationFormat {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Protobuf => "PROTOBUF",
Self::Json => "JSON",
}
}
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 MessageCommand {
#[prost(enumeration = "message_command::Type", tag = "1")]
pub r#type: i32,
#[prost(string, tag = "2")]
pub message_id: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "3")]
pub payload: ::prost::alloc::vec::Vec<u8>,
#[prost(map = "string, bytes", tag = "4")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::vec::Vec<u8>,
>,
#[prost(uint64, tag = "5")]
pub seq: u64,
}
pub mod message_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 {
Send = 0,
Ack = 1,
Data = 2,
}
impl Type {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Send => "SEND",
Self::Ack => "ACK",
Self::Data => "DATA",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SEND" => Some(Self::Send),
"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>,
#[prost(map = "string, bytes", tag = "4")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::vec::Vec<u8>,
>,
}
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 {
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",
}
}
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,
#[prost(bytes = "vec", tag = "2")]
pub data: ::prost::alloc::vec::Vec<u8>,
#[prost(map = "string, bytes", tag = "3")]
pub metadata: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::vec::Vec<u8>,
>,
}