futu_proto/Users/leaf/ai-lab/futu-opend-rs/target/debug/build/futu-proto-732001f670b3b167/out/
notify.rs

1// This file is @generated by prost-build.
2#[derive(serde::Serialize, serde::Deserialize)]
3#[serde(default)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct GtwEvent {
6    /// GtwEventType,事件类型
7    #[prost(int32, required, tag = "1")]
8    pub event_type: i32,
9    /// 事件描述
10    #[prost(string, required, tag = "2")]
11    pub desc: ::prost::alloc::string::String,
12}
13#[derive(serde::Serialize, serde::Deserialize)]
14#[serde(default)]
15#[derive(Clone, PartialEq, ::prost::Message)]
16pub struct ProgramStatus {
17    /// 当前程序状态
18    #[prost(message, required, tag = "1")]
19    pub program_status: super::common::ProgramStatus,
20}
21#[derive(serde::Serialize, serde::Deserialize)]
22#[serde(default)]
23#[derive(Clone, Copy, PartialEq, ::prost::Message)]
24pub struct ConnectStatus {
25    /// 是否登陆行情服务器
26    #[prost(bool, required, tag = "1")]
27    pub qot_logined: bool,
28    /// 是否登陆交易服务器
29    #[prost(bool, required, tag = "2")]
30    pub trd_logined: bool,
31}
32#[derive(serde::Serialize, serde::Deserialize)]
33#[serde(default)]
34#[derive(Clone, Copy, PartialEq, ::prost::Message)]
35pub struct QotRight {
36    /// 港股行情权限, Qot_Common.QotRight
37    #[prost(int32, required, tag = "4")]
38    pub hk_qot_right: i32,
39    /// 美股行情权限, Qot_Common.QotRight
40    #[prost(int32, required, tag = "5")]
41    pub us_qot_right: i32,
42    /// A股行情权限, Qot_Common.QotRight // (已废弃),使用shQotRight和szQotRight
43    #[prost(int32, required, tag = "6")]
44    pub cn_qot_right: i32,
45    /// 港股期权行情权限, Qot_Common.QotRight
46    #[prost(int32, optional, tag = "7")]
47    pub hk_option_qot_right: ::core::option::Option<i32>,
48    /// 是否有美股期权行情权限
49    #[prost(bool, optional, tag = "8")]
50    pub has_us_option_qot_right: ::core::option::Option<bool>,
51    /// 港股期货行情权限, Qot_Common.QotRight
52    #[prost(int32, optional, tag = "9")]
53    pub hk_future_qot_right: ::core::option::Option<i32>,
54    /// 美股期货行情权限, Qot_Common.QotRight(已废弃)
55    #[prost(int32, optional, tag = "10")]
56    pub us_future_qot_right: ::core::option::Option<i32>,
57    /// 美股期权行情权限, Qot_Common.QotRight
58    #[prost(int32, optional, tag = "11")]
59    pub us_option_qot_right: ::core::option::Option<i32>,
60    /// 美股指数行情权限, Qot_Common.QotRight
61    #[prost(int32, optional, tag = "12")]
62    pub us_index_qot_right: ::core::option::Option<i32>,
63    /// 美股OTC市场行情权限, Qot_Common.QotRight
64    #[prost(int32, optional, tag = "13")]
65    pub us_otc_qot_right: ::core::option::Option<i32>,
66    /// 新加坡市场期货行情权限, Qot_Common.QotRight
67    #[prost(int32, optional, tag = "14")]
68    pub sg_future_qot_right: ::core::option::Option<i32>,
69    /// 日本市场期货行情权限, Qot_Common.QotRight
70    #[prost(int32, optional, tag = "15")]
71    pub jp_future_qot_right: ::core::option::Option<i32>,
72    /// 美股CME期货行情权限, Qot_Common.QotRight
73    #[prost(int32, optional, tag = "16")]
74    pub us_cme_future_qot_right: ::core::option::Option<i32>,
75    /// 美股CBOT期货行情权限, Qot_Common.QotRight
76    #[prost(int32, optional, tag = "17")]
77    pub us_cbot_future_qot_right: ::core::option::Option<i32>,
78    /// 美股NYMEX期货行情权限, Qot_Common.QotRight
79    #[prost(int32, optional, tag = "18")]
80    pub us_nymex_future_qot_right: ::core::option::Option<i32>,
81    /// 美股COMEX期货行情权限, Qot_Common.QotRight
82    #[prost(int32, optional, tag = "19")]
83    pub us_comex_future_qot_right: ::core::option::Option<i32>,
84    /// 美股CBOE期货行情权限, Qot_Common.QotRight
85    #[prost(int32, optional, tag = "20")]
86    pub us_cboe_future_qot_right: ::core::option::Option<i32>,
87    /// 上海A股行情权限, Qot_Common.QotRight
88    #[prost(int32, optional, tag = "21")]
89    pub sh_qot_right: ::core::option::Option<i32>,
90    /// 深圳A股行情权限, Qot_Common.QotRight
91    #[prost(int32, optional, tag = "22")]
92    pub sz_qot_right: ::core::option::Option<i32>,
93}
94#[derive(serde::Serialize, serde::Deserialize)]
95#[serde(default)]
96#[derive(Clone, PartialEq, ::prost::Message)]
97pub struct ApiLevel {
98    /// api用户等级描述,已在2.10版本之后废弃
99    #[prost(string, required, tag = "3")]
100    pub api_level: ::prost::alloc::string::String,
101}
102#[derive(serde::Serialize, serde::Deserialize)]
103#[serde(default)]
104#[derive(Clone, Copy, PartialEq, ::prost::Message)]
105pub struct ApiQuota {
106    /// 订阅额度
107    #[prost(int32, required, tag = "1")]
108    pub sub_quota: i32,
109    /// 历史K线额度
110    #[prost(int32, required, tag = "2")]
111    pub history_kl_quota: i32,
112}
113#[derive(serde::Serialize, serde::Deserialize)]
114#[serde(default)]
115#[derive(Clone, Copy, PartialEq, ::prost::Message)]
116pub struct UsedQuota {
117    /// 已使用订阅额度
118    #[prost(int32, optional, tag = "1")]
119    pub used_sub_quota: ::core::option::Option<i32>,
120    /// 已使用历史 K 线额度
121    #[prost(int32, optional, tag = "2")]
122    pub used_k_line_quota: ::core::option::Option<i32>,
123}
124#[derive(serde::Serialize, serde::Deserialize)]
125#[serde(default)]
126#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct S2c {
128    /// 通知类型
129    #[prost(int32, required, tag = "1")]
130    pub r#type: i32,
131    /// 事件通息
132    #[prost(message, optional, tag = "2")]
133    pub event: ::core::option::Option<GtwEvent>,
134    /// 程序状态
135    #[prost(message, optional, tag = "3")]
136    pub program_status: ::core::option::Option<ProgramStatus>,
137    /// 连接状态
138    #[prost(message, optional, tag = "4")]
139    pub connect_status: ::core::option::Option<ConnectStatus>,
140    /// 行情权限
141    #[prost(message, optional, tag = "5")]
142    pub qot_right: ::core::option::Option<QotRight>,
143    /// 用户等级,已在2.10版本之后废弃
144    #[prost(message, optional, tag = "6")]
145    pub api_level: ::core::option::Option<ApiLevel>,
146    /// API额度
147    #[prost(message, optional, tag = "7")]
148    pub api_quota: ::core::option::Option<ApiQuota>,
149    /// 已使用额度
150    #[prost(message, optional, tag = "8")]
151    pub used_quota: ::core::option::Option<UsedQuota>,
152}
153#[derive(serde::Serialize, serde::Deserialize)]
154#[serde(default)]
155#[derive(Clone, PartialEq, ::prost::Message)]
156pub struct Response {
157    /// RetType,返回结果
158    #[prost(int32, required, tag = "1", default = "-400")]
159    pub ret_type: i32,
160    #[prost(string, optional, tag = "2")]
161    pub ret_msg: ::core::option::Option<::prost::alloc::string::String>,
162    #[prost(int32, optional, tag = "3")]
163    pub err_code: ::core::option::Option<i32>,
164    #[prost(message, optional, tag = "4")]
165    pub s2c: ::core::option::Option<S2c>,
166}
167#[derive(serde::Serialize, serde::Deserialize)]
168#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
169#[repr(i32)]
170pub enum NotifyType {
171    /// 无
172    None = 0,
173    /// OpenD运行事件通知
174    GtwEvent = 1,
175    /// 程序状态
176    ProgramStatus = 2,
177    /// 连接状态
178    ConnStatus = 3,
179    /// 行情权限
180    QotRight = 4,
181    /// 用户等级,已在2.10版本之后废弃
182    ApiLevel = 5,
183    /// API额度
184    ApiQuota = 6,
185    /// 已使用额度
186    UsedQuota = 7,
187}
188impl NotifyType {
189    /// String value of the enum field names used in the ProtoBuf definition.
190    ///
191    /// The values are not transformed in any way and thus are considered stable
192    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
193    pub fn as_str_name(&self) -> &'static str {
194        match self {
195            Self::None => "NotifyType_None",
196            Self::GtwEvent => "NotifyType_GtwEvent",
197            Self::ProgramStatus => "NotifyType_ProgramStatus",
198            Self::ConnStatus => "NotifyType_ConnStatus",
199            Self::QotRight => "NotifyType_QotRight",
200            Self::ApiLevel => "NotifyType_APILevel",
201            Self::ApiQuota => "NotifyType_APIQuota",
202            Self::UsedQuota => "NotifyType_UsedQuota",
203        }
204    }
205    /// Creates an enum from field names used in the ProtoBuf definition.
206    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
207        match value {
208            "NotifyType_None" => Some(Self::None),
209            "NotifyType_GtwEvent" => Some(Self::GtwEvent),
210            "NotifyType_ProgramStatus" => Some(Self::ProgramStatus),
211            "NotifyType_ConnStatus" => Some(Self::ConnStatus),
212            "NotifyType_QotRight" => Some(Self::QotRight),
213            "NotifyType_APILevel" => Some(Self::ApiLevel),
214            "NotifyType_APIQuota" => Some(Self::ApiQuota),
215            "NotifyType_UsedQuota" => Some(Self::UsedQuota),
216            _ => None,
217        }
218    }
219}
220#[derive(serde::Serialize, serde::Deserialize)]
221#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
222#[repr(i32)]
223pub enum GtwEventType {
224    /// 正常无错
225    None = 0,
226    /// 加载本地配置失败
227    LocalCfgLoadFailed = 1,
228    /// 服务器启动失败
229    ApiSvrRunFailed = 2,
230    /// 客户端版本过低
231    ForceUpdate = 3,
232    /// 登录失败
233    LoginFailed = 4,
234    /// 未同意免责声明
235    UnAgreeDisclaimer = 5,
236    /// 缺少必要网络配置信息;例如控制订阅额度 //已优化,不会再出现该情况
237    NetCfgMissing = 6,
238    /// 牛牛帐号在别处登录
239    KickedOut = 7,
240    /// 登录密码被修改
241    LoginPwdChanged = 8,
242    /// 用户被禁止登录
243    BanLogin = 9,
244    /// 需要图形验证码
245    NeedPicVerifyCode = 10,
246    /// 需要手机验证码
247    NeedPhoneVerifyCode = 11,
248    /// 程序自带数据不存在
249    AppDataNotExist = 12,
250    /// 缺少必要数据
251    NessaryDataMissing = 13,
252    /// 交易密码被修改
253    TradePwdChanged = 14,
254    /// 启用设备锁
255    EnableDeviceLock = 15,
256}
257impl GtwEventType {
258    /// String value of the enum field names used in the ProtoBuf definition.
259    ///
260    /// The values are not transformed in any way and thus are considered stable
261    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
262    pub fn as_str_name(&self) -> &'static str {
263        match self {
264            Self::None => "GtwEventType_None",
265            Self::LocalCfgLoadFailed => "GtwEventType_LocalCfgLoadFailed",
266            Self::ApiSvrRunFailed => "GtwEventType_APISvrRunFailed",
267            Self::ForceUpdate => "GtwEventType_ForceUpdate",
268            Self::LoginFailed => "GtwEventType_LoginFailed",
269            Self::UnAgreeDisclaimer => "GtwEventType_UnAgreeDisclaimer",
270            Self::NetCfgMissing => "GtwEventType_NetCfgMissing",
271            Self::KickedOut => "GtwEventType_KickedOut",
272            Self::LoginPwdChanged => "GtwEventType_LoginPwdChanged",
273            Self::BanLogin => "GtwEventType_BanLogin",
274            Self::NeedPicVerifyCode => "GtwEventType_NeedPicVerifyCode",
275            Self::NeedPhoneVerifyCode => "GtwEventType_NeedPhoneVerifyCode",
276            Self::AppDataNotExist => "GtwEventType_AppDataNotExist",
277            Self::NessaryDataMissing => "GtwEventType_NessaryDataMissing",
278            Self::TradePwdChanged => "GtwEventType_TradePwdChanged",
279            Self::EnableDeviceLock => "GtwEventType_EnableDeviceLock",
280        }
281    }
282    /// Creates an enum from field names used in the ProtoBuf definition.
283    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
284        match value {
285            "GtwEventType_None" => Some(Self::None),
286            "GtwEventType_LocalCfgLoadFailed" => Some(Self::LocalCfgLoadFailed),
287            "GtwEventType_APISvrRunFailed" => Some(Self::ApiSvrRunFailed),
288            "GtwEventType_ForceUpdate" => Some(Self::ForceUpdate),
289            "GtwEventType_LoginFailed" => Some(Self::LoginFailed),
290            "GtwEventType_UnAgreeDisclaimer" => Some(Self::UnAgreeDisclaimer),
291            "GtwEventType_NetCfgMissing" => Some(Self::NetCfgMissing),
292            "GtwEventType_KickedOut" => Some(Self::KickedOut),
293            "GtwEventType_LoginPwdChanged" => Some(Self::LoginPwdChanged),
294            "GtwEventType_BanLogin" => Some(Self::BanLogin),
295            "GtwEventType_NeedPicVerifyCode" => Some(Self::NeedPicVerifyCode),
296            "GtwEventType_NeedPhoneVerifyCode" => Some(Self::NeedPhoneVerifyCode),
297            "GtwEventType_AppDataNotExist" => Some(Self::AppDataNotExist),
298            "GtwEventType_NessaryDataMissing" => Some(Self::NessaryDataMissing),
299            "GtwEventType_TradePwdChanged" => Some(Self::TradePwdChanged),
300            "GtwEventType_EnableDeviceLock" => Some(Self::EnableDeviceLock),
301            _ => None,
302        }
303    }
304}