1#[derive(serde::Serialize, serde::Deserialize)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct Sub {
6 #[prost(string, repeated, tag = "1")]
7 pub topics: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8}
9#[derive(serde::Serialize, serde::Deserialize)]
11#[derive(Clone, PartialEq, ::prost::Message)]
12pub struct SubResponse {
13 #[prost(string, repeated, tag = "1")]
15 pub success: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
16 #[prost(message, repeated, tag = "2")]
18 pub fail: ::prost::alloc::vec::Vec<sub_response::Fail>,
19 #[prost(string, repeated, tag = "3")]
21 pub current: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
22}
23pub mod sub_response {
25 #[derive(serde::Serialize, serde::Deserialize)]
26 #[derive(Clone, PartialEq, ::prost::Message)]
27 pub struct Fail {
28 #[prost(string, tag = "1")]
29 pub topic: ::prost::alloc::string::String,
30 #[prost(string, tag = "2")]
31 pub reason: ::prost::alloc::string::String,
32 }
33}
34#[derive(serde::Serialize, serde::Deserialize)]
36#[derive(Clone, PartialEq, ::prost::Message)]
37pub struct Unsub {
38 #[prost(string, repeated, tag = "1")]
39 pub topics: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
40}
41#[derive(serde::Serialize, serde::Deserialize)]
43#[derive(Clone, PartialEq, ::prost::Message)]
44pub struct UnsubResponse {
45 #[prost(string, repeated, tag = "3")]
47 pub current: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
48}
49#[derive(serde::Serialize, serde::Deserialize)]
51#[derive(Clone, PartialEq, ::prost::Message)]
52pub struct Notification {
53 #[prost(string, tag = "1")]
54 pub topic: ::prost::alloc::string::String,
55 #[prost(enumeration = "ContentType", tag = "2")]
56 pub content_type: i32,
57 #[prost(enumeration = "DispatchType", tag = "3")]
58 pub dispatch_type: i32,
59 #[prost(bytes = "vec", tag = "4")]
60 pub data: ::prost::alloc::vec::Vec<u8>,
61}
62#[derive(serde::Serialize, serde::Deserialize)]
64#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
65#[repr(i32)]
66pub enum Command {
67 CmdUnknown = 0,
68 CmdSub = 16,
69 CmdUnsub = 17,
70 CmdNotify = 18,
71}
72impl Command {
73 pub fn as_str_name(&self) -> &'static str {
78 match self {
79 Self::CmdUnknown => "CMD_UNKNOWN",
80 Self::CmdSub => "CMD_SUB",
81 Self::CmdUnsub => "CMD_UNSUB",
82 Self::CmdNotify => "CMD_NOTIFY",
83 }
84 }
85 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
87 match value {
88 "CMD_UNKNOWN" => Some(Self::CmdUnknown),
89 "CMD_SUB" => Some(Self::CmdSub),
90 "CMD_UNSUB" => Some(Self::CmdUnsub),
91 "CMD_NOTIFY" => Some(Self::CmdNotify),
92 _ => None,
93 }
94 }
95}
96#[derive(serde::Serialize, serde::Deserialize)]
98#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
99#[repr(i32)]
100pub enum DispatchType {
101 DispatchUndefined = 0,
102 DispatchDirect = 1,
103 DispatchBroadcast = 2,
104}
105impl DispatchType {
106 pub fn as_str_name(&self) -> &'static str {
111 match self {
112 Self::DispatchUndefined => "DISPATCH_UNDEFINED",
113 Self::DispatchDirect => "DISPATCH_DIRECT",
114 Self::DispatchBroadcast => "DISPATCH_BROADCAST",
115 }
116 }
117 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
119 match value {
120 "DISPATCH_UNDEFINED" => Some(Self::DispatchUndefined),
121 "DISPATCH_DIRECT" => Some(Self::DispatchDirect),
122 "DISPATCH_BROADCAST" => Some(Self::DispatchBroadcast),
123 _ => None,
124 }
125 }
126}
127#[derive(serde::Serialize, serde::Deserialize)]
128#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
129#[repr(i32)]
130pub enum ContentType {
131 ContentUndefined = 0,
132 ContentJson = 1,
133 ContentProto = 2,
134}
135impl ContentType {
136 pub fn as_str_name(&self) -> &'static str {
141 match self {
142 Self::ContentUndefined => "CONTENT_UNDEFINED",
143 Self::ContentJson => "CONTENT_JSON",
144 Self::ContentProto => "CONTENT_PROTO",
145 }
146 }
147 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
149 match value {
150 "CONTENT_UNDEFINED" => Some(Self::ContentUndefined),
151 "CONTENT_JSON" => Some(Self::ContentJson),
152 "CONTENT_PROTO" => Some(Self::ContentProto),
153 _ => None,
154 }
155 }
156}