pole_specification/
v1.rs

1// This file is @generated by prost-build.
2/// 主调服务信息数据
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct Caller {
5    #[prost(string, tag = "2")]
6    pub namespace: ::prost::alloc::string::String,
7    #[prost(string, tag = "3")]
8    pub service: ::prost::alloc::string::String,
9    /// 客户端标签
10    #[prost(message, repeated, tag = "10")]
11    pub labels: ::prost::alloc::vec::Vec<ClientLabel>,
12}
13#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
14pub struct Location {
15    #[prost(string, tag = "1")]
16    pub region: ::prost::alloc::string::String,
17    #[prost(string, tag = "2")]
18    pub zone: ::prost::alloc::string::String,
19    #[prost(string, tag = "3")]
20    pub campus: ::prost::alloc::string::String,
21}
22#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
23pub struct MatchString {
24    #[prost(enumeration = "match_string::MatchStringType", tag = "1")]
25    pub r#type: i32,
26    #[prost(string, tag = "2")]
27    pub value: ::prost::alloc::string::String,
28    #[prost(enumeration = "match_string::ValueType", tag = "3")]
29    pub value_type: i32,
30}
31/// Nested message and enum types in `MatchString`.
32pub mod match_string {
33    #[derive(
34        Clone,
35        Copy,
36        Debug,
37        PartialEq,
38        Eq,
39        Hash,
40        PartialOrd,
41        Ord,
42        ::prost::Enumeration
43    )]
44    #[repr(i32)]
45    pub enum MatchStringType {
46        /// Equivalent match
47        Exact = 0,
48        /// Regular match
49        Regex = 1,
50        /// Not equals match
51        NotEquals = 2,
52        /// Include match
53        In = 3,
54        /// Not include match
55        NotIn = 4,
56        /// Range match
57        Range = 5,
58    }
59    impl MatchStringType {
60        /// String value of the enum field names used in the ProtoBuf definition.
61        ///
62        /// The values are not transformed in any way and thus are considered stable
63        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
64        pub fn as_str_name(&self) -> &'static str {
65            match self {
66                Self::Exact => "EXACT",
67                Self::Regex => "REGEX",
68                Self::NotEquals => "NOT_EQUALS",
69                Self::In => "IN",
70                Self::NotIn => "NOT_IN",
71                Self::Range => "RANGE",
72            }
73        }
74        /// Creates an enum from field names used in the ProtoBuf definition.
75        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
76            match value {
77                "EXACT" => Some(Self::Exact),
78                "REGEX" => Some(Self::Regex),
79                "NOT_EQUALS" => Some(Self::NotEquals),
80                "IN" => Some(Self::In),
81                "NOT_IN" => Some(Self::NotIn),
82                "RANGE" => Some(Self::Range),
83                _ => None,
84            }
85        }
86    }
87    #[derive(
88        Clone,
89        Copy,
90        Debug,
91        PartialEq,
92        Eq,
93        Hash,
94        PartialOrd,
95        Ord,
96        ::prost::Enumeration
97    )]
98    #[repr(i32)]
99    pub enum ValueType {
100        Text = 0,
101        Parameter = 1,
102        Variable = 2,
103    }
104    impl ValueType {
105        /// String value of the enum field names used in the ProtoBuf definition.
106        ///
107        /// The values are not transformed in any way and thus are considered stable
108        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
109        pub fn as_str_name(&self) -> &'static str {
110            match self {
111                Self::Text => "TEXT",
112                Self::Parameter => "PARAMETER",
113                Self::Variable => "VARIABLE",
114            }
115        }
116        /// Creates an enum from field names used in the ProtoBuf definition.
117        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
118            match value {
119                "TEXT" => Some(Self::Text),
120                "PARAMETER" => Some(Self::Parameter),
121                "VARIABLE" => Some(Self::Variable),
122                _ => None,
123            }
124        }
125    }
126}
127#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
128pub struct StringList {
129    #[prost(string, repeated, tag = "1")]
130    pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
131}
132/// 汇总查询数据
133#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
134pub struct Summary {
135    /// 服务总数
136    #[prost(uint32, tag = "1")]
137    pub total_service_count: u32,
138    /// 健康实例总数
139    #[prost(uint32, tag = "2")]
140    pub total_health_instance_count: u32,
141    /// 实例总数
142    #[prost(uint32, tag = "3")]
143    pub total_instance_count: u32,
144}
145#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
146pub struct ClientLabel {
147    #[prost(string, tag = "1")]
148    pub key: ::prost::alloc::string::String,
149    #[prost(message, optional, tag = "2")]
150    pub value: ::core::option::Option<MatchString>,
151}
152/// API统一数据结构
153#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
154pub struct Api {
155    /// API的协议,\*或者为空代表全部
156    #[prost(string, tag = "1")]
157    pub protocol: ::prost::alloc::string::String,
158    /// API的方法,\*或者为空代表全部
159    #[prost(string, tag = "2")]
160    pub method: ::prost::alloc::string::String,
161    /// API的路径,支持多种匹配方式
162    #[prost(message, optional, tag = "3")]
163    pub path: ::core::option::Option<MatchString>,
164}
165/// 治理规则发布请求
166#[derive(Clone, PartialEq, ::prost::Message)]
167pub struct RuleRelease {
168    #[prost(string, tag = "1")]
169    pub id: ::prost::alloc::string::String,
170    #[prost(string, tag = "2")]
171    pub rule_id: ::prost::alloc::string::String,
172    #[prost(string, tag = "3")]
173    pub rule_name: ::prost::alloc::string::String,
174    #[prost(string, tag = "4")]
175    pub release_name: ::prost::alloc::string::String,
176    #[prost(string, tag = "5")]
177    pub description: ::prost::alloc::string::String,
178    #[prost(string, tag = "6")]
179    pub release_type: ::prost::alloc::string::String,
180    #[prost(message, repeated, tag = "7")]
181    pub client_labels: ::prost::alloc::vec::Vec<ClientLabel>,
182    #[prost(uint64, tag = "8")]
183    pub version: u64,
184    #[prost(enumeration = "rule_release::RuleType", tag = "9")]
185    pub resource: i32,
186    #[prost(bool, tag = "10")]
187    pub active: bool,
188    #[prost(string, tag = "20")]
189    pub ctime: ::prost::alloc::string::String,
190    #[prost(string, tag = "21")]
191    pub mtime: ::prost::alloc::string::String,
192}
193/// Nested message and enum types in `RuleRelease`.
194pub mod rule_release {
195    #[derive(
196        Clone,
197        Copy,
198        Debug,
199        PartialEq,
200        Eq,
201        Hash,
202        PartialOrd,
203        Ord,
204        ::prost::Enumeration
205    )]
206    #[repr(i32)]
207    pub enum RuleType {
208        RouteRules = 0,
209        RateLimitRules = 1,
210        CircuitBreakerRules = 2,
211        FaultDetectRules = 3,
212        LaneRules = 4,
213        LosslessRules = 5,
214        TrafficMirrorRules = 6,
215        TrafficSecurityRules = 7,
216    }
217    impl RuleType {
218        /// String value of the enum field names used in the ProtoBuf definition.
219        ///
220        /// The values are not transformed in any way and thus are considered stable
221        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
222        pub fn as_str_name(&self) -> &'static str {
223            match self {
224                Self::RouteRules => "RouteRules",
225                Self::RateLimitRules => "RateLimitRules",
226                Self::CircuitBreakerRules => "CircuitBreakerRules",
227                Self::FaultDetectRules => "FaultDetectRules",
228                Self::LaneRules => "LaneRules",
229                Self::LosslessRules => "LosslessRules",
230                Self::TrafficMirrorRules => "TrafficMirrorRules",
231                Self::TrafficSecurityRules => "TrafficSecurityRules",
232            }
233        }
234        /// Creates an enum from field names used in the ProtoBuf definition.
235        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
236            match value {
237                "RouteRules" => Some(Self::RouteRules),
238                "RateLimitRules" => Some(Self::RateLimitRules),
239                "CircuitBreakerRules" => Some(Self::CircuitBreakerRules),
240                "FaultDetectRules" => Some(Self::FaultDetectRules),
241                "LaneRules" => Some(Self::LaneRules),
242                "LosslessRules" => Some(Self::LosslessRules),
243                "TrafficMirrorRules" => Some(Self::TrafficMirrorRules),
244                "TrafficSecurityRules" => Some(Self::TrafficSecurityRules),
245                _ => None,
246            }
247        }
248    }
249}
250#[derive(Clone, PartialEq, ::prost::Message)]
251pub struct ConfigFileGroup {
252    #[prost(string, tag = "1")]
253    pub id: ::prost::alloc::string::String,
254    #[prost(string, tag = "2")]
255    pub name: ::prost::alloc::string::String,
256    #[prost(string, tag = "3")]
257    pub namespace: ::prost::alloc::string::String,
258    #[prost(string, tag = "4")]
259    pub comment: ::prost::alloc::string::String,
260    #[prost(string, tag = "5")]
261    pub ctime: ::prost::alloc::string::String,
262    #[prost(string, tag = "7")]
263    pub mtime: ::prost::alloc::string::String,
264    #[prost(string, tag = "8")]
265    pub business: ::prost::alloc::string::String,
266    #[prost(string, tag = "9")]
267    pub department: ::prost::alloc::string::String,
268    #[prost(map = "string, string", tag = "10")]
269    pub metadata: ::std::collections::HashMap<
270        ::prost::alloc::string::String,
271        ::prost::alloc::string::String,
272    >,
273    #[prost(uint64, tag = "11")]
274    pub file_count: u64,
275    /// 删除操作标志位
276    #[prost(bool, tag = "15")]
277    pub editable: bool,
278    #[prost(bool, tag = "20")]
279    pub deleteable: bool,
280}
281#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
282pub struct ConfigFilePersistent {
283    #[prost(string, tag = "1")]
284    pub encoding: ::prost::alloc::string::String,
285    #[prost(string, tag = "2")]
286    pub path: ::prost::alloc::string::String,
287    #[prost(string, tag = "3")]
288    pub post_cmd: ::prost::alloc::string::String,
289}
290#[derive(Clone, PartialEq, ::prost::Message)]
291pub struct PlaceholderValue {
292    /// 占位符名称
293    #[prost(string, tag = "1")]
294    pub placeholder: ::prost::alloc::string::String,
295    /// 占位符对应的值
296    #[prost(message, repeated, tag = "2")]
297    pub values: ::prost::alloc::vec::Vec<MatchString>,
298}
299#[derive(Clone, PartialEq, ::prost::Message)]
300pub struct ConfigFile {
301    #[prost(string, tag = "1")]
302    pub id: ::prost::alloc::string::String,
303    #[prost(string, tag = "2")]
304    pub name: ::prost::alloc::string::String,
305    #[prost(string, tag = "3")]
306    pub namespace: ::prost::alloc::string::String,
307    #[prost(string, tag = "4")]
308    pub group: ::prost::alloc::string::String,
309    #[prost(string, tag = "5")]
310    pub content: ::prost::alloc::string::String,
311    #[prost(string, tag = "6")]
312    pub format: ::prost::alloc::string::String,
313    #[prost(string, tag = "7")]
314    pub comment: ::prost::alloc::string::String,
315    #[prost(string, tag = "8")]
316    pub status: ::prost::alloc::string::String,
317    #[prost(map = "string, string", tag = "9")]
318    pub labels: ::std::collections::HashMap<
319        ::prost::alloc::string::String,
320        ::prost::alloc::string::String,
321    >,
322    #[prost(string, tag = "10")]
323    pub ctime: ::prost::alloc::string::String,
324    #[prost(string, tag = "12")]
325    pub mtime: ::prost::alloc::string::String,
326    #[prost(string, tag = "14")]
327    pub rtime: ::prost::alloc::string::String,
328    /// 是否为加密配置文件
329    #[prost(bool, tag = "16")]
330    pub encrypted: bool,
331    /// 加密算法
332    #[prost(string, tag = "17")]
333    pub encrypt_algo: ::prost::alloc::string::String,
334    #[prost(enumeration = "ConfigFileSupportedClient", tag = "18")]
335    pub supported_client: i32,
336    #[prost(message, optional, tag = "19")]
337    pub persistent: ::core::option::Option<ConfigFilePersistent>,
338    #[prost(enumeration = "config_file::ConfigFileType", tag = "200")]
339    pub config_type: i32,
340    /// 如果是配置模板,还需要添加占位符对应的 value 值匹配信息
341    #[prost(map = "string, message", tag = "201")]
342    pub placeholder_value_map: ::std::collections::HashMap<
343        ::prost::alloc::string::String,
344        PlaceholderValue,
345    >,
346}
347/// Nested message and enum types in `ConfigFile`.
348pub mod config_file {
349    /// 文件类型
350    #[derive(
351        Clone,
352        Copy,
353        Debug,
354        PartialEq,
355        Eq,
356        Hash,
357        PartialOrd,
358        Ord,
359        ::prost::Enumeration
360    )]
361    #[repr(i32)]
362    pub enum ConfigFileType {
363        /// 普通配置文件
364        ConfigFile = 0,
365        /// 配置模板
366        ConfigTemplate = 1,
367    }
368    impl ConfigFileType {
369        /// String value of the enum field names used in the ProtoBuf definition.
370        ///
371        /// The values are not transformed in any way and thus are considered stable
372        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
373        pub fn as_str_name(&self) -> &'static str {
374            match self {
375                Self::ConfigFile => "CONFIG_FILE",
376                Self::ConfigTemplate => "CONFIG_TEMPLATE",
377            }
378        }
379        /// Creates an enum from field names used in the ProtoBuf definition.
380        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
381            match value {
382                "CONFIG_FILE" => Some(Self::ConfigFile),
383                "CONFIG_TEMPLATE" => Some(Self::ConfigTemplate),
384                _ => None,
385            }
386        }
387    }
388}
389#[derive(Clone, PartialEq, ::prost::Message)]
390pub struct ConfigFileRelease {
391    #[prost(string, tag = "1")]
392    pub id: ::prost::alloc::string::String,
393    #[prost(string, tag = "2")]
394    pub name: ::prost::alloc::string::String,
395    #[prost(string, tag = "3")]
396    pub namespace: ::prost::alloc::string::String,
397    #[prost(string, tag = "4")]
398    pub group: ::prost::alloc::string::String,
399    #[prost(string, tag = "5")]
400    pub file_name: ::prost::alloc::string::String,
401    #[prost(string, tag = "6")]
402    pub content: ::prost::alloc::string::String,
403    #[prost(string, tag = "7")]
404    pub comment: ::prost::alloc::string::String,
405    #[prost(string, tag = "8")]
406    pub md5: ::prost::alloc::string::String,
407    #[prost(uint64, tag = "9")]
408    pub version: u64,
409    #[prost(string, tag = "10")]
410    pub ctime: ::prost::alloc::string::String,
411    #[prost(string, tag = "11")]
412    pub create_by: ::prost::alloc::string::String,
413    #[prost(string, tag = "12")]
414    pub mtime: ::prost::alloc::string::String,
415    #[prost(string, tag = "13")]
416    pub modify_by: ::prost::alloc::string::String,
417    #[prost(map = "string, string", tag = "14")]
418    pub labels: ::std::collections::HashMap<
419        ::prost::alloc::string::String,
420        ::prost::alloc::string::String,
421    >,
422    /// 当前生效配置
423    #[prost(bool, tag = "15")]
424    pub active: bool,
425    #[prost(string, tag = "16")]
426    pub format: ::prost::alloc::string::String,
427    #[prost(string, tag = "17")]
428    pub release_description: ::prost::alloc::string::String,
429    #[prost(string, tag = "18")]
430    pub release_type: ::prost::alloc::string::String,
431    /// 配置灰度发布时需要匹配的客户端标签信息
432    #[prost(message, repeated, tag = "19")]
433    pub beta_labels: ::prost::alloc::vec::Vec<ClientLabel>,
434    #[prost(enumeration = "ConfigFileSupportedClient", tag = "21")]
435    pub supported_client: i32,
436    #[prost(message, optional, tag = "22")]
437    pub persistent: ::core::option::Option<ConfigFilePersistent>,
438    /// 是否为加密配置文件
439    #[prost(bool, tag = "23")]
440    pub encrypted: bool,
441    /// 加密算法
442    #[prost(string, tag = "24")]
443    pub encrypt_algo: ::prost::alloc::string::String,
444    #[prost(enumeration = "config_file_release::ConfigFileType", tag = "200")]
445    pub config_type: i32,
446    /// 如果是配置模板,还需要添加占位符对应的 value 值匹配信息
447    #[prost(map = "string, message", tag = "201")]
448    pub placeholder_value_map: ::std::collections::HashMap<
449        ::prost::alloc::string::String,
450        PlaceholderValue,
451    >,
452}
453/// Nested message and enum types in `ConfigFileRelease`.
454pub mod config_file_release {
455    /// 文件类型
456    #[derive(
457        Clone,
458        Copy,
459        Debug,
460        PartialEq,
461        Eq,
462        Hash,
463        PartialOrd,
464        Ord,
465        ::prost::Enumeration
466    )]
467    #[repr(i32)]
468    pub enum ConfigFileType {
469        /// 普通配置文件
470        ConfigFile = 0,
471        /// 配置模板
472        ConfigTemplate = 1,
473    }
474    impl ConfigFileType {
475        /// String value of the enum field names used in the ProtoBuf definition.
476        ///
477        /// The values are not transformed in any way and thus are considered stable
478        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
479        pub fn as_str_name(&self) -> &'static str {
480            match self {
481                Self::ConfigFile => "CONFIG_FILE",
482                Self::ConfigTemplate => "CONFIG_TEMPLATE",
483            }
484        }
485        /// Creates an enum from field names used in the ProtoBuf definition.
486        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
487            match value {
488                "CONFIG_FILE" => Some(Self::ConfigFile),
489                "CONFIG_TEMPLATE" => Some(Self::ConfigTemplate),
490                _ => None,
491            }
492        }
493    }
494}
495#[derive(Clone, PartialEq, ::prost::Message)]
496pub struct ConfigFileReleaseHistory {
497    #[prost(string, tag = "1")]
498    pub id: ::prost::alloc::string::String,
499    #[prost(string, tag = "2")]
500    pub name: ::prost::alloc::string::String,
501    #[prost(string, tag = "3")]
502    pub namespace: ::prost::alloc::string::String,
503    #[prost(string, tag = "4")]
504    pub group: ::prost::alloc::string::String,
505    #[prost(string, tag = "5")]
506    pub file_name: ::prost::alloc::string::String,
507    #[prost(string, tag = "6")]
508    pub content: ::prost::alloc::string::String,
509    #[prost(string, tag = "7")]
510    pub format: ::prost::alloc::string::String,
511    #[prost(string, tag = "8")]
512    pub comment: ::prost::alloc::string::String,
513    #[prost(string, tag = "9")]
514    pub md5: ::prost::alloc::string::String,
515    #[prost(string, tag = "10")]
516    pub r#type: ::prost::alloc::string::String,
517    #[prost(string, tag = "11")]
518    pub status: ::prost::alloc::string::String,
519    #[prost(map = "string, string", tag = "12")]
520    pub labels: ::std::collections::HashMap<
521        ::prost::alloc::string::String,
522        ::prost::alloc::string::String,
523    >,
524    #[prost(string, tag = "13")]
525    pub ctime: ::prost::alloc::string::String,
526    #[prost(string, tag = "14")]
527    pub create_by: ::prost::alloc::string::String,
528    #[prost(string, tag = "15")]
529    pub mtime: ::prost::alloc::string::String,
530    #[prost(string, tag = "16")]
531    pub modify_by: ::prost::alloc::string::String,
532    /// 配置发布失败的原因
533    #[prost(string, tag = "17")]
534    pub reason: ::prost::alloc::string::String,
535    #[prost(string, tag = "18")]
536    pub release_description: ::prost::alloc::string::String,
537    #[prost(enumeration = "config_file_release_history::ConfigFileType", tag = "200")]
538    pub config_type: i32,
539    /// 如果是配置模板,还需要添加占位符对应的 value 值匹配信息
540    #[prost(map = "string, message", tag = "201")]
541    pub placeholder_value_map: ::std::collections::HashMap<
542        ::prost::alloc::string::String,
543        PlaceholderValue,
544    >,
545}
546/// Nested message and enum types in `ConfigFileReleaseHistory`.
547pub mod config_file_release_history {
548    /// 文件类型
549    #[derive(
550        Clone,
551        Copy,
552        Debug,
553        PartialEq,
554        Eq,
555        Hash,
556        PartialOrd,
557        Ord,
558        ::prost::Enumeration
559    )]
560    #[repr(i32)]
561    pub enum ConfigFileType {
562        /// 普通配置文件
563        ConfigFile = 0,
564        /// 配置模板
565        ConfigTemplate = 1,
566    }
567    impl ConfigFileType {
568        /// String value of the enum field names used in the ProtoBuf definition.
569        ///
570        /// The values are not transformed in any way and thus are considered stable
571        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
572        pub fn as_str_name(&self) -> &'static str {
573            match self {
574                Self::ConfigFile => "CONFIG_FILE",
575                Self::ConfigTemplate => "CONFIG_TEMPLATE",
576            }
577        }
578        /// Creates an enum from field names used in the ProtoBuf definition.
579        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
580            match value {
581                "CONFIG_FILE" => Some(Self::ConfigFile),
582                "CONFIG_TEMPLATE" => Some(Self::ConfigTemplate),
583                _ => None,
584            }
585        }
586    }
587}
588#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
589pub struct ConfigFileTemplate {
590    #[prost(uint64, tag = "1")]
591    pub id: u64,
592    #[prost(string, tag = "2")]
593    pub name: ::prost::alloc::string::String,
594    #[prost(string, tag = "3")]
595    pub content: ::prost::alloc::string::String,
596    #[prost(string, tag = "4")]
597    pub format: ::prost::alloc::string::String,
598    #[prost(string, tag = "5")]
599    pub comment: ::prost::alloc::string::String,
600    #[prost(string, tag = "6")]
601    pub ctime: ::prost::alloc::string::String,
602    #[prost(string, tag = "8")]
603    pub mtime: ::prost::alloc::string::String,
604}
605#[derive(Clone, PartialEq, ::prost::Message)]
606pub struct WatchConfigFileRequest {
607    #[prost(string, tag = "1")]
608    pub client_ip: ::prost::alloc::string::String,
609    #[prost(string, tag = "2")]
610    pub service_name: ::prost::alloc::string::String,
611    #[prost(message, repeated, tag = "3")]
612    pub files: ::prost::alloc::vec::Vec<ConfigFileRelease>,
613    #[prost(enumeration = "ConfigClientType", tag = "4")]
614    pub client_type: i32,
615}
616#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
617pub struct ConfigFileExportRequest {
618    #[prost(string, tag = "1")]
619    pub namespace: ::prost::alloc::string::String,
620    #[prost(string, repeated, tag = "2")]
621    pub groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
622    #[prost(string, repeated, tag = "3")]
623    pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
624    #[prost(uint64, repeated, tag = "4")]
625    pub ids: ::prost::alloc::vec::Vec<u64>,
626}
627#[derive(Clone, PartialEq, ::prost::Message)]
628pub struct ConfigFilePublishInfo {
629    #[prost(string, tag = "1")]
630    pub release_name: ::prost::alloc::string::String,
631    #[prost(string, tag = "2")]
632    pub namespace: ::prost::alloc::string::String,
633    #[prost(string, tag = "3")]
634    pub group: ::prost::alloc::string::String,
635    #[prost(string, tag = "4")]
636    pub file_name: ::prost::alloc::string::String,
637    #[prost(string, tag = "5")]
638    pub content: ::prost::alloc::string::String,
639    #[prost(string, tag = "6")]
640    pub comment: ::prost::alloc::string::String,
641    #[prost(string, tag = "7")]
642    pub format: ::prost::alloc::string::String,
643    #[prost(string, tag = "8")]
644    pub release_description: ::prost::alloc::string::String,
645    #[prost(map = "string, string", tag = "14")]
646    pub labels: ::std::collections::HashMap<
647        ::prost::alloc::string::String,
648        ::prost::alloc::string::String,
649    >,
650    #[prost(string, tag = "15")]
651    pub md5: ::prost::alloc::string::String,
652    /// 是否为加密配置文件
653    #[prost(bool, tag = "16")]
654    pub encrypted: bool,
655    /// 加密算法
656    #[prost(string, tag = "17")]
657    pub encrypt_algo: ::prost::alloc::string::String,
658    #[prost(message, optional, tag = "19")]
659    pub persistent: ::core::option::Option<ConfigFilePersistent>,
660    #[prost(enumeration = "config_file_publish_info::ConfigFileType", tag = "200")]
661    pub config_type: i32,
662    /// 如果是配置模板,还需要添加占位符对应的 value 值匹配信息
663    #[prost(map = "string, message", tag = "201")]
664    pub placeholder_value_map: ::std::collections::HashMap<
665        ::prost::alloc::string::String,
666        PlaceholderValue,
667    >,
668}
669/// Nested message and enum types in `ConfigFilePublishInfo`.
670pub mod config_file_publish_info {
671    /// 文件类型
672    #[derive(
673        Clone,
674        Copy,
675        Debug,
676        PartialEq,
677        Eq,
678        Hash,
679        PartialOrd,
680        Ord,
681        ::prost::Enumeration
682    )]
683    #[repr(i32)]
684    pub enum ConfigFileType {
685        /// 普通配置文件
686        ConfigFile = 0,
687        /// 配置模板
688        ConfigTemplate = 1,
689    }
690    impl ConfigFileType {
691        /// String value of the enum field names used in the ProtoBuf definition.
692        ///
693        /// The values are not transformed in any way and thus are considered stable
694        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
695        pub fn as_str_name(&self) -> &'static str {
696            match self {
697                Self::ConfigFile => "CONFIG_FILE",
698                Self::ConfigTemplate => "CONFIG_TEMPLATE",
699            }
700        }
701        /// Creates an enum from field names used in the ProtoBuf definition.
702        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
703            match value {
704                "CONFIG_FILE" => Some(Self::ConfigFile),
705                "CONFIG_TEMPLATE" => Some(Self::ConfigTemplate),
706                _ => None,
707            }
708        }
709    }
710}
711#[derive(Clone, PartialEq, ::prost::Message)]
712pub struct ConfigFileGroupRequest {
713    #[prost(string, tag = "1")]
714    pub revision: ::prost::alloc::string::String,
715    #[prost(message, optional, tag = "2")]
716    pub config_file_group: ::core::option::Option<ConfigFileGroup>,
717    /// 配置标签
718    #[prost(map = "string, string", tag = "12")]
719    pub client_labels: ::std::collections::HashMap<
720        ::prost::alloc::string::String,
721        ::prost::alloc::string::String,
722    >,
723    #[prost(enumeration = "ConfigClientType", tag = "13")]
724    pub client_type: i32,
725}
726#[derive(Clone, PartialEq, ::prost::Message)]
727pub struct ConfigDiscoverFilter {
728    /// pole.io 自定义信息
729    #[prost(message, optional, tag = "1")]
730    pub caller: ::core::option::Option<Caller>,
731    /// 客户端公钥,用于加密返回的配置 encrypted_key 字段
732    #[prost(string, tag = "2")]
733    pub public_key: ::prost::alloc::string::String,
734}
735#[derive(Clone, PartialEq, ::prost::Message)]
736pub struct ConfigDiscoverRequest {
737    #[prost(
738        enumeration = "config_discover_request::ConfigDiscoverRequestType",
739        tag = "1"
740    )]
741    pub r#type: i32,
742    #[prost(message, optional, tag = "2")]
743    pub file: ::core::option::Option<ConfigFile>,
744    #[prost(string, tag = "3")]
745    pub revision: ::prost::alloc::string::String,
746    /// pole.io 自定义信息
747    #[prost(message, optional, tag = "500")]
748    pub filter: ::core::option::Option<ConfigDiscoverFilter>,
749}
750/// Nested message and enum types in `ConfigDiscoverRequest`.
751pub mod config_discover_request {
752    #[derive(
753        Clone,
754        Copy,
755        Debug,
756        PartialEq,
757        Eq,
758        Hash,
759        PartialOrd,
760        Ord,
761        ::prost::Enumeration
762    )]
763    #[repr(i32)]
764    pub enum ConfigDiscoverRequestType {
765        Unknown = 0,
766        ConfigFile = 1,
767        ConfigFileNames = 2,
768        ConfigFileGroups = 3,
769    }
770    impl ConfigDiscoverRequestType {
771        /// String value of the enum field names used in the ProtoBuf definition.
772        ///
773        /// The values are not transformed in any way and thus are considered stable
774        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
775        pub fn as_str_name(&self) -> &'static str {
776            match self {
777                Self::Unknown => "UNKNOWN",
778                Self::ConfigFile => "CONFIG_FILE",
779                Self::ConfigFileNames => "CONFIG_FILE_NAMES",
780                Self::ConfigFileGroups => "CONFIG_FILE_GROUPS",
781            }
782        }
783        /// Creates an enum from field names used in the ProtoBuf definition.
784        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
785            match value {
786                "UNKNOWN" => Some(Self::Unknown),
787                "CONFIG_FILE" => Some(Self::ConfigFile),
788                "CONFIG_FILE_NAMES" => Some(Self::ConfigFileNames),
789                "CONFIG_FILE_GROUPS" => Some(Self::ConfigFileGroups),
790                _ => None,
791            }
792        }
793    }
794}
795#[derive(Clone, PartialEq, ::prost::Message)]
796pub struct ConfigDiscoverResponse {
797    #[prost(uint32, tag = "1")]
798    pub code: u32,
799    #[prost(string, tag = "2")]
800    pub info: ::prost::alloc::string::String,
801    #[prost(string, tag = "3")]
802    pub revision: ::prost::alloc::string::String,
803    #[prost(
804        enumeration = "config_discover_response::ConfigDiscoverResponseType",
805        tag = "4"
806    )]
807    pub r#type: i32,
808    #[prost(message, optional, tag = "5")]
809    pub file: ::core::option::Option<ConfigFileRelease>,
810    #[prost(message, repeated, tag = "6")]
811    pub file_names: ::prost::alloc::vec::Vec<ConfigFileRelease>,
812    #[prost(message, repeated, tag = "7")]
813    pub file_groups: ::prost::alloc::vec::Vec<ConfigFileGroup>,
814}
815/// Nested message and enum types in `ConfigDiscoverResponse`.
816pub mod config_discover_response {
817    #[derive(
818        Clone,
819        Copy,
820        Debug,
821        PartialEq,
822        Eq,
823        Hash,
824        PartialOrd,
825        Ord,
826        ::prost::Enumeration
827    )]
828    #[repr(i32)]
829    pub enum ConfigDiscoverResponseType {
830        Unknown = 0,
831        ConfigFile = 1,
832        ConfigFileNames = 2,
833        ConfigFileGroups = 3,
834    }
835    impl ConfigDiscoverResponseType {
836        /// String value of the enum field names used in the ProtoBuf definition.
837        ///
838        /// The values are not transformed in any way and thus are considered stable
839        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
840        pub fn as_str_name(&self) -> &'static str {
841            match self {
842                Self::Unknown => "UNKNOWN",
843                Self::ConfigFile => "CONFIG_FILE",
844                Self::ConfigFileNames => "CONFIG_FILE_NAMES",
845                Self::ConfigFileGroups => "CONFIG_FILE_GROUPS",
846            }
847        }
848        /// Creates an enum from field names used in the ProtoBuf definition.
849        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
850            match value {
851                "UNKNOWN" => Some(Self::Unknown),
852                "CONFIG_FILE" => Some(Self::ConfigFile),
853                "CONFIG_FILE_NAMES" => Some(Self::ConfigFileNames),
854                "CONFIG_FILE_GROUPS" => Some(Self::ConfigFileGroups),
855                _ => None,
856            }
857        }
858    }
859}
860#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
861#[repr(i32)]
862pub enum ConfigFileSupportedClient {
863    /// 配置文件仅能被SDK拉取
864    ClientSdk = 0,
865    /// 配置文件仅能被Agent拉取
866    ClientAgent = 1,
867    /// 配置文件可以被SDK及Agent同时拉取
868    ClientAll = 2,
869}
870impl ConfigFileSupportedClient {
871    /// String value of the enum field names used in the ProtoBuf definition.
872    ///
873    /// The values are not transformed in any way and thus are considered stable
874    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
875    pub fn as_str_name(&self) -> &'static str {
876        match self {
877            Self::ClientSdk => "CLIENT_SDK",
878            Self::ClientAgent => "CLIENT_AGENT",
879            Self::ClientAll => "CLIENT_ALL",
880        }
881    }
882    /// Creates an enum from field names used in the ProtoBuf definition.
883    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
884        match value {
885            "CLIENT_SDK" => Some(Self::ClientSdk),
886            "CLIENT_AGENT" => Some(Self::ClientAgent),
887            "CLIENT_ALL" => Some(Self::ClientAll),
888            _ => None,
889        }
890    }
891}
892#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
893#[repr(i32)]
894pub enum ConfigClientType {
895    Sdk = 0,
896    Agent = 1,
897}
898impl ConfigClientType {
899    /// String value of the enum field names used in the ProtoBuf definition.
900    ///
901    /// The values are not transformed in any way and thus are considered stable
902    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
903    pub fn as_str_name(&self) -> &'static str {
904        match self {
905            Self::Sdk => "SDK",
906            Self::Agent => "Agent",
907        }
908    }
909    /// Creates an enum from field names used in the ProtoBuf definition.
910    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
911        match value {
912            "SDK" => Some(Self::Sdk),
913            "Agent" => Some(Self::Agent),
914            _ => None,
915        }
916    }
917}
918#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
919pub struct Response {
920    #[prost(uint32, tag = "1")]
921    pub code: u32,
922    #[prost(string, tag = "2")]
923    pub info: ::prost::alloc::string::String,
924    #[prost(message, optional, tag = "3")]
925    pub data: ::core::option::Option<::prost_types::Any>,
926}
927#[derive(Clone, PartialEq, ::prost::Message)]
928pub struct BatchWriteResponse {
929    #[prost(uint32, tag = "1")]
930    pub code: u32,
931    #[prost(string, tag = "2")]
932    pub info: ::prost::alloc::string::String,
933    #[prost(uint32, tag = "3")]
934    pub size: u32,
935    #[prost(message, repeated, tag = "4")]
936    pub responses: ::prost::alloc::vec::Vec<Response>,
937}
938#[derive(Clone, PartialEq, ::prost::Message)]
939pub struct BatchQueryResponse {
940    #[prost(uint32, tag = "1")]
941    pub code: u32,
942    #[prost(string, tag = "2")]
943    pub info: ::prost::alloc::string::String,
944    #[prost(uint32, tag = "3")]
945    pub amount: u32,
946    #[prost(uint32, tag = "4")]
947    pub size: u32,
948    #[prost(message, repeated, tag = "5")]
949    pub data: ::prost::alloc::vec::Vec<::prost_types::Any>,
950}
951/// Generated client implementations.
952pub mod config_grpc_client {
953    #![allow(
954        unused_variables,
955        dead_code,
956        missing_docs,
957        clippy::wildcard_imports,
958        clippy::let_unit_value,
959    )]
960    use tonic::codegen::*;
961    use tonic::codegen::http::Uri;
962    #[derive(Debug, Clone)]
963    pub struct ConfigGrpcClient<T> {
964        inner: tonic::client::Grpc<T>,
965    }
966    impl ConfigGrpcClient<tonic::transport::Channel> {
967        /// Attempt to create a new client by connecting to a given endpoint.
968        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
969        where
970            D: TryInto<tonic::transport::Endpoint>,
971            D::Error: Into<StdError>,
972        {
973            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
974            Ok(Self::new(conn))
975        }
976    }
977    impl<T> ConfigGrpcClient<T>
978    where
979        T: tonic::client::GrpcService<tonic::body::Body>,
980        T::Error: Into<StdError>,
981        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
982        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
983    {
984        pub fn new(inner: T) -> Self {
985            let inner = tonic::client::Grpc::new(inner);
986            Self { inner }
987        }
988        pub fn with_origin(inner: T, origin: Uri) -> Self {
989            let inner = tonic::client::Grpc::with_origin(inner, origin);
990            Self { inner }
991        }
992        pub fn with_interceptor<F>(
993            inner: T,
994            interceptor: F,
995        ) -> ConfigGrpcClient<InterceptedService<T, F>>
996        where
997            F: tonic::service::Interceptor,
998            T::ResponseBody: Default,
999            T: tonic::codegen::Service<
1000                http::Request<tonic::body::Body>,
1001                Response = http::Response<
1002                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1003                >,
1004            >,
1005            <T as tonic::codegen::Service<
1006                http::Request<tonic::body::Body>,
1007            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1008        {
1009            ConfigGrpcClient::new(InterceptedService::new(inner, interceptor))
1010        }
1011        /// Compress requests with the given encoding.
1012        ///
1013        /// This requires the server to support it otherwise it might respond with an
1014        /// error.
1015        #[must_use]
1016        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1017            self.inner = self.inner.send_compressed(encoding);
1018            self
1019        }
1020        /// Enable decompressing responses.
1021        #[must_use]
1022        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1023            self.inner = self.inner.accept_compressed(encoding);
1024            self
1025        }
1026        /// Limits the maximum size of a decoded message.
1027        ///
1028        /// Default: `4MB`
1029        #[must_use]
1030        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1031            self.inner = self.inner.max_decoding_message_size(limit);
1032            self
1033        }
1034        /// Limits the maximum size of an encoded message.
1035        ///
1036        /// Default: `usize::MAX`
1037        #[must_use]
1038        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1039            self.inner = self.inner.max_encoding_message_size(limit);
1040            self
1041        }
1042        /// 创建配置
1043        pub async fn create_config_file(
1044            &mut self,
1045            request: impl tonic::IntoRequest<super::ConfigFile>,
1046        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
1047            self.inner
1048                .ready()
1049                .await
1050                .map_err(|e| {
1051                    tonic::Status::unknown(
1052                        format!("Service was not ready: {}", e.into()),
1053                    )
1054                })?;
1055            let codec = tonic_prost::ProstCodec::default();
1056            let path = http::uri::PathAndQuery::from_static(
1057                "/v1.ConfigGRPC/CreateConfigFile",
1058            );
1059            let mut req = request.into_request();
1060            req.extensions_mut()
1061                .insert(GrpcMethod::new("v1.ConfigGRPC", "CreateConfigFile"));
1062            self.inner.unary(req, path, codec).await
1063        }
1064        /// 更新配置
1065        pub async fn update_config_file(
1066            &mut self,
1067            request: impl tonic::IntoRequest<super::ConfigFile>,
1068        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
1069            self.inner
1070                .ready()
1071                .await
1072                .map_err(|e| {
1073                    tonic::Status::unknown(
1074                        format!("Service was not ready: {}", e.into()),
1075                    )
1076                })?;
1077            let codec = tonic_prost::ProstCodec::default();
1078            let path = http::uri::PathAndQuery::from_static(
1079                "/v1.ConfigGRPC/UpdateConfigFile",
1080            );
1081            let mut req = request.into_request();
1082            req.extensions_mut()
1083                .insert(GrpcMethod::new("v1.ConfigGRPC", "UpdateConfigFile"));
1084            self.inner.unary(req, path, codec).await
1085        }
1086        /// 发布配置
1087        pub async fn publish_config_file(
1088            &mut self,
1089            request: impl tonic::IntoRequest<super::ConfigFileRelease>,
1090        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
1091            self.inner
1092                .ready()
1093                .await
1094                .map_err(|e| {
1095                    tonic::Status::unknown(
1096                        format!("Service was not ready: {}", e.into()),
1097                    )
1098                })?;
1099            let codec = tonic_prost::ProstCodec::default();
1100            let path = http::uri::PathAndQuery::from_static(
1101                "/v1.ConfigGRPC/PublishConfigFile",
1102            );
1103            let mut req = request.into_request();
1104            req.extensions_mut()
1105                .insert(GrpcMethod::new("v1.ConfigGRPC", "PublishConfigFile"));
1106            self.inner.unary(req, path, codec).await
1107        }
1108        /// 统一发现接口
1109        pub async fn discover(
1110            &mut self,
1111            request: impl tonic::IntoStreamingRequest<
1112                Message = super::ConfigDiscoverRequest,
1113            >,
1114        ) -> std::result::Result<
1115            tonic::Response<tonic::codec::Streaming<super::ConfigDiscoverResponse>>,
1116            tonic::Status,
1117        > {
1118            self.inner
1119                .ready()
1120                .await
1121                .map_err(|e| {
1122                    tonic::Status::unknown(
1123                        format!("Service was not ready: {}", e.into()),
1124                    )
1125                })?;
1126            let codec = tonic_prost::ProstCodec::default();
1127            let path = http::uri::PathAndQuery::from_static("/v1.ConfigGRPC/Discover");
1128            let mut req = request.into_streaming_request();
1129            req.extensions_mut().insert(GrpcMethod::new("v1.ConfigGRPC", "Discover"));
1130            self.inner.streaming(req, path, codec).await
1131        }
1132    }
1133}
1134/// Generated server implementations.
1135pub mod config_grpc_server {
1136    #![allow(
1137        unused_variables,
1138        dead_code,
1139        missing_docs,
1140        clippy::wildcard_imports,
1141        clippy::let_unit_value,
1142    )]
1143    use tonic::codegen::*;
1144    /// Generated trait containing gRPC methods that should be implemented for use with ConfigGrpcServer.
1145    #[async_trait]
1146    pub trait ConfigGrpc: std::marker::Send + std::marker::Sync + 'static {
1147        /// 创建配置
1148        async fn create_config_file(
1149            &self,
1150            request: tonic::Request<super::ConfigFile>,
1151        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
1152        /// 更新配置
1153        async fn update_config_file(
1154            &self,
1155            request: tonic::Request<super::ConfigFile>,
1156        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
1157        /// 发布配置
1158        async fn publish_config_file(
1159            &self,
1160            request: tonic::Request<super::ConfigFileRelease>,
1161        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
1162        /// Server streaming response type for the Discover method.
1163        type DiscoverStream: tonic::codegen::tokio_stream::Stream<
1164                Item = std::result::Result<super::ConfigDiscoverResponse, tonic::Status>,
1165            >
1166            + std::marker::Send
1167            + 'static;
1168        /// 统一发现接口
1169        async fn discover(
1170            &self,
1171            request: tonic::Request<tonic::Streaming<super::ConfigDiscoverRequest>>,
1172        ) -> std::result::Result<tonic::Response<Self::DiscoverStream>, tonic::Status>;
1173    }
1174    #[derive(Debug)]
1175    pub struct ConfigGrpcServer<T> {
1176        inner: Arc<T>,
1177        accept_compression_encodings: EnabledCompressionEncodings,
1178        send_compression_encodings: EnabledCompressionEncodings,
1179        max_decoding_message_size: Option<usize>,
1180        max_encoding_message_size: Option<usize>,
1181    }
1182    impl<T> ConfigGrpcServer<T> {
1183        pub fn new(inner: T) -> Self {
1184            Self::from_arc(Arc::new(inner))
1185        }
1186        pub fn from_arc(inner: Arc<T>) -> Self {
1187            Self {
1188                inner,
1189                accept_compression_encodings: Default::default(),
1190                send_compression_encodings: Default::default(),
1191                max_decoding_message_size: None,
1192                max_encoding_message_size: None,
1193            }
1194        }
1195        pub fn with_interceptor<F>(
1196            inner: T,
1197            interceptor: F,
1198        ) -> InterceptedService<Self, F>
1199        where
1200            F: tonic::service::Interceptor,
1201        {
1202            InterceptedService::new(Self::new(inner), interceptor)
1203        }
1204        /// Enable decompressing requests with the given encoding.
1205        #[must_use]
1206        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1207            self.accept_compression_encodings.enable(encoding);
1208            self
1209        }
1210        /// Compress responses with the given encoding, if the client supports it.
1211        #[must_use]
1212        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1213            self.send_compression_encodings.enable(encoding);
1214            self
1215        }
1216        /// Limits the maximum size of a decoded message.
1217        ///
1218        /// Default: `4MB`
1219        #[must_use]
1220        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1221            self.max_decoding_message_size = Some(limit);
1222            self
1223        }
1224        /// Limits the maximum size of an encoded message.
1225        ///
1226        /// Default: `usize::MAX`
1227        #[must_use]
1228        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1229            self.max_encoding_message_size = Some(limit);
1230            self
1231        }
1232    }
1233    impl<T, B> tonic::codegen::Service<http::Request<B>> for ConfigGrpcServer<T>
1234    where
1235        T: ConfigGrpc,
1236        B: Body + std::marker::Send + 'static,
1237        B::Error: Into<StdError> + std::marker::Send + 'static,
1238    {
1239        type Response = http::Response<tonic::body::Body>;
1240        type Error = std::convert::Infallible;
1241        type Future = BoxFuture<Self::Response, Self::Error>;
1242        fn poll_ready(
1243            &mut self,
1244            _cx: &mut Context<'_>,
1245        ) -> Poll<std::result::Result<(), Self::Error>> {
1246            Poll::Ready(Ok(()))
1247        }
1248        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1249            match req.uri().path() {
1250                "/v1.ConfigGRPC/CreateConfigFile" => {
1251                    #[allow(non_camel_case_types)]
1252                    struct CreateConfigFileSvc<T: ConfigGrpc>(pub Arc<T>);
1253                    impl<T: ConfigGrpc> tonic::server::UnaryService<super::ConfigFile>
1254                    for CreateConfigFileSvc<T> {
1255                        type Response = super::Response;
1256                        type Future = BoxFuture<
1257                            tonic::Response<Self::Response>,
1258                            tonic::Status,
1259                        >;
1260                        fn call(
1261                            &mut self,
1262                            request: tonic::Request<super::ConfigFile>,
1263                        ) -> Self::Future {
1264                            let inner = Arc::clone(&self.0);
1265                            let fut = async move {
1266                                <T as ConfigGrpc>::create_config_file(&inner, request).await
1267                            };
1268                            Box::pin(fut)
1269                        }
1270                    }
1271                    let accept_compression_encodings = self.accept_compression_encodings;
1272                    let send_compression_encodings = self.send_compression_encodings;
1273                    let max_decoding_message_size = self.max_decoding_message_size;
1274                    let max_encoding_message_size = self.max_encoding_message_size;
1275                    let inner = self.inner.clone();
1276                    let fut = async move {
1277                        let method = CreateConfigFileSvc(inner);
1278                        let codec = tonic_prost::ProstCodec::default();
1279                        let mut grpc = tonic::server::Grpc::new(codec)
1280                            .apply_compression_config(
1281                                accept_compression_encodings,
1282                                send_compression_encodings,
1283                            )
1284                            .apply_max_message_size_config(
1285                                max_decoding_message_size,
1286                                max_encoding_message_size,
1287                            );
1288                        let res = grpc.unary(method, req).await;
1289                        Ok(res)
1290                    };
1291                    Box::pin(fut)
1292                }
1293                "/v1.ConfigGRPC/UpdateConfigFile" => {
1294                    #[allow(non_camel_case_types)]
1295                    struct UpdateConfigFileSvc<T: ConfigGrpc>(pub Arc<T>);
1296                    impl<T: ConfigGrpc> tonic::server::UnaryService<super::ConfigFile>
1297                    for UpdateConfigFileSvc<T> {
1298                        type Response = super::Response;
1299                        type Future = BoxFuture<
1300                            tonic::Response<Self::Response>,
1301                            tonic::Status,
1302                        >;
1303                        fn call(
1304                            &mut self,
1305                            request: tonic::Request<super::ConfigFile>,
1306                        ) -> Self::Future {
1307                            let inner = Arc::clone(&self.0);
1308                            let fut = async move {
1309                                <T as ConfigGrpc>::update_config_file(&inner, request).await
1310                            };
1311                            Box::pin(fut)
1312                        }
1313                    }
1314                    let accept_compression_encodings = self.accept_compression_encodings;
1315                    let send_compression_encodings = self.send_compression_encodings;
1316                    let max_decoding_message_size = self.max_decoding_message_size;
1317                    let max_encoding_message_size = self.max_encoding_message_size;
1318                    let inner = self.inner.clone();
1319                    let fut = async move {
1320                        let method = UpdateConfigFileSvc(inner);
1321                        let codec = tonic_prost::ProstCodec::default();
1322                        let mut grpc = tonic::server::Grpc::new(codec)
1323                            .apply_compression_config(
1324                                accept_compression_encodings,
1325                                send_compression_encodings,
1326                            )
1327                            .apply_max_message_size_config(
1328                                max_decoding_message_size,
1329                                max_encoding_message_size,
1330                            );
1331                        let res = grpc.unary(method, req).await;
1332                        Ok(res)
1333                    };
1334                    Box::pin(fut)
1335                }
1336                "/v1.ConfigGRPC/PublishConfigFile" => {
1337                    #[allow(non_camel_case_types)]
1338                    struct PublishConfigFileSvc<T: ConfigGrpc>(pub Arc<T>);
1339                    impl<
1340                        T: ConfigGrpc,
1341                    > tonic::server::UnaryService<super::ConfigFileRelease>
1342                    for PublishConfigFileSvc<T> {
1343                        type Response = super::Response;
1344                        type Future = BoxFuture<
1345                            tonic::Response<Self::Response>,
1346                            tonic::Status,
1347                        >;
1348                        fn call(
1349                            &mut self,
1350                            request: tonic::Request<super::ConfigFileRelease>,
1351                        ) -> Self::Future {
1352                            let inner = Arc::clone(&self.0);
1353                            let fut = async move {
1354                                <T as ConfigGrpc>::publish_config_file(&inner, request)
1355                                    .await
1356                            };
1357                            Box::pin(fut)
1358                        }
1359                    }
1360                    let accept_compression_encodings = self.accept_compression_encodings;
1361                    let send_compression_encodings = self.send_compression_encodings;
1362                    let max_decoding_message_size = self.max_decoding_message_size;
1363                    let max_encoding_message_size = self.max_encoding_message_size;
1364                    let inner = self.inner.clone();
1365                    let fut = async move {
1366                        let method = PublishConfigFileSvc(inner);
1367                        let codec = tonic_prost::ProstCodec::default();
1368                        let mut grpc = tonic::server::Grpc::new(codec)
1369                            .apply_compression_config(
1370                                accept_compression_encodings,
1371                                send_compression_encodings,
1372                            )
1373                            .apply_max_message_size_config(
1374                                max_decoding_message_size,
1375                                max_encoding_message_size,
1376                            );
1377                        let res = grpc.unary(method, req).await;
1378                        Ok(res)
1379                    };
1380                    Box::pin(fut)
1381                }
1382                "/v1.ConfigGRPC/Discover" => {
1383                    #[allow(non_camel_case_types)]
1384                    struct DiscoverSvc<T: ConfigGrpc>(pub Arc<T>);
1385                    impl<
1386                        T: ConfigGrpc,
1387                    > tonic::server::StreamingService<super::ConfigDiscoverRequest>
1388                    for DiscoverSvc<T> {
1389                        type Response = super::ConfigDiscoverResponse;
1390                        type ResponseStream = T::DiscoverStream;
1391                        type Future = BoxFuture<
1392                            tonic::Response<Self::ResponseStream>,
1393                            tonic::Status,
1394                        >;
1395                        fn call(
1396                            &mut self,
1397                            request: tonic::Request<
1398                                tonic::Streaming<super::ConfigDiscoverRequest>,
1399                            >,
1400                        ) -> Self::Future {
1401                            let inner = Arc::clone(&self.0);
1402                            let fut = async move {
1403                                <T as ConfigGrpc>::discover(&inner, request).await
1404                            };
1405                            Box::pin(fut)
1406                        }
1407                    }
1408                    let accept_compression_encodings = self.accept_compression_encodings;
1409                    let send_compression_encodings = self.send_compression_encodings;
1410                    let max_decoding_message_size = self.max_decoding_message_size;
1411                    let max_encoding_message_size = self.max_encoding_message_size;
1412                    let inner = self.inner.clone();
1413                    let fut = async move {
1414                        let method = DiscoverSvc(inner);
1415                        let codec = tonic_prost::ProstCodec::default();
1416                        let mut grpc = tonic::server::Grpc::new(codec)
1417                            .apply_compression_config(
1418                                accept_compression_encodings,
1419                                send_compression_encodings,
1420                            )
1421                            .apply_max_message_size_config(
1422                                max_decoding_message_size,
1423                                max_encoding_message_size,
1424                            );
1425                        let res = grpc.streaming(method, req).await;
1426                        Ok(res)
1427                    };
1428                    Box::pin(fut)
1429                }
1430                _ => {
1431                    Box::pin(async move {
1432                        let mut response = http::Response::new(
1433                            tonic::body::Body::default(),
1434                        );
1435                        let headers = response.headers_mut();
1436                        headers
1437                            .insert(
1438                                tonic::Status::GRPC_STATUS,
1439                                (tonic::Code::Unimplemented as i32).into(),
1440                            );
1441                        headers
1442                            .insert(
1443                                http::header::CONTENT_TYPE,
1444                                tonic::metadata::GRPC_CONTENT_TYPE,
1445                            );
1446                        Ok(response)
1447                    })
1448                }
1449            }
1450        }
1451    }
1452    impl<T> Clone for ConfigGrpcServer<T> {
1453        fn clone(&self) -> Self {
1454            let inner = self.inner.clone();
1455            Self {
1456                inner,
1457                accept_compression_encodings: self.accept_compression_encodings,
1458                send_compression_encodings: self.send_compression_encodings,
1459                max_decoding_message_size: self.max_decoding_message_size,
1460                max_encoding_message_size: self.max_encoding_message_size,
1461            }
1462        }
1463    }
1464    /// Generated gRPC service name
1465    pub const SERVICE_NAME: &str = "v1.ConfigGRPC";
1466    impl<T> tonic::server::NamedService for ConfigGrpcServer<T> {
1467        const NAME: &'static str = SERVICE_NAME;
1468    }
1469}
1470#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1471#[repr(i32)]
1472pub enum Code {
1473    /// base module status codes
1474    Unknown = 0,
1475    ExecuteSuccess = 200000,
1476    DataNoChange = 200001,
1477    NoNeedUpdate = 200002,
1478    BadRequest = 400000,
1479    ParseException = 400001,
1480    EmptyRequest = 400002,
1481    BatchSizeOverLimit = 400003,
1482    InvalidDiscoverResource = 400004,
1483    InvalidRequestId = 400100,
1484    InvalidUserName = 400101,
1485    InvalidUserToken = 400102,
1486    InvalidParameter = 400103,
1487    EmptyQueryParameter = 400104,
1488    InvalidQueryInsParameter = 400105,
1489    HealthCheckNotOpen = 400140,
1490    HeartbeatOnDisabledIns = 400141,
1491    HeartbeatExceedLimit = 400142,
1492    HeartbeatTypeNotFound = 400143,
1493    InvalidMetadata = 400150,
1494    InvalidMatchRule = 400904,
1495    /// network relative codes
1496    ServicesExistedMesh = 400170,
1497    ResourcesExistedMesh = 400171,
1498    InvalidMeshParameter = 400172,
1499    ExistedResource = 400201,
1500    NamespaceExistedServices = 400203,
1501    ServiceExistedInstances = 400204,
1502    ServiceExistedRoutings = 400205,
1503    ServiceExistedRateLimits = 400206,
1504    ExistReleasedConfig = 400207,
1505    SameInstanceRequest = 400208,
1506    ServiceExistedCircuitBreakers = 400209,
1507    ServiceExistedAlias = 400210,
1508    NamespaceExistedMeshResources = 400211,
1509    NamespaceExistedCircuitBreakers = 400212,
1510    ServiceSubscribedByMeshes = 400213,
1511    ServiceExistedFluxRateLimits = 400214,
1512    NamespaceExistedConfigGroups = 400219,
1513    ClientApiNotOpen = 400401,
1514    NotFoundResource = 404202,
1515    Unauthorized = 401000,
1516    NotAllowedAccess = 401001,
1517    CmdbNotFindHost = 404001,
1518    DataConflict = 409000,
1519    InstanceTooManyRequests = 429001,
1520    IpRateLimit = 429002,
1521    ApiRateLimit = 403003,
1522    ExecuteException = 500000,
1523    StoreLayerException = 500001,
1524    CmdbPluginException = 500002,
1525    HeartbeatException = 500007,
1526    InstanceRegisTimeout = 500008,
1527    /// config center status codes
1528    EncryptConfigFileException = 400809,
1529    GroupExistActiveRelease = 400810,
1530    DecryptConfigFileException = 400811,
1531    /// auth codes
1532    InvalidUserOwners = 400410,
1533    InvalidUserId = 400411,
1534    InvalidUserPassword = 400412,
1535    InvalidUserGroupOwners = 400420,
1536    InvalidUserGroupId = 400421,
1537    InvalidAuthStrategyOwners = 400430,
1538    InvalidAuthStrategyName = 400431,
1539    InvalidAuthStrategyId = 400432,
1540    InvalidPrincipalType = 400440,
1541    UserExisted = 400215,
1542    UserGroupExisted = 400216,
1543    AuthStrategyRuleExisted = 400217,
1544    SubAccountExisted = 400218,
1545    NotFoundUser = 400312,
1546    NotFoundOwnerUser = 400313,
1547    NotFoundUserGroup = 400314,
1548    NotFoundAuthStrategyRule = 400315,
1549    NotAllowModifyDefaultStrategyPrincipal = 400508,
1550    NotAllowModifyOwnerDefaultStrategy = 400509,
1551    EmptyAutToken = 401002,
1552    TokenDisabled = 401003,
1553    TokenNotExisted = 401004,
1554    AuthTokenForbidden = 403001,
1555    OperationRoleForbidden = 403002,
1556}
1557impl Code {
1558    /// String value of the enum field names used in the ProtoBuf definition.
1559    ///
1560    /// The values are not transformed in any way and thus are considered stable
1561    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1562    pub fn as_str_name(&self) -> &'static str {
1563        match self {
1564            Self::Unknown => "Unknown",
1565            Self::ExecuteSuccess => "ExecuteSuccess",
1566            Self::DataNoChange => "DataNoChange",
1567            Self::NoNeedUpdate => "NoNeedUpdate",
1568            Self::BadRequest => "BadRequest",
1569            Self::ParseException => "ParseException",
1570            Self::EmptyRequest => "EmptyRequest",
1571            Self::BatchSizeOverLimit => "BatchSizeOverLimit",
1572            Self::InvalidDiscoverResource => "InvalidDiscoverResource",
1573            Self::InvalidRequestId => "InvalidRequestID",
1574            Self::InvalidUserName => "InvalidUserName",
1575            Self::InvalidUserToken => "InvalidUserToken",
1576            Self::InvalidParameter => "InvalidParameter",
1577            Self::EmptyQueryParameter => "EmptyQueryParameter",
1578            Self::InvalidQueryInsParameter => "InvalidQueryInsParameter",
1579            Self::HealthCheckNotOpen => "HealthCheckNotOpen",
1580            Self::HeartbeatOnDisabledIns => "HeartbeatOnDisabledIns",
1581            Self::HeartbeatExceedLimit => "HeartbeatExceedLimit",
1582            Self::HeartbeatTypeNotFound => "HeartbeatTypeNotFound",
1583            Self::InvalidMetadata => "InvalidMetadata",
1584            Self::InvalidMatchRule => "InvalidMatchRule",
1585            Self::ServicesExistedMesh => "ServicesExistedMesh",
1586            Self::ResourcesExistedMesh => "ResourcesExistedMesh",
1587            Self::InvalidMeshParameter => "InvalidMeshParameter",
1588            Self::ExistedResource => "ExistedResource",
1589            Self::NamespaceExistedServices => "NamespaceExistedServices",
1590            Self::ServiceExistedInstances => "ServiceExistedInstances",
1591            Self::ServiceExistedRoutings => "ServiceExistedRoutings",
1592            Self::ServiceExistedRateLimits => "ServiceExistedRateLimits",
1593            Self::ExistReleasedConfig => "ExistReleasedConfig",
1594            Self::SameInstanceRequest => "SameInstanceRequest",
1595            Self::ServiceExistedCircuitBreakers => "ServiceExistedCircuitBreakers",
1596            Self::ServiceExistedAlias => "ServiceExistedAlias",
1597            Self::NamespaceExistedMeshResources => "NamespaceExistedMeshResources",
1598            Self::NamespaceExistedCircuitBreakers => "NamespaceExistedCircuitBreakers",
1599            Self::ServiceSubscribedByMeshes => "ServiceSubscribedByMeshes",
1600            Self::ServiceExistedFluxRateLimits => "ServiceExistedFluxRateLimits",
1601            Self::NamespaceExistedConfigGroups => "NamespaceExistedConfigGroups",
1602            Self::ClientApiNotOpen => "ClientAPINotOpen",
1603            Self::NotFoundResource => "NotFoundResource",
1604            Self::Unauthorized => "Unauthorized",
1605            Self::NotAllowedAccess => "NotAllowedAccess",
1606            Self::CmdbNotFindHost => "CMDBNotFindHost",
1607            Self::DataConflict => "DataConflict",
1608            Self::InstanceTooManyRequests => "InstanceTooManyRequests",
1609            Self::IpRateLimit => "IPRateLimit",
1610            Self::ApiRateLimit => "APIRateLimit",
1611            Self::ExecuteException => "ExecuteException",
1612            Self::StoreLayerException => "StoreLayerException",
1613            Self::CmdbPluginException => "CMDBPluginException",
1614            Self::HeartbeatException => "HeartbeatException",
1615            Self::InstanceRegisTimeout => "InstanceRegisTimeout",
1616            Self::EncryptConfigFileException => "EncryptConfigFileException",
1617            Self::GroupExistActiveRelease => "GroupExistActiveRelease",
1618            Self::DecryptConfigFileException => "DecryptConfigFileException",
1619            Self::InvalidUserOwners => "InvalidUserOwners",
1620            Self::InvalidUserId => "InvalidUserID",
1621            Self::InvalidUserPassword => "InvalidUserPassword",
1622            Self::InvalidUserGroupOwners => "InvalidUserGroupOwners",
1623            Self::InvalidUserGroupId => "InvalidUserGroupID",
1624            Self::InvalidAuthStrategyOwners => "InvalidAuthStrategyOwners",
1625            Self::InvalidAuthStrategyName => "InvalidAuthStrategyName",
1626            Self::InvalidAuthStrategyId => "InvalidAuthStrategyID",
1627            Self::InvalidPrincipalType => "InvalidPrincipalType",
1628            Self::UserExisted => "UserExisted",
1629            Self::UserGroupExisted => "UserGroupExisted",
1630            Self::AuthStrategyRuleExisted => "AuthStrategyRuleExisted",
1631            Self::SubAccountExisted => "SubAccountExisted",
1632            Self::NotFoundUser => "NotFoundUser",
1633            Self::NotFoundOwnerUser => "NotFoundOwnerUser",
1634            Self::NotFoundUserGroup => "NotFoundUserGroup",
1635            Self::NotFoundAuthStrategyRule => "NotFoundAuthStrategyRule",
1636            Self::NotAllowModifyDefaultStrategyPrincipal => {
1637                "NotAllowModifyDefaultStrategyPrincipal"
1638            }
1639            Self::NotAllowModifyOwnerDefaultStrategy => {
1640                "NotAllowModifyOwnerDefaultStrategy"
1641            }
1642            Self::EmptyAutToken => "EmptyAutToken",
1643            Self::TokenDisabled => "TokenDisabled",
1644            Self::TokenNotExisted => "TokenNotExisted",
1645            Self::AuthTokenForbidden => "AuthTokenForbidden",
1646            Self::OperationRoleForbidden => "OperationRoleForbidden",
1647        }
1648    }
1649    /// Creates an enum from field names used in the ProtoBuf definition.
1650    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1651        match value {
1652            "Unknown" => Some(Self::Unknown),
1653            "ExecuteSuccess" => Some(Self::ExecuteSuccess),
1654            "DataNoChange" => Some(Self::DataNoChange),
1655            "NoNeedUpdate" => Some(Self::NoNeedUpdate),
1656            "BadRequest" => Some(Self::BadRequest),
1657            "ParseException" => Some(Self::ParseException),
1658            "EmptyRequest" => Some(Self::EmptyRequest),
1659            "BatchSizeOverLimit" => Some(Self::BatchSizeOverLimit),
1660            "InvalidDiscoverResource" => Some(Self::InvalidDiscoverResource),
1661            "InvalidRequestID" => Some(Self::InvalidRequestId),
1662            "InvalidUserName" => Some(Self::InvalidUserName),
1663            "InvalidUserToken" => Some(Self::InvalidUserToken),
1664            "InvalidParameter" => Some(Self::InvalidParameter),
1665            "EmptyQueryParameter" => Some(Self::EmptyQueryParameter),
1666            "InvalidQueryInsParameter" => Some(Self::InvalidQueryInsParameter),
1667            "HealthCheckNotOpen" => Some(Self::HealthCheckNotOpen),
1668            "HeartbeatOnDisabledIns" => Some(Self::HeartbeatOnDisabledIns),
1669            "HeartbeatExceedLimit" => Some(Self::HeartbeatExceedLimit),
1670            "HeartbeatTypeNotFound" => Some(Self::HeartbeatTypeNotFound),
1671            "InvalidMetadata" => Some(Self::InvalidMetadata),
1672            "InvalidMatchRule" => Some(Self::InvalidMatchRule),
1673            "ServicesExistedMesh" => Some(Self::ServicesExistedMesh),
1674            "ResourcesExistedMesh" => Some(Self::ResourcesExistedMesh),
1675            "InvalidMeshParameter" => Some(Self::InvalidMeshParameter),
1676            "ExistedResource" => Some(Self::ExistedResource),
1677            "NamespaceExistedServices" => Some(Self::NamespaceExistedServices),
1678            "ServiceExistedInstances" => Some(Self::ServiceExistedInstances),
1679            "ServiceExistedRoutings" => Some(Self::ServiceExistedRoutings),
1680            "ServiceExistedRateLimits" => Some(Self::ServiceExistedRateLimits),
1681            "ExistReleasedConfig" => Some(Self::ExistReleasedConfig),
1682            "SameInstanceRequest" => Some(Self::SameInstanceRequest),
1683            "ServiceExistedCircuitBreakers" => Some(Self::ServiceExistedCircuitBreakers),
1684            "ServiceExistedAlias" => Some(Self::ServiceExistedAlias),
1685            "NamespaceExistedMeshResources" => Some(Self::NamespaceExistedMeshResources),
1686            "NamespaceExistedCircuitBreakers" => {
1687                Some(Self::NamespaceExistedCircuitBreakers)
1688            }
1689            "ServiceSubscribedByMeshes" => Some(Self::ServiceSubscribedByMeshes),
1690            "ServiceExistedFluxRateLimits" => Some(Self::ServiceExistedFluxRateLimits),
1691            "NamespaceExistedConfigGroups" => Some(Self::NamespaceExistedConfigGroups),
1692            "ClientAPINotOpen" => Some(Self::ClientApiNotOpen),
1693            "NotFoundResource" => Some(Self::NotFoundResource),
1694            "Unauthorized" => Some(Self::Unauthorized),
1695            "NotAllowedAccess" => Some(Self::NotAllowedAccess),
1696            "CMDBNotFindHost" => Some(Self::CmdbNotFindHost),
1697            "DataConflict" => Some(Self::DataConflict),
1698            "InstanceTooManyRequests" => Some(Self::InstanceTooManyRequests),
1699            "IPRateLimit" => Some(Self::IpRateLimit),
1700            "APIRateLimit" => Some(Self::ApiRateLimit),
1701            "ExecuteException" => Some(Self::ExecuteException),
1702            "StoreLayerException" => Some(Self::StoreLayerException),
1703            "CMDBPluginException" => Some(Self::CmdbPluginException),
1704            "HeartbeatException" => Some(Self::HeartbeatException),
1705            "InstanceRegisTimeout" => Some(Self::InstanceRegisTimeout),
1706            "EncryptConfigFileException" => Some(Self::EncryptConfigFileException),
1707            "GroupExistActiveRelease" => Some(Self::GroupExistActiveRelease),
1708            "DecryptConfigFileException" => Some(Self::DecryptConfigFileException),
1709            "InvalidUserOwners" => Some(Self::InvalidUserOwners),
1710            "InvalidUserID" => Some(Self::InvalidUserId),
1711            "InvalidUserPassword" => Some(Self::InvalidUserPassword),
1712            "InvalidUserGroupOwners" => Some(Self::InvalidUserGroupOwners),
1713            "InvalidUserGroupID" => Some(Self::InvalidUserGroupId),
1714            "InvalidAuthStrategyOwners" => Some(Self::InvalidAuthStrategyOwners),
1715            "InvalidAuthStrategyName" => Some(Self::InvalidAuthStrategyName),
1716            "InvalidAuthStrategyID" => Some(Self::InvalidAuthStrategyId),
1717            "InvalidPrincipalType" => Some(Self::InvalidPrincipalType),
1718            "UserExisted" => Some(Self::UserExisted),
1719            "UserGroupExisted" => Some(Self::UserGroupExisted),
1720            "AuthStrategyRuleExisted" => Some(Self::AuthStrategyRuleExisted),
1721            "SubAccountExisted" => Some(Self::SubAccountExisted),
1722            "NotFoundUser" => Some(Self::NotFoundUser),
1723            "NotFoundOwnerUser" => Some(Self::NotFoundOwnerUser),
1724            "NotFoundUserGroup" => Some(Self::NotFoundUserGroup),
1725            "NotFoundAuthStrategyRule" => Some(Self::NotFoundAuthStrategyRule),
1726            "NotAllowModifyDefaultStrategyPrincipal" => {
1727                Some(Self::NotAllowModifyDefaultStrategyPrincipal)
1728            }
1729            "NotAllowModifyOwnerDefaultStrategy" => {
1730                Some(Self::NotAllowModifyOwnerDefaultStrategy)
1731            }
1732            "EmptyAutToken" => Some(Self::EmptyAutToken),
1733            "TokenDisabled" => Some(Self::TokenDisabled),
1734            "TokenNotExisted" => Some(Self::TokenNotExisted),
1735            "AuthTokenForbidden" => Some(Self::AuthTokenForbidden),
1736            "OperationRoleForbidden" => Some(Self::OperationRoleForbidden),
1737            _ => None,
1738        }
1739    }
1740}
1741/// 同一服务下限流规则集合
1742#[derive(Clone, PartialEq, ::prost::Message)]
1743pub struct RateLimit {
1744    /// 限流规则唯一标识
1745    #[prost(string, tag = "1")]
1746    pub id: ::prost::alloc::string::String,
1747    /// 限流规则名称
1748    #[prost(string, tag = "2")]
1749    pub name: ::prost::alloc::string::String,
1750    /// 限流规则所属服务名
1751    #[prost(string, tag = "3")]
1752    pub service: ::prost::alloc::string::String,
1753    /// 限流规则所属命名空间
1754    #[prost(string, tag = "4")]
1755    pub namespace: ::prost::alloc::string::String,
1756    /// 限流规则优先级,0值最高
1757    #[prost(uint32, tag = "5")]
1758    pub priority: u32,
1759    #[prost(enumeration = "rate_limit::Type", tag = "7")]
1760    pub r#type: i32,
1761    /// 限流规则集合
1762    #[prost(message, repeated, tag = "8")]
1763    pub rules: ::prost::alloc::vec::Vec<LimitTrigger>,
1764    /// 限流规则汇总的revision信息
1765    #[prost(string, tag = "9")]
1766    pub revision: ::prost::alloc::string::String,
1767    /// 是否停用该限流规则,默认启用
1768    #[prost(bool, tag = "11")]
1769    pub disable: bool,
1770    /// 限流上报方式,同时支持按固定周期上报,以及达到配额百分比后上报
1771    #[prost(message, optional, tag = "12")]
1772    pub report: ::core::option::Option<Report>,
1773    /// 分布式限流服务集群
1774    #[prost(message, optional, tag = "16")]
1775    pub cluster: ::core::option::Option<RateLimitCluster>,
1776    /// 限流规则创建时间
1777    #[prost(string, tag = "20")]
1778    pub ctime: ::prost::alloc::string::String,
1779    /// 限流规则修改时间
1780    #[prost(string, tag = "21")]
1781    pub mtime: ::prost::alloc::string::String,
1782    /// 限流规则标签数据
1783    #[prost(map = "string, string", tag = "22")]
1784    pub metadata: ::std::collections::HashMap<
1785        ::prost::alloc::string::String,
1786        ::prost::alloc::string::String,
1787    >,
1788    /// 操作标志位
1789    #[prost(bool, tag = "30")]
1790    pub editable: bool,
1791    #[prost(bool, tag = "31")]
1792    pub deleteable: bool,
1793}
1794/// Nested message and enum types in `RateLimit`.
1795pub mod rate_limit {
1796    /// 限流类型
1797    /// global全局限流(默认)或者local单机限流
1798    #[derive(
1799        Clone,
1800        Copy,
1801        Debug,
1802        PartialEq,
1803        Eq,
1804        Hash,
1805        PartialOrd,
1806        Ord,
1807        ::prost::Enumeration
1808    )]
1809    #[repr(i32)]
1810    pub enum Type {
1811        Global = 0,
1812        Local = 1,
1813    }
1814    impl Type {
1815        /// String value of the enum field names used in the ProtoBuf definition.
1816        ///
1817        /// The values are not transformed in any way and thus are considered stable
1818        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1819        pub fn as_str_name(&self) -> &'static str {
1820            match self {
1821                Self::Global => "GLOBAL",
1822                Self::Local => "LOCAL",
1823            }
1824        }
1825        /// Creates an enum from field names used in the ProtoBuf definition.
1826        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1827            match value {
1828                "GLOBAL" => Some(Self::Global),
1829                "LOCAL" => Some(Self::Local),
1830                _ => None,
1831            }
1832        }
1833    }
1834}
1835/// 单个限流规则信息
1836#[derive(Clone, PartialEq, ::prost::Message)]
1837pub struct LimitTrigger {
1838    /// 限流规则名
1839    #[prost(string, tag = "1")]
1840    pub name: ::prost::alloc::string::String,
1841    /// 被调接口名
1842    #[prost(message, optional, tag = "2")]
1843    pub method: ::core::option::Option<MatchString>,
1844    #[prost(enumeration = "limit_trigger::Resource", tag = "3")]
1845    pub resource: i32,
1846    /// 被调的参数过滤条件,满足过滤条件才进入限流规则
1847    #[prost(message, repeated, tag = "4")]
1848    pub arguments: ::prost::alloc::vec::Vec<MatchArgument>,
1849    /// 限流阈值
1850    /// 可以有多个粒度的配置(比如同时针对秒级,分钟级,天级),匹配一个则进行限流
1851    /// 全局限流模式下,该值为服务配额总量;单机限流模式下,该值为单个节点能处理的配额量
1852    #[prost(message, repeated, tag = "5")]
1853    pub amounts: ::prost::alloc::vec::Vec<Amount>,
1854    /// 最大排队时长,单位秒
1855    #[prost(uint32, tag = "6")]
1856    pub max_queue_delay: u32,
1857    /// amount for concurrency rate-limit
1858    #[prost(message, optional, tag = "7")]
1859    pub concurrency_amount: ::core::option::Option<ConcurrencyAmount>,
1860    /// fallback configuration
1861    #[prost(message, optional, tag = "8")]
1862    pub custom_response: ::core::option::Option<CustomResponse>,
1863    /// 通配符是否合并计算,默认分开计数
1864    #[prost(bool, tag = "9")]
1865    pub regex_combine: bool,
1866    #[prost(enumeration = "limit_trigger::FailoverType", tag = "10")]
1867    pub failover: i32,
1868    /// 限流动作,和 resource 配合决定插件名称
1869    #[prost(string, tag = "11")]
1870    pub action: ::prost::alloc::string::String,
1871    /// 是否停用该限流规则,默认启用
1872    #[prost(bool, tag = "12")]
1873    pub disable: bool,
1874    #[prost(enumeration = "limit_trigger::AmountMode", tag = "14")]
1875    pub amount_mode: i32,
1876}
1877/// Nested message and enum types in `LimitTrigger`.
1878pub mod limit_trigger {
1879    /// 限流资源
1880    #[derive(
1881        Clone,
1882        Copy,
1883        Debug,
1884        PartialEq,
1885        Eq,
1886        Hash,
1887        PartialOrd,
1888        Ord,
1889        ::prost::Enumeration
1890    )]
1891    #[repr(i32)]
1892    pub enum Resource {
1893        /// 针对QPS进行限流
1894        Qps = 0,
1895        /// 针对并发数进行限流
1896        Concurrency = 1,
1897        /// 针对系统资源进行限流
1898        System = 2,
1899    }
1900    impl Resource {
1901        /// String value of the enum field names used in the ProtoBuf definition.
1902        ///
1903        /// The values are not transformed in any way and thus are considered stable
1904        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1905        pub fn as_str_name(&self) -> &'static str {
1906            match self {
1907                Self::Qps => "QPS",
1908                Self::Concurrency => "CONCURRENCY",
1909                Self::System => "SYSTEM",
1910            }
1911        }
1912        /// Creates an enum from field names used in the ProtoBuf definition.
1913        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1914            match value {
1915                "QPS" => Some(Self::Qps),
1916                "CONCURRENCY" => Some(Self::Concurrency),
1917                "SYSTEM" => Some(Self::System),
1918                _ => None,
1919            }
1920        }
1921    }
1922    /// 与限流集群连接失败时降级模式
1923    #[derive(
1924        Clone,
1925        Copy,
1926        Debug,
1927        PartialEq,
1928        Eq,
1929        Hash,
1930        PartialOrd,
1931        Ord,
1932        ::prost::Enumeration
1933    )]
1934    #[repr(i32)]
1935    pub enum FailoverType {
1936        /// 降级成本地阈值
1937        FailoverLocal = 0,
1938        /// 降级成直接通过
1939        FailoverPass = 1,
1940    }
1941    impl FailoverType {
1942        /// String value of the enum field names used in the ProtoBuf definition.
1943        ///
1944        /// The values are not transformed in any way and thus are considered stable
1945        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1946        pub fn as_str_name(&self) -> &'static str {
1947            match self {
1948                Self::FailoverLocal => "FAILOVER_LOCAL",
1949                Self::FailoverPass => "FAILOVER_PASS",
1950            }
1951        }
1952        /// Creates an enum from field names used in the ProtoBuf definition.
1953        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1954            match value {
1955                "FAILOVER_LOCAL" => Some(Self::FailoverLocal),
1956                "FAILOVER_PASS" => Some(Self::FailoverPass),
1957                _ => None,
1958            }
1959        }
1960    }
1961    /// 限流阈值模
1962    #[derive(
1963        Clone,
1964        Copy,
1965        Debug,
1966        PartialEq,
1967        Eq,
1968        Hash,
1969        PartialOrd,
1970        Ord,
1971        ::prost::Enumeration
1972    )]
1973    #[repr(i32)]
1974    pub enum AmountMode {
1975        /// 总体阈值
1976        GlobalTotal = 0,
1977        /// 单机均摊阈值
1978        ShareEqually = 1,
1979    }
1980    impl AmountMode {
1981        /// String value of the enum field names used in the ProtoBuf definition.
1982        ///
1983        /// The values are not transformed in any way and thus are considered stable
1984        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1985        pub fn as_str_name(&self) -> &'static str {
1986            match self {
1987                Self::GlobalTotal => "GLOBAL_TOTAL",
1988                Self::ShareEqually => "SHARE_EQUALLY",
1989            }
1990        }
1991        /// Creates an enum from field names used in the ProtoBuf definition.
1992        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1993            match value {
1994                "GLOBAL_TOTAL" => Some(Self::GlobalTotal),
1995                "SHARE_EQUALLY" => Some(Self::ShareEqually),
1996                _ => None,
1997            }
1998        }
1999    }
2000}
2001#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2002pub struct MatchArgument {
2003    #[prost(enumeration = "match_argument::Type", tag = "1")]
2004    pub r#type: i32,
2005    /// header key or query key
2006    #[prost(string, tag = "2")]
2007    pub key: ::prost::alloc::string::String,
2008    /// header value or query value
2009    #[prost(message, optional, tag = "3")]
2010    pub value: ::core::option::Option<MatchString>,
2011}
2012/// Nested message and enum types in `MatchArgument`.
2013pub mod match_argument {
2014    /// label type for gateway request
2015    #[derive(
2016        Clone,
2017        Copy,
2018        Debug,
2019        PartialEq,
2020        Eq,
2021        Hash,
2022        PartialOrd,
2023        Ord,
2024        ::prost::Enumeration
2025    )]
2026    #[repr(i32)]
2027    pub enum Type {
2028        /// custom arguments
2029        Custom = 0,
2030        /// method, match the http post/get/put/delete or grpc method
2031        Method = 1,
2032        /// header, match the http header, dubbo attachment, grpc header
2033        Header = 2,
2034        /// query, match the http query, dubbo argument
2035        Query = 3,
2036        /// caller service
2037        CallerService = 4,
2038        /// caller host ip
2039        CallerIp = 5,
2040        /// caller instance metadata
2041        CallerMetadata = 6,
2042    }
2043    impl Type {
2044        /// String value of the enum field names used in the ProtoBuf definition.
2045        ///
2046        /// The values are not transformed in any way and thus are considered stable
2047        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2048        pub fn as_str_name(&self) -> &'static str {
2049            match self {
2050                Self::Custom => "CUSTOM",
2051                Self::Method => "METHOD",
2052                Self::Header => "HEADER",
2053                Self::Query => "QUERY",
2054                Self::CallerService => "CALLER_SERVICE",
2055                Self::CallerIp => "CALLER_IP",
2056                Self::CallerMetadata => "CALLER_METADATA",
2057            }
2058        }
2059        /// Creates an enum from field names used in the ProtoBuf definition.
2060        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2061            match value {
2062                "CUSTOM" => Some(Self::Custom),
2063                "METHOD" => Some(Self::Method),
2064                "HEADER" => Some(Self::Header),
2065                "QUERY" => Some(Self::Query),
2066                "CALLER_SERVICE" => Some(Self::CallerService),
2067                "CALLER_IP" => Some(Self::CallerIp),
2068                "CALLER_METADATA" => Some(Self::CallerMetadata),
2069                _ => None,
2070            }
2071        }
2072    }
2073}
2074/// concurrency rate-limit amount config
2075#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2076pub struct ConcurrencyAmount {
2077    #[prost(uint32, tag = "1")]
2078    pub max_amount: u32,
2079}
2080/// custom response text when limited
2081#[derive(Clone, PartialEq, ::prost::Message)]
2082pub struct CustomResponse {
2083    #[prost(string, tag = "1")]
2084    pub code: ::prost::alloc::string::String,
2085    #[prost(map = "string, string", tag = "2")]
2086    pub headers: ::std::collections::HashMap<
2087        ::prost::alloc::string::String,
2088        ::prost::alloc::string::String,
2089    >,
2090    #[prost(string, tag = "3")]
2091    pub body: ::prost::alloc::string::String,
2092}
2093/// 分布式限流服务集群
2094#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2095pub struct RateLimitCluster {
2096    #[prost(string, tag = "1")]
2097    pub service: ::prost::alloc::string::String,
2098    /// 限流规则所属命名空间
2099    #[prost(string, tag = "2")]
2100    pub namespace: ::prost::alloc::string::String,
2101}
2102/// 限流配额
2103#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2104pub struct Amount {
2105    /// 时间周期内的最大配额数
2106    #[prost(uint32, tag = "1")]
2107    pub max_amount: u32,
2108    /// 配额生效的时间周期,必须大于等于1s
2109    #[prost(message, optional, tag = "2")]
2110    pub valid_duration: ::core::option::Option<::prost_types::Duration>,
2111    /// 请求统计精度
2112    #[prost(uint32, tag = "3")]
2113    pub precision: u32,
2114    /// 可选,起始限流阈值,爬坡起始值
2115    #[prost(uint32, tag = "4")]
2116    pub start_amount: u32,
2117    /// 可选,最小限流阈值,降低时最小值
2118    #[prost(uint32, tag = "5")]
2119    pub min_amount: u32,
2120}
2121/// 限流上报方式
2122#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2123pub struct Report {
2124    /// 配额固定上报周期,单位毫秒
2125    #[prost(message, optional, tag = "1")]
2126    pub interval: ::core::option::Option<::prost_types::Duration>,
2127    /// 使用了百分之多少配额后启动一次实时上报,值范围(0,100\]
2128    #[prost(uint32, tag = "2")]
2129    pub amount_percent: u32,
2130}
2131/// configuration root for route
2132#[derive(Clone, PartialEq, ::prost::Message)]
2133pub struct RouteRule {
2134    #[prost(string, tag = "1")]
2135    pub id: ::prost::alloc::string::String,
2136    /// route rule name
2137    #[prost(string, tag = "2")]
2138    pub name: ::prost::alloc::string::String,
2139    /// namespace namingspace of routing rules
2140    #[prost(string, tag = "3")]
2141    pub namespace: ::prost::alloc::string::String,
2142    /// Enable this router
2143    #[prost(bool, tag = "4")]
2144    pub enable: bool,
2145    /// Router type
2146    #[prost(enumeration = "RoutePolicy", tag = "5")]
2147    pub route_policy: i32,
2148    /// Routing configuration for router
2149    #[prost(message, optional, tag = "6")]
2150    pub routing_config: ::core::option::Option<::prost_types::Any>,
2151    /// revision routing version
2152    #[prost(string, tag = "7")]
2153    pub revision: ::prost::alloc::string::String,
2154    /// ctime create time of the rules
2155    #[prost(string, tag = "8")]
2156    pub ctime: ::prost::alloc::string::String,
2157    /// mtime modify time of the rules
2158    #[prost(string, tag = "9")]
2159    pub mtime: ::prost::alloc::string::String,
2160    /// etime enable time of the rules
2161    #[prost(string, tag = "10")]
2162    pub etime: ::prost::alloc::string::String,
2163    /// priority rules priority
2164    #[prost(uint32, tag = "11")]
2165    pub priority: u32,
2166    /// description simple description rules
2167    #[prost(string, tag = "12")]
2168    pub description: ::prost::alloc::string::String,
2169    /// 路由规则标签数据
2170    #[prost(map = "string, string", tag = "21")]
2171    pub metadata: ::std::collections::HashMap<
2172        ::prost::alloc::string::String,
2173        ::prost::alloc::string::String,
2174    >,
2175    /// 操作标志位
2176    #[prost(bool, tag = "30")]
2177    pub editable: bool,
2178    #[prost(bool, tag = "31")]
2179    pub deleteable: bool,
2180}
2181#[derive(Clone, PartialEq, ::prost::Message)]
2182pub struct MetadataFailover {
2183    /// failover_range metadata route bottom type
2184    #[prost(enumeration = "metadata_failover::FailoverRange", tag = "1")]
2185    pub failover_range: i32,
2186    /// only use to failover_range == OTHER_KEYS
2187    #[prost(map = "string, string", tag = "2")]
2188    pub labels: ::std::collections::HashMap<
2189        ::prost::alloc::string::String,
2190        ::prost::alloc::string::String,
2191    >,
2192}
2193/// Nested message and enum types in `MetadataFailover`.
2194pub mod metadata_failover {
2195    #[derive(
2196        Clone,
2197        Copy,
2198        Debug,
2199        PartialEq,
2200        Eq,
2201        Hash,
2202        PartialOrd,
2203        Ord,
2204        ::prost::Enumeration
2205    )]
2206    #[repr(i32)]
2207    pub enum FailoverRange {
2208        /// ALL return all instances
2209        All = 0,
2210        /// OTHERS retuen without thie labels instances
2211        Others = 1,
2212        /// OTHER_KEYS return other instances which match keys
2213        OtherKeys = 2,
2214    }
2215    impl FailoverRange {
2216        /// String value of the enum field names used in the ProtoBuf definition.
2217        ///
2218        /// The values are not transformed in any way and thus are considered stable
2219        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2220        pub fn as_str_name(&self) -> &'static str {
2221            match self {
2222                Self::All => "ALL",
2223                Self::Others => "OTHERS",
2224                Self::OtherKeys => "OTHER_KEYS",
2225            }
2226        }
2227        /// Creates an enum from field names used in the ProtoBuf definition.
2228        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2229            match value {
2230                "ALL" => Some(Self::All),
2231                "OTHERS" => Some(Self::Others),
2232                "OTHER_KEYS" => Some(Self::OtherKeys),
2233                _ => None,
2234            }
2235        }
2236    }
2237}
2238/// MetadataRoutingConfig metadata routing configuration
2239#[derive(Clone, PartialEq, ::prost::Message)]
2240pub struct MetadataRoutingConfig {
2241    /// service
2242    #[prost(string, tag = "1")]
2243    pub service: ::prost::alloc::string::String,
2244    /// namespace
2245    #[prost(string, tag = "2")]
2246    pub namespace: ::prost::alloc::string::String,
2247    #[prost(map = "string, string", tag = "3")]
2248    pub labels: ::std::collections::HashMap<
2249        ::prost::alloc::string::String,
2250        ::prost::alloc::string::String,
2251    >,
2252    /// When metadata not found, it will fall back to the
2253    #[prost(message, optional, tag = "4")]
2254    pub failover: ::core::option::Option<MetadataFailover>,
2255}
2256/// NearbyRoutingConfig routing configuration
2257#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2258pub struct NearbyRoutingConfig {
2259    /// 被调服务名,支持\*,代表全部服务
2260    #[prost(string, tag = "1")]
2261    pub service: ::prost::alloc::string::String,
2262    /// 被调命名空间
2263    #[prost(string, tag = "2")]
2264    pub namespace: ::prost::alloc::string::String,
2265    /// 默认就近级别
2266    #[prost(enumeration = "nearby_routing_config::LocationLevel", tag = "3")]
2267    pub match_level: i32,
2268    /// 最大就近级别
2269    #[prost(enumeration = "nearby_routing_config::LocationLevel", tag = "4")]
2270    pub max_match_level: i32,
2271    /// 是否强制就近
2272    #[prost(bool, tag = "5")]
2273    pub strict_nearby: bool,
2274}
2275/// Nested message and enum types in `NearbyRoutingConfig`.
2276pub mod nearby_routing_config {
2277    #[derive(
2278        Clone,
2279        Copy,
2280        Debug,
2281        PartialEq,
2282        Eq,
2283        Hash,
2284        PartialOrd,
2285        Ord,
2286        ::prost::Enumeration
2287    )]
2288    #[repr(i32)]
2289    pub enum LocationLevel {
2290        /// 未知就近级别,等同于未定义级别
2291        Unknown = 0,
2292        /// 机房就近级别
2293        Campus = 1,
2294        /// 可用区就近级别
2295        Zone = 2,
2296        /// 地域就近级别
2297        Region = 3,
2298        /// 全局就近级别
2299        All = 4,
2300    }
2301    impl LocationLevel {
2302        /// String value of the enum field names used in the ProtoBuf definition.
2303        ///
2304        /// The values are not transformed in any way and thus are considered stable
2305        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2306        pub fn as_str_name(&self) -> &'static str {
2307            match self {
2308                Self::Unknown => "UNKNOWN",
2309                Self::Campus => "CAMPUS",
2310                Self::Zone => "ZONE",
2311                Self::Region => "REGION",
2312                Self::All => "ALL",
2313            }
2314        }
2315        /// Creates an enum from field names used in the ProtoBuf definition.
2316        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2317            match value {
2318                "UNKNOWN" => Some(Self::Unknown),
2319                "CAMPUS" => Some(Self::Campus),
2320                "ZONE" => Some(Self::Zone),
2321                "REGION" => Some(Self::Region),
2322                "ALL" => Some(Self::All),
2323                _ => None,
2324            }
2325        }
2326    }
2327}
2328/// CustomRoute routing configuration
2329#[derive(Clone, PartialEq, ::prost::Message)]
2330pub struct CustomRoute {
2331    /// source source info
2332    /// deprecated_filed  only for compatible to the old version server
2333    #[prost(message, optional, tag = "1")]
2334    pub caller: ::core::option::Option<custom_route::ServiceKey>,
2335    /// destination destinations info
2336    /// deprecated_filed  only for compatible to the old version server
2337    #[prost(message, optional, tag = "2")]
2338    pub callee: ::core::option::Option<custom_route::ServiceKey>,
2339    /// rule route chain
2340    #[prost(message, repeated, tag = "3")]
2341    pub rules: ::prost::alloc::vec::Vec<CustomRouteRule>,
2342}
2343/// Nested message and enum types in `CustomRoute`.
2344pub mod custom_route {
2345    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2346    pub struct ServiceKey {
2347        /// service service name
2348        #[prost(string, tag = "1")]
2349        pub service: ::prost::alloc::string::String,
2350        /// namespace namespace of service
2351        #[prost(string, tag = "2")]
2352        pub namespace: ::prost::alloc::string::String,
2353    }
2354}
2355/// SubRuleRouting sub routing configuration
2356#[derive(Clone, PartialEq, ::prost::Message)]
2357pub struct CustomRouteRule {
2358    /// sub routing rule name
2359    #[prost(string, tag = "1")]
2360    pub name: ::prost::alloc::string::String,
2361    /// Master Control Service Example Tag or Request Label
2362    /// Value supports regular matching
2363    #[prost(message, optional, tag = "2")]
2364    pub arguments: ::core::option::Option<TrafficMatchRule>,
2365    /// destination destinations info
2366    #[prost(message, repeated, tag = "3")]
2367    pub destinations: ::prost::alloc::vec::Vec<DestinationGroup>,
2368}
2369#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2370pub struct SourceService {
2371    /// Main tuning service and namespace
2372    #[prost(string, tag = "1")]
2373    pub service: ::prost::alloc::string::String,
2374    #[prost(string, tag = "2")]
2375    pub namespace: ::prost::alloc::string::String,
2376}
2377#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2378pub struct DestinationService {
2379    /// Main tuning service and namespace
2380    #[prost(string, tag = "1")]
2381    pub service: ::prost::alloc::string::String,
2382    #[prost(string, tag = "2")]
2383    pub namespace: ::prost::alloc::string::String,
2384}
2385#[derive(Clone, PartialEq, ::prost::Message)]
2386pub struct DestinationGroup {
2387    /// Templated service and namespace
2388    #[prost(string, tag = "1")]
2389    pub service: ::prost::alloc::string::String,
2390    #[prost(string, tag = "2")]
2391    pub namespace: ::prost::alloc::string::String,
2392    /// Templated service example label
2393    /// Value supports regular matching
2394    #[prost(map = "string, message", tag = "3")]
2395    pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
2396    /// According to the service name and service instance Metadata Filter the
2397    /// qualified service instance subset Service instance subset can set priority
2398    /// and weight Priority: integer, range \[0, 9\], the highest priority is 0
2399    /// Weight: Integer
2400    /// Press priority routing, if there is high priority, low priority will not
2401    /// use If there is a subset of the same priority, then assign by weight
2402    /// Priority and weight can be not set / set up one / set two
2403    /// If the section is set priority, some are not set, it is considered that the
2404    /// priority is not set. If the part is set, some is not set, it is considered
2405    /// that the weight is not set to 0 If you have no weight, you think the weight
2406    /// is the same
2407    #[prost(uint32, tag = "4")]
2408    pub priority: u32,
2409    #[prost(uint32, tag = "5")]
2410    pub weight: u32,
2411    /// Forward requests to proxy service
2412    #[prost(string, tag = "6")]
2413    pub transfer: ::prost::alloc::string::String,
2414    /// Whether to isolate the SET, after isolation, no traffic will be allocated
2415    #[prost(bool, tag = "7")]
2416    pub isolate: bool,
2417    /// name desition name
2418    #[prost(string, tag = "8")]
2419    pub name: ::prost::alloc::string::String,
2420}
2421/// TrafficMatchRule 流量匹配规则
2422#[derive(Clone, PartialEq, ::prost::Message)]
2423pub struct TrafficMatchRule {
2424    /// 流量匹配规则,判断哪些流量需要进入泳道
2425    #[prost(message, repeated, tag = "1")]
2426    pub arguments: ::prost::alloc::vec::Vec<SourceMatch>,
2427    /// 随机百分比流量匹配, 1-100, 表示百分之几的流量会被匹配到, 默认值为 100
2428    #[prost(uint32, tag = "3")]
2429    pub random_percent: u32,
2430    #[prost(enumeration = "traffic_match_rule::TrafficMatchMode", tag = "4")]
2431    pub match_mode: i32,
2432}
2433/// Nested message and enum types in `TrafficMatchRule`.
2434pub mod traffic_match_rule {
2435    /// 多个 SourceMatch 之间的判断关系
2436    #[derive(
2437        Clone,
2438        Copy,
2439        Debug,
2440        PartialEq,
2441        Eq,
2442        Hash,
2443        PartialOrd,
2444        Ord,
2445        ::prost::Enumeration
2446    )]
2447    #[repr(i32)]
2448    pub enum TrafficMatchMode {
2449        /// 与模式
2450        And = 0,
2451        /// 或模式
2452        Or = 1,
2453    }
2454    impl TrafficMatchMode {
2455        /// String value of the enum field names used in the ProtoBuf definition.
2456        ///
2457        /// The values are not transformed in any way and thus are considered stable
2458        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2459        pub fn as_str_name(&self) -> &'static str {
2460            match self {
2461                Self::And => "AND",
2462                Self::Or => "OR",
2463            }
2464        }
2465        /// Creates an enum from field names used in the ProtoBuf definition.
2466        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2467            match value {
2468                "AND" => Some(Self::And),
2469                "OR" => Some(Self::Or),
2470                _ => None,
2471            }
2472        }
2473    }
2474}
2475/// SourceMatch
2476#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2477pub struct SourceMatch {
2478    #[prost(enumeration = "source_match::Type", tag = "1")]
2479    pub r#type: i32,
2480    /// header key or query key
2481    #[prost(string, tag = "2")]
2482    pub key: ::prost::alloc::string::String,
2483    /// header value or query value
2484    #[prost(message, optional, tag = "3")]
2485    pub value: ::core::option::Option<MatchString>,
2486}
2487/// Nested message and enum types in `SourceMatch`.
2488pub mod source_match {
2489    /// label type for gateway request
2490    #[derive(
2491        Clone,
2492        Copy,
2493        Debug,
2494        PartialEq,
2495        Eq,
2496        Hash,
2497        PartialOrd,
2498        Ord,
2499        ::prost::Enumeration
2500    )]
2501    #[repr(i32)]
2502    pub enum Type {
2503        /// custom arguments
2504        Custom = 0,
2505        /// method, match the http post/get/put/delete or grpc method
2506        Method = 1,
2507        /// header, match the http header, dubbo attachment, grpc header
2508        Header = 2,
2509        /// query, match the http query, dubbo argument
2510        Query = 3,
2511        /// caller host ip
2512        CallerIp = 4,
2513        /// path, math the http url
2514        Path = 5,
2515        /// cookie match http cookie
2516        Cookie = 6,
2517        /// indicate the caller instance metadata
2518        CallerMetadata = 7,
2519    }
2520    impl Type {
2521        /// String value of the enum field names used in the ProtoBuf definition.
2522        ///
2523        /// The values are not transformed in any way and thus are considered stable
2524        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2525        pub fn as_str_name(&self) -> &'static str {
2526            match self {
2527                Self::Custom => "CUSTOM",
2528                Self::Method => "METHOD",
2529                Self::Header => "HEADER",
2530                Self::Query => "QUERY",
2531                Self::CallerIp => "CALLER_IP",
2532                Self::Path => "PATH",
2533                Self::Cookie => "COOKIE",
2534                Self::CallerMetadata => "CALLER_METADATA",
2535            }
2536        }
2537        /// Creates an enum from field names used in the ProtoBuf definition.
2538        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2539            match value {
2540                "CUSTOM" => Some(Self::Custom),
2541                "METHOD" => Some(Self::Method),
2542                "HEADER" => Some(Self::Header),
2543                "QUERY" => Some(Self::Query),
2544                "CALLER_IP" => Some(Self::CallerIp),
2545                "PATH" => Some(Self::Path),
2546                "COOKIE" => Some(Self::Cookie),
2547                "CALLER_METADATA" => Some(Self::CallerMetadata),
2548                _ => None,
2549            }
2550        }
2551    }
2552}
2553#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2554#[repr(i32)]
2555pub enum RoutePolicy {
2556    /// Route by rule rule => RuleRoutingConfig
2557    RulePolicy = 0,
2558    /// Route by destination metadata ==> MetadataRoutingConfig
2559    MetadataPolicy = 1,
2560    /// Route by Nearby rule => NearByRoutingConfig
2561    NearbyPolicy = 2,
2562}
2563impl RoutePolicy {
2564    /// String value of the enum field names used in the ProtoBuf definition.
2565    ///
2566    /// The values are not transformed in any way and thus are considered stable
2567    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2568    pub fn as_str_name(&self) -> &'static str {
2569        match self {
2570            Self::RulePolicy => "RulePolicy",
2571            Self::MetadataPolicy => "MetadataPolicy",
2572            Self::NearbyPolicy => "NearbyPolicy",
2573        }
2574    }
2575    /// Creates an enum from field names used in the ProtoBuf definition.
2576    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2577        match value {
2578            "RulePolicy" => Some(Self::RulePolicy),
2579            "MetadataPolicy" => Some(Self::MetadataPolicy),
2580            "NearbyPolicy" => Some(Self::NearbyPolicy),
2581            _ => None,
2582        }
2583    }
2584}
2585/// 流量入口
2586#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2587pub struct TrafficEntry {
2588    /// 标记流量入口类型
2589    /// type == "pole.io/gateway/spring-cloud-gateway", 则 selector 为
2590    /// ServiceGatewaySelector type == "pole.io/service, 则 selector 为
2591    /// ServiceSelector
2592    #[prost(string, tag = "1")]
2593    pub r#type: ::prost::alloc::string::String,
2594    #[prost(message, optional, tag = "2")]
2595    pub selector: ::core::option::Option<::prost_types::Any>,
2596}
2597/// 微服务网关入口定义
2598#[derive(Clone, PartialEq, ::prost::Message)]
2599pub struct ServiceGatewaySelector {
2600    #[prost(string, tag = "1")]
2601    pub namespace: ::prost::alloc::string::String,
2602    #[prost(string, tag = "2")]
2603    pub service: ::prost::alloc::string::String,
2604    /// 决定要不要部份
2605    #[prost(map = "string, message", tag = "3")]
2606    pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
2607}
2608/// 普通服务入口定义
2609#[derive(Clone, PartialEq, ::prost::Message)]
2610pub struct ServiceSelector {
2611    #[prost(string, tag = "1")]
2612    pub namespace: ::prost::alloc::string::String,
2613    #[prost(string, tag = "2")]
2614    pub service: ::prost::alloc::string::String,
2615    /// 决定要不要部份
2616    #[prost(map = "string, message", tag = "3")]
2617    pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
2618}
2619/// 泳道组实体定义
2620#[derive(Clone, PartialEq, ::prost::Message)]
2621pub struct LaneGroup {
2622    /// 泳道组 ID
2623    #[prost(string, tag = "1")]
2624    pub id: ::prost::alloc::string::String,
2625    /// 泳道组名称
2626    #[prost(string, tag = "2")]
2627    pub name: ::prost::alloc::string::String,
2628    /// 泳道组内的流量入口信息
2629    #[prost(message, repeated, tag = "3")]
2630    pub entries: ::prost::alloc::vec::Vec<TrafficEntry>,
2631    /// 在泳道组内的服务列表信息
2632    #[prost(message, repeated, tag = "4")]
2633    pub destinations: ::prost::alloc::vec::Vec<DestinationGroup>,
2634    /// 泳道组描述信息
2635    #[prost(string, tag = "7")]
2636    pub revision: ::prost::alloc::string::String,
2637    /// 泳道组描述信息
2638    #[prost(string, tag = "8")]
2639    pub description: ::prost::alloc::string::String,
2640    /// 泳道组的创建时间
2641    #[prost(string, tag = "9")]
2642    pub ctime: ::prost::alloc::string::String,
2643    /// 泳道组的更新时间
2644    #[prost(string, tag = "10")]
2645    pub mtime: ::prost::alloc::string::String,
2646    /// 泳道组内的流量入口信息
2647    #[prost(message, repeated, tag = "11")]
2648    pub rules: ::prost::alloc::vec::Vec<LaneRule>,
2649    /// 泳道组标签信息
2650    #[prost(map = "string, string", tag = "12")]
2651    pub metadata: ::std::collections::HashMap<
2652        ::prost::alloc::string::String,
2653        ::prost::alloc::string::String,
2654    >,
2655    /// 操作标志位
2656    #[prost(bool, tag = "20")]
2657    pub editable: bool,
2658    #[prost(bool, tag = "21")]
2659    pub deleteable: bool,
2660}
2661/// 泳道规则
2662#[derive(Clone, PartialEq, ::prost::Message)]
2663pub struct LaneRule {
2664    #[prost(string, tag = "1")]
2665    pub id: ::prost::alloc::string::String,
2666    #[prost(string, tag = "2")]
2667    pub name: ::prost::alloc::string::String,
2668    /// 所属泳道组的名称
2669    #[prost(string, tag = "3")]
2670    pub group_name: ::prost::alloc::string::String,
2671    /// 流量匹配规则
2672    #[prost(message, optional, tag = "4")]
2673    pub traffic_match_rule: ::core::option::Option<TrafficMatchRule>,
2674    /// 保存这个泳道的默认实例标签
2675    #[prost(string, tag = "5")]
2676    pub default_label_value: ::prost::alloc::string::String,
2677    /// 泳道规则是否启用
2678    #[prost(bool, tag = "6")]
2679    pub enable: bool,
2680    #[prost(enumeration = "lane_rule::LaneMatchMode", tag = "7")]
2681    pub match_mode: i32,
2682    /// revision routing version
2683    #[prost(string, tag = "8")]
2684    pub revision: ::prost::alloc::string::String,
2685    /// ctime create time of the rules
2686    #[prost(string, tag = "9")]
2687    pub ctime: ::prost::alloc::string::String,
2688    /// mtime modify time of the rules
2689    #[prost(string, tag = "10")]
2690    pub mtime: ::prost::alloc::string::String,
2691    /// etime enable time of the rules
2692    #[prost(string, tag = "11")]
2693    pub etime: ::prost::alloc::string::String,
2694    /// priority rules priority
2695    #[prost(uint32, tag = "12")]
2696    pub priority: u32,
2697    /// description simple description rules
2698    #[prost(string, tag = "13")]
2699    pub description: ::prost::alloc::string::String,
2700    /// 属于该泳道的实例标签KEY,不填默认为lane
2701    #[prost(string, tag = "14")]
2702    pub label_key: ::prost::alloc::string::String,
2703}
2704/// Nested message and enum types in `LaneRule`.
2705pub mod lane_rule {
2706    #[derive(
2707        Clone,
2708        Copy,
2709        Debug,
2710        PartialEq,
2711        Eq,
2712        Hash,
2713        PartialOrd,
2714        Ord,
2715        ::prost::Enumeration
2716    )]
2717    #[repr(i32)]
2718    pub enum LaneMatchMode {
2719        /// 严格匹配模式
2720        Strict = 0,
2721        /// 宽松匹配模式
2722        Permissive = 1,
2723    }
2724    impl LaneMatchMode {
2725        /// String value of the enum field names used in the ProtoBuf definition.
2726        ///
2727        /// The values are not transformed in any way and thus are considered stable
2728        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2729        pub fn as_str_name(&self) -> &'static str {
2730            match self {
2731                Self::Strict => "STRICT",
2732                Self::Permissive => "PERMISSIVE",
2733            }
2734        }
2735        /// Creates an enum from field names used in the ProtoBuf definition.
2736        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2737            match value {
2738                "STRICT" => Some(Self::Strict),
2739                "PERMISSIVE" => Some(Self::Permissive),
2740                _ => None,
2741            }
2742        }
2743    }
2744}
2745#[derive(Clone, PartialEq, ::prost::Message)]
2746pub struct Client {
2747    /// client ip
2748    #[prost(string, tag = "1")]
2749    pub host: ::prost::alloc::string::String,
2750    /// client type
2751    #[prost(enumeration = "client::ClientType", tag = "2")]
2752    pub r#type: i32,
2753    /// client version
2754    #[prost(string, tag = "3")]
2755    pub version: ::prost::alloc::string::String,
2756    /// location 客户端地址位置
2757    #[prost(message, optional, tag = "4")]
2758    pub location: ::core::option::Option<Location>,
2759    /// client id
2760    #[prost(string, tag = "5")]
2761    pub id: ::prost::alloc::string::String,
2762    /// stat 监控数据上报信息
2763    #[prost(message, repeated, tag = "6")]
2764    pub stat: ::prost::alloc::vec::Vec<StatInfo>,
2765    /// creation time
2766    #[prost(string, tag = "7")]
2767    pub ctime: ::prost::alloc::string::String,
2768    /// modify time
2769    #[prost(string, tag = "8")]
2770    pub mtime: ::prost::alloc::string::String,
2771}
2772/// Nested message and enum types in `Client`.
2773pub mod client {
2774    /// client type
2775    #[derive(
2776        Clone,
2777        Copy,
2778        Debug,
2779        PartialEq,
2780        Eq,
2781        Hash,
2782        PartialOrd,
2783        Ord,
2784        ::prost::Enumeration
2785    )]
2786    #[repr(i32)]
2787    pub enum ClientType {
2788        Unknown = 0,
2789        Sdk = 1,
2790        Agent = 2,
2791    }
2792    impl ClientType {
2793        /// String value of the enum field names used in the ProtoBuf definition.
2794        ///
2795        /// The values are not transformed in any way and thus are considered stable
2796        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2797        pub fn as_str_name(&self) -> &'static str {
2798            match self {
2799                Self::Unknown => "UNKNOWN",
2800                Self::Sdk => "SDK",
2801                Self::Agent => "AGENT",
2802            }
2803        }
2804        /// Creates an enum from field names used in the ProtoBuf definition.
2805        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2806            match value {
2807                "UNKNOWN" => Some(Self::Unknown),
2808                "SDK" => Some(Self::Sdk),
2809                "AGENT" => Some(Self::Agent),
2810                _ => None,
2811            }
2812        }
2813    }
2814}
2815#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2816pub struct StatInfo {
2817    /// target ip
2818    #[prost(string, tag = "1")]
2819    pub target: ::prost::alloc::string::String,
2820    /// target port
2821    #[prost(uint32, tag = "2")]
2822    pub port: u32,
2823    /// api path
2824    #[prost(string, tag = "3")]
2825    pub path: ::prost::alloc::string::String,
2826    /// metrics protocol
2827    #[prost(string, tag = "4")]
2828    pub protocol: ::prost::alloc::string::String,
2829}
2830#[derive(Clone, PartialEq, ::prost::Message)]
2831pub struct LoginRequest {
2832    #[prost(string, tag = "1")]
2833    pub owner: ::prost::alloc::string::String,
2834    #[prost(string, tag = "2")]
2835    pub name: ::prost::alloc::string::String,
2836    #[prost(string, tag = "3")]
2837    pub password: ::prost::alloc::string::String,
2838    #[prost(map = "string, string", tag = "4")]
2839    pub options: ::std::collections::HashMap<
2840        ::prost::alloc::string::String,
2841        ::prost::alloc::string::String,
2842    >,
2843}
2844#[derive(Clone, PartialEq, ::prost::Message)]
2845pub struct LoginResponse {
2846    #[prost(string, tag = "1")]
2847    pub user_id: ::prost::alloc::string::String,
2848    #[prost(string, tag = "2")]
2849    pub name: ::prost::alloc::string::String,
2850    #[prost(string, tag = "3")]
2851    pub role: ::prost::alloc::string::String,
2852    #[prost(string, tag = "4")]
2853    pub owner_id: ::prost::alloc::string::String,
2854    #[prost(string, tag = "5")]
2855    pub token: ::prost::alloc::string::String,
2856    #[prost(map = "string, string", tag = "6")]
2857    pub options: ::std::collections::HashMap<
2858        ::prost::alloc::string::String,
2859        ::prost::alloc::string::String,
2860    >,
2861}
2862#[derive(Clone, PartialEq, ::prost::Message)]
2863pub struct User {
2864    #[prost(string, tag = "1")]
2865    pub id: ::prost::alloc::string::String,
2866    #[prost(string, tag = "2")]
2867    pub name: ::prost::alloc::string::String,
2868    #[prost(string, tag = "3")]
2869    pub password: ::prost::alloc::string::String,
2870    #[prost(string, tag = "4")]
2871    pub owner: ::prost::alloc::string::String,
2872    #[prost(string, tag = "5")]
2873    pub source: ::prost::alloc::string::String,
2874    #[prost(string, tag = "6")]
2875    pub auth_token: ::prost::alloc::string::String,
2876    #[prost(bool, tag = "7")]
2877    pub token_enable: bool,
2878    #[prost(string, tag = "8")]
2879    pub comment: ::prost::alloc::string::String,
2880    #[prost(string, tag = "9")]
2881    pub ctime: ::prost::alloc::string::String,
2882    #[prost(string, tag = "10")]
2883    pub mtime: ::prost::alloc::string::String,
2884    #[prost(string, tag = "11")]
2885    pub user_type: ::prost::alloc::string::String,
2886    #[prost(string, tag = "12")]
2887    pub mobile: ::prost::alloc::string::String,
2888    #[prost(string, tag = "13")]
2889    pub email: ::prost::alloc::string::String,
2890    #[prost(map = "string, string", tag = "14")]
2891    pub metadata: ::std::collections::HashMap<
2892        ::prost::alloc::string::String,
2893        ::prost::alloc::string::String,
2894    >,
2895}
2896#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2897pub struct ModifyUserPassword {
2898    #[prost(string, tag = "1")]
2899    pub id: ::prost::alloc::string::String,
2900    #[prost(string, tag = "2")]
2901    pub old_password: ::prost::alloc::string::String,
2902    #[prost(string, tag = "3")]
2903    pub new_password: ::prost::alloc::string::String,
2904}
2905#[derive(Clone, PartialEq, ::prost::Message)]
2906pub struct UserGroupRelation {
2907    #[prost(string, tag = "1")]
2908    pub group_id: ::prost::alloc::string::String,
2909    #[prost(message, repeated, tag = "2")]
2910    pub users: ::prost::alloc::vec::Vec<User>,
2911}
2912#[derive(Clone, PartialEq, ::prost::Message)]
2913pub struct UserGroup {
2914    #[prost(string, tag = "1")]
2915    pub id: ::prost::alloc::string::String,
2916    #[prost(string, tag = "2")]
2917    pub name: ::prost::alloc::string::String,
2918    #[prost(string, tag = "3")]
2919    pub owner: ::prost::alloc::string::String,
2920    #[prost(string, tag = "4")]
2921    pub auth_token: ::prost::alloc::string::String,
2922    #[prost(bool, tag = "5")]
2923    pub token_enable: bool,
2924    #[prost(string, tag = "6")]
2925    pub comment: ::prost::alloc::string::String,
2926    #[prost(string, tag = "7")]
2927    pub ctime: ::prost::alloc::string::String,
2928    #[prost(string, tag = "8")]
2929    pub mtime: ::prost::alloc::string::String,
2930    #[prost(message, optional, tag = "9")]
2931    pub relation: ::core::option::Option<UserGroupRelation>,
2932    #[prost(uint32, tag = "10")]
2933    pub user_count: u32,
2934    #[prost(string, tag = "11")]
2935    pub source: ::prost::alloc::string::String,
2936    #[prost(map = "string, string", tag = "12")]
2937    pub metadata: ::std::collections::HashMap<
2938        ::prost::alloc::string::String,
2939        ::prost::alloc::string::String,
2940    >,
2941}
2942#[derive(Clone, PartialEq, ::prost::Message)]
2943pub struct ModifyUserGroup {
2944    #[prost(string, tag = "1")]
2945    pub id: ::prost::alloc::string::String,
2946    #[prost(string, tag = "2")]
2947    pub owner: ::prost::alloc::string::String,
2948    #[prost(string, tag = "3")]
2949    pub name: ::prost::alloc::string::String,
2950    #[prost(string, tag = "4")]
2951    pub auth_token: ::prost::alloc::string::String,
2952    #[prost(bool, tag = "5")]
2953    pub token_enable: bool,
2954    #[prost(string, tag = "6")]
2955    pub comment: ::prost::alloc::string::String,
2956    #[prost(message, optional, tag = "7")]
2957    pub add_relations: ::core::option::Option<UserGroupRelation>,
2958    #[prost(message, optional, tag = "8")]
2959    pub remove_relations: ::core::option::Option<UserGroupRelation>,
2960    #[prost(map = "string, string", tag = "9")]
2961    pub metadata: ::std::collections::HashMap<
2962        ::prost::alloc::string::String,
2963        ::prost::alloc::string::String,
2964    >,
2965    #[prost(string, tag = "10")]
2966    pub source: ::prost::alloc::string::String,
2967}
2968#[derive(Clone, PartialEq, ::prost::Message)]
2969pub struct Role {
2970    #[prost(string, tag = "1")]
2971    pub id: ::prost::alloc::string::String,
2972    #[prost(string, tag = "2")]
2973    pub name: ::prost::alloc::string::String,
2974    #[prost(string, tag = "4")]
2975    pub owner: ::prost::alloc::string::String,
2976    #[prost(string, tag = "5")]
2977    pub source: ::prost::alloc::string::String,
2978    #[prost(bool, tag = "6")]
2979    pub default_role: bool,
2980    #[prost(map = "string, string", tag = "7")]
2981    pub metadata: ::std::collections::HashMap<
2982        ::prost::alloc::string::String,
2983        ::prost::alloc::string::String,
2984    >,
2985    #[prost(string, tag = "8")]
2986    pub comment: ::prost::alloc::string::String,
2987    #[prost(string, tag = "9")]
2988    pub ctime: ::prost::alloc::string::String,
2989    #[prost(string, tag = "10")]
2990    pub mtime: ::prost::alloc::string::String,
2991    #[prost(message, repeated, tag = "20")]
2992    pub users: ::prost::alloc::vec::Vec<User>,
2993    #[prost(message, repeated, tag = "21")]
2994    pub user_groups: ::prost::alloc::vec::Vec<UserGroup>,
2995}
2996#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2997pub struct Principal {
2998    #[prost(string, tag = "1")]
2999    pub id: ::prost::alloc::string::String,
3000    #[prost(string, tag = "2")]
3001    pub name: ::prost::alloc::string::String,
3002}
3003#[derive(Clone, PartialEq, ::prost::Message)]
3004pub struct Principals {
3005    #[prost(message, repeated, tag = "1")]
3006    pub users: ::prost::alloc::vec::Vec<Principal>,
3007    #[prost(message, repeated, tag = "2")]
3008    pub groups: ::prost::alloc::vec::Vec<Principal>,
3009    #[prost(message, repeated, tag = "3")]
3010    pub roles: ::prost::alloc::vec::Vec<Principal>,
3011}
3012#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3013pub struct StrategyResourceEntry {
3014    #[prost(string, tag = "1")]
3015    pub id: ::prost::alloc::string::String,
3016    #[prost(string, tag = "2")]
3017    pub namespace: ::prost::alloc::string::String,
3018    #[prost(string, tag = "3")]
3019    pub name: ::prost::alloc::string::String,
3020}
3021#[derive(Clone, PartialEq, ::prost::Message)]
3022pub struct StrategyResources {
3023    #[prost(string, tag = "1")]
3024    pub strategy_id: ::prost::alloc::string::String,
3025    #[prost(message, repeated, tag = "2")]
3026    pub namespaces: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3027    #[prost(message, repeated, tag = "3")]
3028    pub services: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3029    #[prost(message, repeated, tag = "4")]
3030    pub config_groups: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3031    #[prost(message, repeated, tag = "5")]
3032    pub route_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3033    #[prost(message, repeated, tag = "6")]
3034    pub ratelimit_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3035    #[prost(message, repeated, tag = "7")]
3036    pub circuitbreaker_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3037    #[prost(message, repeated, tag = "8")]
3038    pub faultdetect_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3039    #[prost(message, repeated, tag = "9")]
3040    pub lane_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3041    #[prost(message, repeated, tag = "10")]
3042    pub lossless_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3043    #[prost(message, repeated, tag = "11")]
3044    pub mirror_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3045    #[prost(message, repeated, tag = "12")]
3046    pub security_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3047    #[prost(message, repeated, tag = "21")]
3048    pub users: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3049    #[prost(message, repeated, tag = "22")]
3050    pub user_groups: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3051    #[prost(message, repeated, tag = "23")]
3052    pub roles: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3053    #[prost(message, repeated, tag = "24")]
3054    pub auth_policies: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
3055}
3056#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3057pub struct StrategyResourceLabel {
3058    #[prost(string, tag = "1")]
3059    pub key: ::prost::alloc::string::String,
3060    #[prost(string, tag = "2")]
3061    pub value: ::prost::alloc::string::String,
3062    #[prost(string, tag = "3")]
3063    pub compare_type: ::prost::alloc::string::String,
3064}
3065#[derive(Clone, PartialEq, ::prost::Message)]
3066pub struct AuthStrategy {
3067    #[prost(string, tag = "1")]
3068    pub id: ::prost::alloc::string::String,
3069    #[prost(string, tag = "2")]
3070    pub name: ::prost::alloc::string::String,
3071    #[prost(message, optional, tag = "3")]
3072    pub principals: ::core::option::Option<Principals>,
3073    #[prost(message, optional, tag = "4")]
3074    pub resources: ::core::option::Option<StrategyResources>,
3075    #[prost(enumeration = "AuthAction", tag = "5")]
3076    pub action: i32,
3077    #[prost(string, tag = "6")]
3078    pub comment: ::prost::alloc::string::String,
3079    #[prost(string, tag = "7")]
3080    pub owner: ::prost::alloc::string::String,
3081    #[prost(string, tag = "8")]
3082    pub ctime: ::prost::alloc::string::String,
3083    #[prost(string, tag = "9")]
3084    pub mtime: ::prost::alloc::string::String,
3085    #[prost(string, tag = "10")]
3086    pub auth_token: ::prost::alloc::string::String,
3087    #[prost(bool, tag = "11")]
3088    pub default_strategy: bool,
3089    #[prost(map = "string, string", tag = "12")]
3090    pub metadata: ::std::collections::HashMap<
3091        ::prost::alloc::string::String,
3092        ::prost::alloc::string::String,
3093    >,
3094    #[prost(string, tag = "13")]
3095    pub source: ::prost::alloc::string::String,
3096    #[prost(string, repeated, tag = "14")]
3097    pub functions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3098    #[prost(message, repeated, tag = "15")]
3099    pub resource_labels: ::prost::alloc::vec::Vec<StrategyResourceLabel>,
3100}
3101#[derive(Clone, PartialEq, ::prost::Message)]
3102pub struct ModifyAuthStrategy {
3103    #[prost(string, tag = "1")]
3104    pub id: ::prost::alloc::string::String,
3105    #[prost(string, tag = "2")]
3106    pub name: ::prost::alloc::string::String,
3107    #[prost(message, optional, tag = "3")]
3108    pub add_principals: ::core::option::Option<Principals>,
3109    #[prost(message, optional, tag = "4")]
3110    pub remove_principals: ::core::option::Option<Principals>,
3111    #[prost(message, optional, tag = "5")]
3112    pub add_resources: ::core::option::Option<StrategyResources>,
3113    #[prost(message, optional, tag = "6")]
3114    pub remove_resources: ::core::option::Option<StrategyResources>,
3115    #[prost(enumeration = "AuthAction", tag = "7")]
3116    pub action: i32,
3117    #[prost(string, tag = "8")]
3118    pub comment: ::prost::alloc::string::String,
3119    #[prost(string, tag = "9")]
3120    pub owner: ::prost::alloc::string::String,
3121    #[prost(map = "string, string", tag = "12")]
3122    pub metadata: ::std::collections::HashMap<
3123        ::prost::alloc::string::String,
3124        ::prost::alloc::string::String,
3125    >,
3126    #[prost(string, tag = "13")]
3127    pub source: ::prost::alloc::string::String,
3128    #[prost(string, repeated, tag = "14")]
3129    pub functions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3130    #[prost(message, repeated, tag = "15")]
3131    pub resource_labels: ::prost::alloc::vec::Vec<StrategyResourceLabel>,
3132}
3133#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3134#[repr(i32)]
3135pub enum AuthAction {
3136    /// deprecated_filed 该字段从未使用过
3137    OnlyRead = 0,
3138    /// deprecated_filed 使用 ALLOW 进行替代
3139    ReadWrite = 1,
3140    Allow = 10,
3141    Deny = 11,
3142}
3143impl AuthAction {
3144    /// String value of the enum field names used in the ProtoBuf definition.
3145    ///
3146    /// The values are not transformed in any way and thus are considered stable
3147    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3148    pub fn as_str_name(&self) -> &'static str {
3149        match self {
3150            Self::OnlyRead => "ONLY_READ",
3151            Self::ReadWrite => "READ_WRITE",
3152            Self::Allow => "ALLOW",
3153            Self::Deny => "DENY",
3154        }
3155    }
3156    /// Creates an enum from field names used in the ProtoBuf definition.
3157    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3158        match value {
3159            "ONLY_READ" => Some(Self::OnlyRead),
3160            "READ_WRITE" => Some(Self::ReadWrite),
3161            "ALLOW" => Some(Self::Allow),
3162            "DENY" => Some(Self::Deny),
3163            _ => None,
3164        }
3165    }
3166}
3167#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3168#[repr(i32)]
3169pub enum ResourceType {
3170    Namespaces = 0,
3171    Services = 1,
3172    ConfigGroups = 2,
3173    RouteRules = 3,
3174    RateLimitRules = 4,
3175    CircuitBreakerRules = 5,
3176    FaultDetectRules = 6,
3177    LaneRules = 7,
3178    LosslessRules = 8,
3179    MirrorRules = 9,
3180    SecurityRules = 10,
3181    Users = 20,
3182    UserGroups = 21,
3183    Roles = 22,
3184    PolicyRules = 23,
3185}
3186impl ResourceType {
3187    /// String value of the enum field names used in the ProtoBuf definition.
3188    ///
3189    /// The values are not transformed in any way and thus are considered stable
3190    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3191    pub fn as_str_name(&self) -> &'static str {
3192        match self {
3193            Self::Namespaces => "Namespaces",
3194            Self::Services => "Services",
3195            Self::ConfigGroups => "ConfigGroups",
3196            Self::RouteRules => "RouteRules",
3197            Self::RateLimitRules => "RateLimitRules",
3198            Self::CircuitBreakerRules => "CircuitBreakerRules",
3199            Self::FaultDetectRules => "FaultDetectRules",
3200            Self::LaneRules => "LaneRules",
3201            Self::LosslessRules => "LosslessRules",
3202            Self::MirrorRules => "MirrorRules",
3203            Self::SecurityRules => "SecurityRules",
3204            Self::Users => "Users",
3205            Self::UserGroups => "UserGroups",
3206            Self::Roles => "Roles",
3207            Self::PolicyRules => "PolicyRules",
3208        }
3209    }
3210    /// Creates an enum from field names used in the ProtoBuf definition.
3211    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3212        match value {
3213            "Namespaces" => Some(Self::Namespaces),
3214            "Services" => Some(Self::Services),
3215            "ConfigGroups" => Some(Self::ConfigGroups),
3216            "RouteRules" => Some(Self::RouteRules),
3217            "RateLimitRules" => Some(Self::RateLimitRules),
3218            "CircuitBreakerRules" => Some(Self::CircuitBreakerRules),
3219            "FaultDetectRules" => Some(Self::FaultDetectRules),
3220            "LaneRules" => Some(Self::LaneRules),
3221            "LosslessRules" => Some(Self::LosslessRules),
3222            "MirrorRules" => Some(Self::MirrorRules),
3223            "SecurityRules" => Some(Self::SecurityRules),
3224            "Users" => Some(Self::Users),
3225            "UserGroups" => Some(Self::UserGroups),
3226            "Roles" => Some(Self::Roles),
3227            "PolicyRules" => Some(Self::PolicyRules),
3228            _ => None,
3229        }
3230    }
3231}
3232/// 流量镜像规则
3233#[derive(Clone, PartialEq, ::prost::Message)]
3234pub struct TrafficMirror {
3235    #[prost(string, tag = "1")]
3236    pub id: ::prost::alloc::string::String,
3237    /// 流量镜像规则名称
3238    #[prost(string, tag = "2")]
3239    pub name: ::prost::alloc::string::String,
3240    /// 流量镜像规则描述
3241    #[prost(string, tag = "3")]
3242    pub description: ::prost::alloc::string::String,
3243    /// 流量镜像规则集合
3244    #[prost(message, repeated, tag = "4")]
3245    pub rules: ::prost::alloc::vec::Vec<MirrorRule>,
3246    /// 流量镜像规则revision信息
3247    #[prost(string, tag = "8")]
3248    pub revision: ::prost::alloc::string::String,
3249    /// 创建时间
3250    #[prost(string, tag = "20")]
3251    pub ctime: ::prost::alloc::string::String,
3252    /// 修改时间
3253    #[prost(string, tag = "21")]
3254    pub mtime: ::prost::alloc::string::String,
3255    /// 规则资源元数据
3256    #[prost(map = "string, string", tag = "30")]
3257    pub metadata: ::std::collections::HashMap<
3258        ::prost::alloc::string::String,
3259        ::prost::alloc::string::String,
3260    >,
3261    /// 操作标志位
3262    #[prost(bool, tag = "40")]
3263    pub editable: bool,
3264    #[prost(bool, tag = "41")]
3265    pub deleteable: bool,
3266}
3267#[derive(Clone, PartialEq, ::prost::Message)]
3268pub struct MirrorRule {
3269    /// 源服务
3270    #[prost(message, optional, tag = "1")]
3271    pub source: ::core::option::Option<MirrorSource>,
3272    /// 目标服务
3273    #[prost(message, optional, tag = "2")]
3274    pub destination: ::core::option::Option<MirrorDestination>,
3275    /// 流量镜像百分比,0-100
3276    #[prost(uint32, tag = "3")]
3277    pub mirror_percent: u32,
3278    /// 流量镜像持续时间,默认无限制
3279    #[prost(message, optional, tag = "4")]
3280    pub duration: ::core::option::Option<::prost_types::Duration>,
3281    /// 子规则是否禁用,默认启用
3282    #[prost(bool, tag = "5")]
3283    pub disable: bool,
3284}
3285#[derive(Clone, PartialEq, ::prost::Message)]
3286pub struct MirrorSource {
3287    /// 源服务所在的命名空间
3288    #[prost(string, tag = "1")]
3289    pub namespace: ::prost::alloc::string::String,
3290    /// 源服务名称
3291    #[prost(string, tag = "2")]
3292    pub service: ::prost::alloc::string::String,
3293    /// 流量匹配规则
3294    #[prost(message, optional, tag = "3")]
3295    pub traffic_match_rule: ::core::option::Option<TrafficMatchRule>,
3296}
3297#[derive(Clone, PartialEq, ::prost::Message)]
3298pub struct MirrorDestination {
3299    /// 目标服务所在的命名空间
3300    #[prost(string, tag = "1")]
3301    pub namespace: ::prost::alloc::string::String,
3302    /// 目标服务名称
3303    #[prost(string, tag = "2")]
3304    pub service: ::prost::alloc::string::String,
3305    /// 目标服务实例标签选择器
3306    #[prost(map = "string, message", tag = "3")]
3307    pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
3308}
3309#[derive(Clone, PartialEq, ::prost::Message)]
3310pub struct BlockAllowListRule {
3311    /// unique rule id
3312    #[prost(string, tag = "1")]
3313    pub id: ::prost::alloc::string::String,
3314    /// unique rule name
3315    #[prost(string, tag = "2")]
3316    pub name: ::prost::alloc::string::String,
3317    /// service namespace
3318    #[prost(string, tag = "4")]
3319    pub namespace: ::prost::alloc::string::String,
3320    /// service name
3321    #[prost(string, tag = "5")]
3322    pub service: ::prost::alloc::string::String,
3323    /// rule description
3324    #[prost(string, tag = "6")]
3325    pub description: ::prost::alloc::string::String,
3326    /// rule priority
3327    #[prost(uint32, tag = "7")]
3328    pub priority: u32,
3329    /// block or allow configuration
3330    #[prost(message, repeated, tag = "12")]
3331    pub block_allow_config: ::prost::alloc::vec::Vec<BlockAllowConfig>,
3332    /// ctime create time of the rules
3333    #[prost(string, tag = "20")]
3334    pub ctime: ::prost::alloc::string::String,
3335    /// mtime modify time of the rules
3336    #[prost(string, tag = "21")]
3337    pub mtime: ::prost::alloc::string::String,
3338    /// metadata for block allow list rules
3339    #[prost(map = "string, string", tag = "30")]
3340    pub metadata: ::std::collections::HashMap<
3341        ::prost::alloc::string::String,
3342        ::prost::alloc::string::String,
3343    >,
3344    /// rule revision
3345    #[prost(string, tag = "31")]
3346    pub revision: ::prost::alloc::string::String,
3347    /// 规则的权限操作状态
3348    #[prost(bool, tag = "40")]
3349    pub editable: bool,
3350    #[prost(bool, tag = "41")]
3351    pub deleteable: bool,
3352}
3353#[derive(Clone, PartialEq, ::prost::Message)]
3354pub struct BlockAllowConfig {
3355    /// blocking target api
3356    #[prost(message, optional, tag = "1")]
3357    pub api: ::core::option::Option<Api>,
3358    /// traffic match rule
3359    #[prost(message, optional, tag = "2")]
3360    pub traffic_match_rule: ::core::option::Option<TrafficMatchRule>,
3361    /// block or allow as policy
3362    #[prost(enumeration = "block_allow_config::BlockAllowPolicy", tag = "3")]
3363    pub block_allow_policy: i32,
3364}
3365/// Nested message and enum types in `BlockAllowConfig`.
3366pub mod block_allow_config {
3367    /// block or allow as policy
3368    #[derive(
3369        Clone,
3370        Copy,
3371        Debug,
3372        PartialEq,
3373        Eq,
3374        Hash,
3375        PartialOrd,
3376        Ord,
3377        ::prost::Enumeration
3378    )]
3379    #[repr(i32)]
3380    pub enum BlockAllowPolicy {
3381        AllowList = 0,
3382        BlockList = 1,
3383    }
3384    impl BlockAllowPolicy {
3385        /// String value of the enum field names used in the ProtoBuf definition.
3386        ///
3387        /// The values are not transformed in any way and thus are considered stable
3388        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3389        pub fn as_str_name(&self) -> &'static str {
3390            match self {
3391                Self::AllowList => "ALLOW_LIST",
3392                Self::BlockList => "BLOCK_LIST",
3393            }
3394        }
3395        /// Creates an enum from field names used in the ProtoBuf definition.
3396        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3397            match value {
3398                "ALLOW_LIST" => Some(Self::AllowList),
3399                "BLOCK_LIST" => Some(Self::BlockList),
3400                _ => None,
3401            }
3402        }
3403    }
3404}
3405#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3406pub struct SimpleService {
3407    #[prost(string, tag = "2")]
3408    pub name: ::prost::alloc::string::String,
3409    #[prost(string, tag = "3")]
3410    pub namespace: ::prost::alloc::string::String,
3411}
3412#[derive(Clone, PartialEq, ::prost::Message)]
3413pub struct Service {
3414    #[prost(string, tag = "1")]
3415    pub id: ::prost::alloc::string::String,
3416    #[prost(string, tag = "2")]
3417    pub name: ::prost::alloc::string::String,
3418    #[prost(string, tag = "3")]
3419    pub namespace: ::prost::alloc::string::String,
3420    #[prost(map = "string, string", tag = "4")]
3421    pub metadata: ::std::collections::HashMap<
3422        ::prost::alloc::string::String,
3423        ::prost::alloc::string::String,
3424    >,
3425    #[prost(string, tag = "5")]
3426    pub ports: ::prost::alloc::string::String,
3427    #[prost(string, tag = "6")]
3428    pub business: ::prost::alloc::string::String,
3429    #[prost(string, tag = "7")]
3430    pub department: ::prost::alloc::string::String,
3431    #[prost(string, tag = "8")]
3432    pub cmdb_mod1: ::prost::alloc::string::String,
3433    #[prost(string, tag = "9")]
3434    pub cmdb_mod2: ::prost::alloc::string::String,
3435    #[prost(string, tag = "10")]
3436    pub cmdb_mod3: ::prost::alloc::string::String,
3437    #[prost(string, tag = "11")]
3438    pub comment: ::prost::alloc::string::String,
3439    #[prost(string, tag = "12")]
3440    pub owners: ::prost::alloc::string::String,
3441    #[prost(string, tag = "13")]
3442    pub token: ::prost::alloc::string::String,
3443    #[prost(string, tag = "14")]
3444    pub ctime: ::prost::alloc::string::String,
3445    #[prost(string, tag = "15")]
3446    pub mtime: ::prost::alloc::string::String,
3447    #[prost(string, tag = "16")]
3448    pub revision: ::prost::alloc::string::String,
3449    #[prost(string, repeated, tag = "17")]
3450    pub export_to: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3451    #[prost(uint32, tag = "30")]
3452    pub total_instance_count: u32,
3453    #[prost(uint32, tag = "31")]
3454    pub healthy_instance_count: u32,
3455    #[prost(bool, tag = "40")]
3456    pub editable: bool,
3457    #[prost(bool, tag = "41")]
3458    pub deleteable: bool,
3459}
3460#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3461pub struct ServiceAlias {
3462    #[prost(string, tag = "1")]
3463    pub service: ::prost::alloc::string::String,
3464    #[prost(string, tag = "2")]
3465    pub namespace: ::prost::alloc::string::String,
3466    #[prost(string, tag = "3")]
3467    pub alias: ::prost::alloc::string::String,
3468    #[prost(string, tag = "4")]
3469    pub alias_namespace: ::prost::alloc::string::String,
3470    #[prost(enumeration = "AliasType", tag = "5")]
3471    pub r#type: i32,
3472    #[prost(string, tag = "6")]
3473    pub owners: ::prost::alloc::string::String,
3474    #[prost(string, tag = "7")]
3475    pub comment: ::prost::alloc::string::String,
3476    #[prost(string, tag = "8")]
3477    pub service_token: ::prost::alloc::string::String,
3478    #[prost(string, tag = "9")]
3479    pub ctime: ::prost::alloc::string::String,
3480    #[prost(string, tag = "10")]
3481    pub mtime: ::prost::alloc::string::String,
3482    #[prost(string, tag = "11")]
3483    pub id: ::prost::alloc::string::String,
3484    #[prost(bool, tag = "12")]
3485    pub editable: bool,
3486    #[prost(bool, tag = "13")]
3487    pub deleteable: bool,
3488}
3489#[derive(Clone, PartialEq, ::prost::Message)]
3490pub struct Instance {
3491    #[prost(string, tag = "1")]
3492    pub id: ::prost::alloc::string::String,
3493    #[prost(string, tag = "2")]
3494    pub service: ::prost::alloc::string::String,
3495    #[prost(string, tag = "3")]
3496    pub namespace: ::prost::alloc::string::String,
3497    #[prost(string, tag = "4")]
3498    pub host: ::prost::alloc::string::String,
3499    #[prost(uint32, tag = "5")]
3500    pub port: u32,
3501    #[prost(string, tag = "6")]
3502    pub protocol: ::prost::alloc::string::String,
3503    #[prost(string, tag = "7")]
3504    pub version: ::prost::alloc::string::String,
3505    #[prost(uint32, tag = "8")]
3506    pub priority: u32,
3507    #[prost(uint32, tag = "9")]
3508    pub weight: u32,
3509    #[prost(bool, tag = "20")]
3510    pub enable_health_check: bool,
3511    #[prost(message, optional, tag = "10")]
3512    pub health_check: ::core::option::Option<HealthCheck>,
3513    #[prost(bool, tag = "11")]
3514    pub healthy: bool,
3515    #[prost(bool, tag = "12")]
3516    pub isolate: bool,
3517    #[prost(message, optional, tag = "13")]
3518    pub location: ::core::option::Option<Location>,
3519    #[prost(map = "string, string", tag = "14")]
3520    pub metadata: ::std::collections::HashMap<
3521        ::prost::alloc::string::String,
3522        ::prost::alloc::string::String,
3523    >,
3524    #[prost(string, tag = "16")]
3525    pub ctime: ::prost::alloc::string::String,
3526    #[prost(string, tag = "17")]
3527    pub mtime: ::prost::alloc::string::String,
3528    #[prost(string, tag = "18")]
3529    pub revision: ::prost::alloc::string::String,
3530}
3531#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3532pub struct HealthCheck {
3533    #[prost(enumeration = "health_check::HealthCheckType", tag = "1")]
3534    pub r#type: i32,
3535    #[prost(message, optional, tag = "2")]
3536    pub heartbeat: ::core::option::Option<HeartbeatHealthCheck>,
3537}
3538/// Nested message and enum types in `HealthCheck`.
3539pub mod health_check {
3540    #[derive(
3541        Clone,
3542        Copy,
3543        Debug,
3544        PartialEq,
3545        Eq,
3546        Hash,
3547        PartialOrd,
3548        Ord,
3549        ::prost::Enumeration
3550    )]
3551    #[repr(i32)]
3552    pub enum HealthCheckType {
3553        Unknown = 0,
3554        Heartbeat = 1,
3555    }
3556    impl HealthCheckType {
3557        /// String value of the enum field names used in the ProtoBuf definition.
3558        ///
3559        /// The values are not transformed in any way and thus are considered stable
3560        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3561        pub fn as_str_name(&self) -> &'static str {
3562            match self {
3563                Self::Unknown => "UNKNOWN",
3564                Self::Heartbeat => "HEARTBEAT",
3565            }
3566        }
3567        /// Creates an enum from field names used in the ProtoBuf definition.
3568        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3569            match value {
3570                "UNKNOWN" => Some(Self::Unknown),
3571                "HEARTBEAT" => Some(Self::Heartbeat),
3572                _ => None,
3573            }
3574        }
3575    }
3576}
3577#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3578pub struct HeartbeatHealthCheck {
3579    #[prost(uint32, tag = "1")]
3580    pub ttl: u32,
3581}
3582#[derive(Clone, PartialEq, ::prost::Message)]
3583pub struct InstanceLabels {
3584    #[prost(string, tag = "2")]
3585    pub namespace: ::prost::alloc::string::String,
3586    #[prost(string, tag = "3")]
3587    pub service: ::prost::alloc::string::String,
3588    #[prost(string, tag = "4")]
3589    pub service_id: ::prost::alloc::string::String,
3590    #[prost(map = "string, message", tag = "1")]
3591    pub labels: ::std::collections::HashMap<::prost::alloc::string::String, StringList>,
3592}
3593#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3594pub struct ServiceSubscriber {}
3595#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3596#[repr(i32)]
3597pub enum AliasType {
3598    Default = 0,
3599    Cl5sid = 1,
3600}
3601impl AliasType {
3602    /// String value of the enum field names used in the ProtoBuf definition.
3603    ///
3604    /// The values are not transformed in any way and thus are considered stable
3605    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3606    pub fn as_str_name(&self) -> &'static str {
3607        match self {
3608            Self::Default => "DEFAULT",
3609            Self::Cl5sid => "CL5SID",
3610        }
3611    }
3612    /// Creates an enum from field names used in the ProtoBuf definition.
3613    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3614        match value {
3615            "DEFAULT" => Some(Self::Default),
3616            "CL5SID" => Some(Self::Cl5sid),
3617            _ => None,
3618        }
3619    }
3620}
3621#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3622pub struct HeartbeatRecord {
3623    #[prost(string, tag = "1")]
3624    pub instance_id: ::prost::alloc::string::String,
3625    #[prost(int64, tag = "6")]
3626    pub last_heartbeat_sec: i64,
3627    #[prost(bool, tag = "7")]
3628    pub exist: bool,
3629}
3630#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3631pub struct InstanceHeartbeat {
3632    #[prost(string, tag = "1")]
3633    pub instance_id: ::prost::alloc::string::String,
3634    #[prost(string, tag = "2")]
3635    pub service: ::prost::alloc::string::String,
3636    #[prost(string, tag = "3")]
3637    pub namespace: ::prost::alloc::string::String,
3638    #[prost(string, tag = "4")]
3639    pub host: ::prost::alloc::string::String,
3640    #[prost(uint32, tag = "5")]
3641    pub port: u32,
3642}
3643#[derive(Clone, PartialEq, ::prost::Message)]
3644pub struct HeartbeatsRequest {
3645    #[prost(message, repeated, tag = "1")]
3646    pub heartbeats: ::prost::alloc::vec::Vec<InstanceHeartbeat>,
3647}
3648#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3649pub struct HeartbeatsResponse {}
3650#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3651pub struct GetHeartbeatsRequest {
3652    #[prost(string, repeated, tag = "1")]
3653    pub instance_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3654}
3655#[derive(Clone, PartialEq, ::prost::Message)]
3656pub struct GetHeartbeatsResponse {
3657    #[prost(message, repeated, tag = "1")]
3658    pub records: ::prost::alloc::vec::Vec<HeartbeatRecord>,
3659}
3660#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3661pub struct DelHeartbeatsRequest {
3662    #[prost(string, repeated, tag = "1")]
3663    pub instance_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
3664}
3665#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3666pub struct DelHeartbeatsResponse {
3667    #[prost(uint32, tag = "1")]
3668    pub code: u32,
3669    #[prost(string, tag = "2")]
3670    pub info: ::prost::alloc::string::String,
3671}
3672#[derive(Clone, PartialEq, ::prost::Message)]
3673pub struct ServiceContract {
3674    /// 契约ID
3675    #[prost(string, tag = "1")]
3676    pub id: ::prost::alloc::string::String,
3677    /// 契约名称
3678    /// deprecated, use type field
3679    #[prost(string, tag = "2")]
3680    pub name: ::prost::alloc::string::String,
3681    /// 所属命名空间
3682    #[prost(string, tag = "3")]
3683    pub namespace: ::prost::alloc::string::String,
3684    /// 所属服务名称
3685    #[prost(string, tag = "4")]
3686    pub service: ::prost::alloc::string::String,
3687    /// 协议,http/grpc/dubbo/thrift
3688    #[prost(string, tag = "5")]
3689    pub protocol: ::prost::alloc::string::String,
3690    /// 契约版本
3691    #[prost(string, tag = "6")]
3692    pub version: ::prost::alloc::string::String,
3693    /// 信息摘要
3694    #[prost(string, tag = "7")]
3695    pub revision: ::prost::alloc::string::String,
3696    /// 额外描述
3697    #[prost(string, tag = "8")]
3698    pub content: ::prost::alloc::string::String,
3699    /// 接口描述信息
3700    #[prost(message, repeated, tag = "9")]
3701    pub interfaces: ::prost::alloc::vec::Vec<InterfaceDescriptor>,
3702    /// 创建时间
3703    #[prost(string, tag = "10")]
3704    pub ctime: ::prost::alloc::string::String,
3705    /// 更新时间
3706    #[prost(string, tag = "11")]
3707    pub mtime: ::prost::alloc::string::String,
3708    /// 接口状态,Offline/Online
3709    #[prost(string, tag = "12")]
3710    pub status: ::prost::alloc::string::String,
3711    /// 类型
3712    #[prost(string, tag = "14")]
3713    pub r#type: ::prost::alloc::string::String,
3714    /// 标签
3715    #[prost(map = "string, string", tag = "15")]
3716    pub metadata: ::std::collections::HashMap<
3717        ::prost::alloc::string::String,
3718        ::prost::alloc::string::String,
3719    >,
3720    /// 内容摘要
3721    #[prost(string, tag = "16")]
3722    pub content_digest: ::prost::alloc::string::String,
3723}
3724#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3725pub struct InterfaceDescriptor {
3726    /// 接口ID
3727    #[prost(string, tag = "1")]
3728    pub id: ::prost::alloc::string::String,
3729    /// 方法名称,对应 http method/ dubbo interface func/grpc service func
3730    #[prost(string, tag = "2")]
3731    pub method: ::prost::alloc::string::String,
3732    /// 接口名称,http path/dubbo interface/grpc service
3733    #[prost(string, tag = "3")]
3734    pub path: ::prost::alloc::string::String,
3735    /// 接口描述信息
3736    #[prost(string, tag = "4")]
3737    pub content: ::prost::alloc::string::String,
3738    /// 创建来源
3739    #[prost(enumeration = "interface_descriptor::Source", tag = "5")]
3740    pub source: i32,
3741    /// 接口信息摘要
3742    #[prost(string, tag = "6")]
3743    pub revision: ::prost::alloc::string::String,
3744    /// 创建时间
3745    #[prost(string, tag = "7")]
3746    pub ctime: ::prost::alloc::string::String,
3747    /// 更新时间
3748    #[prost(string, tag = "8")]
3749    pub mtime: ::prost::alloc::string::String,
3750    /// 接口名称描述信息
3751    /// deprecated, use type field
3752    #[prost(string, tag = "9")]
3753    pub name: ::prost::alloc::string::String,
3754    /// 所属命名空间
3755    #[prost(string, tag = "10")]
3756    pub namespace: ::prost::alloc::string::String,
3757    /// 所属服务名称
3758    #[prost(string, tag = "11")]
3759    pub service: ::prost::alloc::string::String,
3760    /// 协议,http/grpc/dubbo/thrift
3761    #[prost(string, tag = "12")]
3762    pub protocol: ::prost::alloc::string::String,
3763    /// 契约版本
3764    #[prost(string, tag = "13")]
3765    pub version: ::prost::alloc::string::String,
3766    /// 类型
3767    #[prost(string, tag = "14")]
3768    pub r#type: ::prost::alloc::string::String,
3769    /// 内容摘要
3770    #[prost(string, tag = "15")]
3771    pub content_digest: ::prost::alloc::string::String,
3772}
3773/// Nested message and enum types in `InterfaceDescriptor`.
3774pub mod interface_descriptor {
3775    #[derive(
3776        Clone,
3777        Copy,
3778        Debug,
3779        PartialEq,
3780        Eq,
3781        Hash,
3782        PartialOrd,
3783        Ord,
3784        ::prost::Enumeration
3785    )]
3786    #[repr(i32)]
3787    pub enum Source {
3788        Unknown = 0,
3789        Manual = 1,
3790        Client = 2,
3791    }
3792    impl Source {
3793        /// String value of the enum field names used in the ProtoBuf definition.
3794        ///
3795        /// The values are not transformed in any way and thus are considered stable
3796        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3797        pub fn as_str_name(&self) -> &'static str {
3798            match self {
3799                Self::Unknown => "UNKNOWN",
3800                Self::Manual => "Manual",
3801                Self::Client => "Client",
3802            }
3803        }
3804        /// Creates an enum from field names used in the ProtoBuf definition.
3805        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3806            match value {
3807                "UNKNOWN" => Some(Self::Unknown),
3808                "Manual" => Some(Self::Manual),
3809                "Client" => Some(Self::Client),
3810                _ => None,
3811            }
3812        }
3813    }
3814}
3815#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3816pub struct RuleMatcher {
3817    #[prost(message, optional, tag = "1")]
3818    pub source: ::core::option::Option<rule_matcher::SourceService>,
3819    #[prost(message, optional, tag = "2")]
3820    pub destination: ::core::option::Option<rule_matcher::DestinationService>,
3821}
3822/// Nested message and enum types in `RuleMatcher`.
3823pub mod rule_matcher {
3824    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3825    pub struct SourceService {
3826        #[prost(string, tag = "1")]
3827        pub service: ::prost::alloc::string::String,
3828        #[prost(string, tag = "2")]
3829        pub namespace: ::prost::alloc::string::String,
3830    }
3831    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3832    pub struct DestinationService {
3833        #[prost(string, tag = "1")]
3834        pub service: ::prost::alloc::string::String,
3835        #[prost(string, tag = "2")]
3836        pub namespace: ::prost::alloc::string::String,
3837        /// deprecated_filed  using api.path in blockConfig instead
3838        #[deprecated]
3839        #[prost(message, optional, tag = "3")]
3840        pub method: ::core::option::Option<super::MatchString>,
3841    }
3842}
3843/// new specific rule for circuitbreaker config
3844#[derive(Clone, PartialEq, ::prost::Message)]
3845pub struct CircuitBreakerRule {
3846    #[prost(string, tag = "1")]
3847    pub id: ::prost::alloc::string::String,
3848    /// rule name
3849    #[prost(string, tag = "2")]
3850    pub name: ::prost::alloc::string::String,
3851    /// namespace of rule
3852    #[prost(string, tag = "3")]
3853    pub namespace: ::prost::alloc::string::String,
3854    /// enable this router
3855    #[prost(bool, tag = "4")]
3856    pub enable: bool,
3857    /// revision routing version
3858    #[prost(string, tag = "5")]
3859    pub revision: ::prost::alloc::string::String,
3860    /// ctime create time of the rules
3861    #[prost(string, tag = "6")]
3862    pub ctime: ::prost::alloc::string::String,
3863    /// mtime modify time of the rules
3864    #[prost(string, tag = "7")]
3865    pub mtime: ::prost::alloc::string::String,
3866    /// etime enable time of the rules
3867    #[prost(string, tag = "8")]
3868    pub etime: ::prost::alloc::string::String,
3869    /// description simple description rules
3870    #[prost(string, tag = "9")]
3871    pub description: ::prost::alloc::string::String,
3872    /// the circuitbreaking level
3873    #[prost(enumeration = "Level", tag = "21")]
3874    pub level: i32,
3875    /// match condition for this rule
3876    #[prost(message, optional, tag = "22")]
3877    pub rule_matcher: ::core::option::Option<RuleMatcher>,
3878    /// deprecated_filed error conditions to judge an invocation as an error
3879    #[deprecated]
3880    #[prost(message, repeated, tag = "23")]
3881    pub error_conditions: ::prost::alloc::vec::Vec<ErrorCondition>,
3882    /// deprecated_filed trigger condition to trigger circuitbreaking
3883    #[deprecated]
3884    #[prost(message, repeated, tag = "24")]
3885    pub trigger_condition: ::prost::alloc::vec::Vec<TriggerCondition>,
3886    /// the maximum % of an upstream cluster that can be ejected
3887    #[prost(uint32, tag = "25")]
3888    pub max_ejection_percent: u32,
3889    /// recover condition to make resource open to close
3890    #[prost(message, optional, tag = "26")]
3891    pub recover_condition: ::core::option::Option<RecoverCondition>,
3892    /// fault detection enable config
3893    #[prost(message, optional, tag = "27")]
3894    pub fault_detect_config: ::core::option::Option<FaultDetectConfig>,
3895    /// fall back configuration
3896    #[prost(message, optional, tag = "28")]
3897    pub fallback_config: ::core::option::Option<FallbackConfig>,
3898    /// list for block configuration
3899    #[prost(message, repeated, tag = "29")]
3900    pub block_configs: ::prost::alloc::vec::Vec<BlockConfig>,
3901    /// priority rules priority
3902    #[prost(uint32, tag = "30")]
3903    pub priority: u32,
3904    /// 熔断规则标签数据
3905    #[prost(map = "string, string", tag = "31")]
3906    pub metadata: ::std::collections::HashMap<
3907        ::prost::alloc::string::String,
3908        ::prost::alloc::string::String,
3909    >,
3910    /// 操作标志位
3911    #[prost(bool, tag = "40")]
3912    pub editable: bool,
3913    #[prost(bool, tag = "41")]
3914    pub deleteable: bool,
3915}
3916/// the condition to judge an input invocation as an error
3917#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3918pub struct ErrorCondition {
3919    #[prost(enumeration = "error_condition::InputType", tag = "1")]
3920    pub input_type: i32,
3921    #[prost(message, optional, tag = "2")]
3922    pub condition: ::core::option::Option<MatchString>,
3923}
3924/// Nested message and enum types in `ErrorCondition`.
3925pub mod error_condition {
3926    #[derive(
3927        Clone,
3928        Copy,
3929        Debug,
3930        PartialEq,
3931        Eq,
3932        Hash,
3933        PartialOrd,
3934        Ord,
3935        ::prost::Enumeration
3936    )]
3937    #[repr(i32)]
3938    pub enum InputType {
3939        Unknown = 0,
3940        RetCode = 1,
3941        Delay = 2,
3942    }
3943    impl InputType {
3944        /// String value of the enum field names used in the ProtoBuf definition.
3945        ///
3946        /// The values are not transformed in any way and thus are considered stable
3947        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3948        pub fn as_str_name(&self) -> &'static str {
3949            match self {
3950                Self::Unknown => "UNKNOWN",
3951                Self::RetCode => "RET_CODE",
3952                Self::Delay => "DELAY",
3953            }
3954        }
3955        /// Creates an enum from field names used in the ProtoBuf definition.
3956        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3957            match value {
3958                "UNKNOWN" => Some(Self::Unknown),
3959                "RET_CODE" => Some(Self::RetCode),
3960                "DELAY" => Some(Self::Delay),
3961                _ => None,
3962            }
3963        }
3964    }
3965}
3966/// the error condition to trigger circuitbreaking
3967#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3968pub struct TriggerCondition {
3969    #[prost(enumeration = "trigger_condition::TriggerType", tag = "1")]
3970    pub trigger_type: i32,
3971    #[prost(uint32, tag = "2")]
3972    pub error_count: u32,
3973    #[prost(uint32, tag = "3")]
3974    pub error_percent: u32,
3975    #[prost(uint32, tag = "4")]
3976    pub interval: u32,
3977    #[prost(uint32, tag = "5")]
3978    pub minimum_request: u32,
3979}
3980/// Nested message and enum types in `TriggerCondition`.
3981pub mod trigger_condition {
3982    #[derive(
3983        Clone,
3984        Copy,
3985        Debug,
3986        PartialEq,
3987        Eq,
3988        Hash,
3989        PartialOrd,
3990        Ord,
3991        ::prost::Enumeration
3992    )]
3993    #[repr(i32)]
3994    pub enum TriggerType {
3995        Unknown = 0,
3996        ErrorRate = 1,
3997        ConsecutiveError = 2,
3998    }
3999    impl TriggerType {
4000        /// String value of the enum field names used in the ProtoBuf definition.
4001        ///
4002        /// The values are not transformed in any way and thus are considered stable
4003        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4004        pub fn as_str_name(&self) -> &'static str {
4005            match self {
4006                Self::Unknown => "UNKNOWN",
4007                Self::ErrorRate => "ERROR_RATE",
4008                Self::ConsecutiveError => "CONSECUTIVE_ERROR",
4009            }
4010        }
4011        /// Creates an enum from field names used in the ProtoBuf definition.
4012        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4013            match value {
4014                "UNKNOWN" => Some(Self::Unknown),
4015                "ERROR_RATE" => Some(Self::ErrorRate),
4016                "CONSECUTIVE_ERROR" => Some(Self::ConsecutiveError),
4017                _ => None,
4018            }
4019        }
4020    }
4021}
4022/// circuitbreaking OPEN status recover
4023#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
4024pub struct RecoverCondition {
4025    /// seconds from open to half-open
4026    #[prost(uint32, tag = "1")]
4027    pub sleep_window: u32,
4028    /// consecutive success request to recover
4029    #[prost(uint32, tag = "2")]
4030    pub consecutive_success: u32,
4031}
4032/// fault detect config within circuitbreaking
4033#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
4034pub struct FaultDetectConfig {
4035    #[prost(bool, tag = "1")]
4036    pub enable: bool,
4037}
4038/// blocking strategy
4039#[derive(Clone, PartialEq, ::prost::Message)]
4040pub struct BlockConfig {
4041    #[prost(string, tag = "1")]
4042    pub name: ::prost::alloc::string::String,
4043    /// blocking target api
4044    #[prost(message, optional, tag = "2")]
4045    pub api: ::core::option::Option<Api>,
4046    /// conditions to judge an invocation as an error
4047    #[prost(message, repeated, tag = "3")]
4048    pub error_conditions: ::prost::alloc::vec::Vec<ErrorCondition>,
4049    /// trigger condition to trigger circuitbreaking
4050    #[prost(message, repeated, tag = "4")]
4051    pub trigger_conditions: ::prost::alloc::vec::Vec<TriggerCondition>,
4052}
4053/// fallback config
4054#[derive(Clone, PartialEq, ::prost::Message)]
4055pub struct FallbackConfig {
4056    #[prost(bool, tag = "1")]
4057    pub enable: bool,
4058    #[prost(message, optional, tag = "2")]
4059    pub response: ::core::option::Option<FallbackResponse>,
4060}
4061/// fallback response
4062#[derive(Clone, PartialEq, ::prost::Message)]
4063pub struct FallbackResponse {
4064    #[prost(int32, tag = "1")]
4065    pub code: i32,
4066    #[prost(message, repeated, tag = "2")]
4067    pub headers: ::prost::alloc::vec::Vec<fallback_response::MessageHeader>,
4068    #[prost(string, tag = "3")]
4069    pub body: ::prost::alloc::string::String,
4070}
4071/// Nested message and enum types in `FallbackResponse`.
4072pub mod fallback_response {
4073    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4074    pub struct MessageHeader {
4075        #[prost(string, tag = "1")]
4076        pub key: ::prost::alloc::string::String,
4077        #[prost(string, tag = "2")]
4078        pub value: ::prost::alloc::string::String,
4079    }
4080}
4081/// circuitbreaking level
4082#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
4083#[repr(i32)]
4084pub enum Level {
4085    Unknown = 0,
4086    /// service level circuitbreaking
4087    Service = 1,
4088    /// method level circuitbreaking
4089    Method = 2,
4090    /// group level circuitbreaking
4091    Group = 3,
4092    /// instance level circuitbreaking
4093    Instance = 4,
4094}
4095impl Level {
4096    /// String value of the enum field names used in the ProtoBuf definition.
4097    ///
4098    /// The values are not transformed in any way and thus are considered stable
4099    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4100    pub fn as_str_name(&self) -> &'static str {
4101        match self {
4102            Self::Unknown => "UNKNOWN",
4103            Self::Service => "SERVICE",
4104            Self::Method => "METHOD",
4105            Self::Group => "GROUP",
4106            Self::Instance => "INSTANCE",
4107        }
4108    }
4109    /// Creates an enum from field names used in the ProtoBuf definition.
4110    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4111        match value {
4112            "UNKNOWN" => Some(Self::Unknown),
4113            "SERVICE" => Some(Self::Service),
4114            "METHOD" => Some(Self::Method),
4115            "GROUP" => Some(Self::Group),
4116            "INSTANCE" => Some(Self::Instance),
4117            _ => None,
4118        }
4119    }
4120}
4121#[derive(Clone, PartialEq, ::prost::Message)]
4122pub struct Namespace {
4123    #[prost(string, tag = "1")]
4124    pub id: ::prost::alloc::string::String,
4125    #[prost(string, tag = "2")]
4126    pub name: ::prost::alloc::string::String,
4127    #[prost(string, tag = "3")]
4128    pub comment: ::prost::alloc::string::String,
4129    #[prost(string, tag = "4")]
4130    pub owners: ::prost::alloc::string::String,
4131    #[prost(string, tag = "5")]
4132    pub token: ::prost::alloc::string::String,
4133    #[prost(string, tag = "6")]
4134    pub ctime: ::prost::alloc::string::String,
4135    #[prost(string, tag = "7")]
4136    pub mtime: ::prost::alloc::string::String,
4137    #[prost(string, repeated, tag = "8")]
4138    pub service_export_to: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
4139    #[prost(map = "string, string", tag = "9")]
4140    pub metadata: ::std::collections::HashMap<
4141        ::prost::alloc::string::String,
4142        ::prost::alloc::string::String,
4143    >,
4144    #[prost(uint32, tag = "20")]
4145    pub total_service_count: u32,
4146    #[prost(uint32, tag = "21")]
4147    pub total_health_instance_count: u32,
4148    #[prost(uint32, tag = "22")]
4149    pub total_instance_count: u32,
4150    #[prost(bool, tag = "30")]
4151    pub editable: bool,
4152    #[prost(bool, tag = "31")]
4153    pub deleteable: bool,
4154}
4155#[derive(Clone, PartialEq, ::prost::Message)]
4156pub struct FaultDetector {
4157    /// fault detect rules for current service
4158    #[prost(message, repeated, tag = "1")]
4159    pub rules: ::prost::alloc::vec::Vec<FaultDetectRule>,
4160    /// total revision for the fault detect rules
4161    #[prost(string, tag = "2")]
4162    pub revision: ::prost::alloc::string::String,
4163}
4164#[derive(Clone, PartialEq, ::prost::Message)]
4165pub struct FaultDetectRule {
4166    #[prost(string, tag = "1")]
4167    pub id: ::prost::alloc::string::String,
4168    /// rule name
4169    #[prost(string, tag = "2")]
4170    pub name: ::prost::alloc::string::String,
4171    /// namespace of rule
4172    #[prost(string, tag = "3")]
4173    pub namespace: ::prost::alloc::string::String,
4174    /// revision routing version
4175    #[prost(string, tag = "4")]
4176    pub revision: ::prost::alloc::string::String,
4177    /// ctime create time of the rules
4178    #[prost(string, tag = "5")]
4179    pub ctime: ::prost::alloc::string::String,
4180    /// mtime modify time of the rules
4181    #[prost(string, tag = "6")]
4182    pub mtime: ::prost::alloc::string::String,
4183    /// description simple description rules
4184    #[prost(string, tag = "7")]
4185    pub description: ::prost::alloc::string::String,
4186    /// detect target
4187    #[prost(message, optional, tag = "21")]
4188    pub target_service: ::core::option::Option<fault_detect_rule::DestinationService>,
4189    /// detect interval
4190    #[prost(uint32, tag = "22")]
4191    pub interval: u32,
4192    /// detect timeout
4193    #[prost(uint32, tag = "23")]
4194    pub timeout: u32,
4195    /// detect port
4196    #[prost(uint32, tag = "24")]
4197    pub port: u32,
4198    #[prost(enumeration = "fault_detect_rule::Protocol", tag = "25")]
4199    pub protocol: i32,
4200    /// http detect config
4201    #[prost(message, optional, tag = "26")]
4202    pub http_config: ::core::option::Option<HttpProtocolConfig>,
4203    /// tcp detect config
4204    #[prost(message, optional, tag = "27")]
4205    pub tcp_config: ::core::option::Option<TcpProtocolConfig>,
4206    /// udp detect config
4207    #[prost(message, optional, tag = "28")]
4208    pub udp_config: ::core::option::Option<UdpProtocolConfig>,
4209    /// priority rules priority
4210    #[prost(uint32, tag = "29")]
4211    pub priority: u32,
4212    /// 探测规则标签数据
4213    #[prost(map = "string, string", tag = "30")]
4214    pub metadata: ::std::collections::HashMap<
4215        ::prost::alloc::string::String,
4216        ::prost::alloc::string::String,
4217    >,
4218    /// extend info, put some custom info to display in console
4219    #[prost(map = "string, string", tag = "31")]
4220    pub extend_info: ::std::collections::HashMap<
4221        ::prost::alloc::string::String,
4222        ::prost::alloc::string::String,
4223    >,
4224    /// 操作标志位
4225    #[prost(bool, tag = "40")]
4226    pub editable: bool,
4227    #[prost(bool, tag = "41")]
4228    pub deleteable: bool,
4229}
4230/// Nested message and enum types in `FaultDetectRule`.
4231pub mod fault_detect_rule {
4232    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4233    pub struct DestinationService {
4234        #[prost(string, tag = "1")]
4235        pub service: ::prost::alloc::string::String,
4236        #[prost(string, tag = "2")]
4237        pub namespace: ::prost::alloc::string::String,
4238        /// deprecated_filed  use api.path instead
4239        #[deprecated]
4240        #[prost(message, optional, tag = "3")]
4241        pub method: ::core::option::Option<super::MatchString>,
4242        #[prost(message, optional, tag = "4")]
4243        pub api: ::core::option::Option<super::Api>,
4244    }
4245    /// detect protocol
4246    #[derive(
4247        Clone,
4248        Copy,
4249        Debug,
4250        PartialEq,
4251        Eq,
4252        Hash,
4253        PartialOrd,
4254        Ord,
4255        ::prost::Enumeration
4256    )]
4257    #[repr(i32)]
4258    pub enum Protocol {
4259        Unknown = 0,
4260        Http = 1,
4261        Tcp = 2,
4262        Udp = 3,
4263    }
4264    impl Protocol {
4265        /// String value of the enum field names used in the ProtoBuf definition.
4266        ///
4267        /// The values are not transformed in any way and thus are considered stable
4268        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4269        pub fn as_str_name(&self) -> &'static str {
4270            match self {
4271                Self::Unknown => "UNKNOWN",
4272                Self::Http => "HTTP",
4273                Self::Tcp => "TCP",
4274                Self::Udp => "UDP",
4275            }
4276        }
4277        /// Creates an enum from field names used in the ProtoBuf definition.
4278        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4279            match value {
4280                "UNKNOWN" => Some(Self::Unknown),
4281                "HTTP" => Some(Self::Http),
4282                "TCP" => Some(Self::Tcp),
4283                "UDP" => Some(Self::Udp),
4284                _ => None,
4285            }
4286        }
4287    }
4288}
4289#[derive(Clone, PartialEq, ::prost::Message)]
4290pub struct HttpProtocolConfig {
4291    #[prost(string, tag = "1")]
4292    pub method: ::prost::alloc::string::String,
4293    #[prost(string, tag = "2")]
4294    pub url: ::prost::alloc::string::String,
4295    #[prost(message, repeated, tag = "3")]
4296    pub headers: ::prost::alloc::vec::Vec<http_protocol_config::MessageHeader>,
4297    #[prost(string, tag = "4")]
4298    pub body: ::prost::alloc::string::String,
4299}
4300/// Nested message and enum types in `HttpProtocolConfig`.
4301pub mod http_protocol_config {
4302    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4303    pub struct MessageHeader {
4304        #[prost(string, tag = "1")]
4305        pub key: ::prost::alloc::string::String,
4306        #[prost(string, tag = "2")]
4307        pub value: ::prost::alloc::string::String,
4308    }
4309}
4310#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4311pub struct TcpProtocolConfig {
4312    #[prost(string, tag = "1")]
4313    pub send: ::prost::alloc::string::String,
4314    #[prost(string, repeated, tag = "2")]
4315    pub receive: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
4316}
4317#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4318pub struct UdpProtocolConfig {
4319    #[prost(string, tag = "1")]
4320    pub send: ::prost::alloc::string::String,
4321    #[prost(string, repeated, tag = "2")]
4322    pub receive: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
4323}
4324/// 优雅上下线规则的模型
4325#[derive(Clone, PartialEq, ::prost::Message)]
4326pub struct LosslessRule {
4327    /// rule id
4328    #[prost(string, tag = "1")]
4329    pub id: ::prost::alloc::string::String,
4330    /// service for rule belongs to
4331    #[prost(string, tag = "2")]
4332    pub service: ::prost::alloc::string::String,
4333    /// namespace for rule belongs to
4334    #[prost(string, tag = "3")]
4335    pub namespace: ::prost::alloc::string::String,
4336    /// revision routing version
4337    #[prost(string, tag = "4")]
4338    pub revision: ::prost::alloc::string::String,
4339    /// ctime create time of the rules
4340    #[prost(string, tag = "5")]
4341    pub ctime: ::prost::alloc::string::String,
4342    /// mtime modify time of the rules
4343    #[prost(string, tag = "6")]
4344    pub mtime: ::prost::alloc::string::String,
4345    /// configuration for lossless online
4346    #[prost(message, optional, tag = "7")]
4347    pub lossless_online: ::core::option::Option<LosslessOnline>,
4348    /// configuration for lossless offline
4349    #[prost(message, optional, tag = "8")]
4350    pub lossless_offline: ::core::option::Option<LosslessOffline>,
4351    /// rule labels
4352    #[prost(map = "string, string", tag = "9")]
4353    pub metadata: ::std::collections::HashMap<
4354        ::prost::alloc::string::String,
4355        ::prost::alloc::string::String,
4356    >,
4357    /// 操作标志位
4358    #[prost(bool, tag = "30")]
4359    pub editable: bool,
4360    #[prost(bool, tag = "31")]
4361    pub deleteable: bool,
4362}
4363#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4364pub struct LosslessOnline {
4365    /// configuration for delayRegister
4366    #[prost(message, optional, tag = "1")]
4367    pub delay_register: ::core::option::Option<DelayRegister>,
4368    /// configuration for warmup
4369    #[prost(message, optional, tag = "2")]
4370    pub warmup: ::core::option::Option<Warmup>,
4371    /// configuration for readiness probe
4372    #[prost(message, optional, tag = "3")]
4373    pub readiness: ::core::option::Option<Readiness>,
4374}
4375#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4376pub struct DelayRegister {
4377    /// enable delay registry
4378    #[prost(bool, tag = "1")]
4379    pub enable: bool,
4380    /// delay register strategy
4381    #[prost(enumeration = "delay_register::DelayStrategy", tag = "2")]
4382    pub strategy: i32,
4383    /// delay register time by second, active when strategy == DELAY_BY_TIME
4384    #[prost(int32, tag = "3")]
4385    pub interval_second: i32,
4386    /// protocol to do health check, default http, active when strategy == DELAY_BY_HEALTH_CHECK
4387    #[prost(string, tag = "4")]
4388    pub health_check_protocol: ::prost::alloc::string::String,
4389    /// method to do health check, default GET, active when strategy == DELAY_BY_HEALTH_CHECK
4390    #[prost(string, tag = "5")]
4391    pub health_check_method: ::prost::alloc::string::String,
4392    /// path to do health check, no default value, active when strategy == DELAY_BY_HEALTH_CHECK
4393    #[prost(string, tag = "6")]
4394    pub health_check_path: ::prost::alloc::string::String,
4395    /// health check interval second, default is 30, active when strategy == DELAY_BY_HEALTH_CHECK
4396    #[prost(string, tag = "7")]
4397    pub health_check_interval_second: ::prost::alloc::string::String,
4398}
4399/// Nested message and enum types in `DelayRegister`.
4400pub mod delay_register {
4401    #[derive(
4402        Clone,
4403        Copy,
4404        Debug,
4405        PartialEq,
4406        Eq,
4407        Hash,
4408        PartialOrd,
4409        Ord,
4410        ::prost::Enumeration
4411    )]
4412    #[repr(i32)]
4413    pub enum DelayStrategy {
4414        /// register instance after delay specific time
4415        DelayByTime = 0,
4416        /// register instance until health check successfully
4417        DelayByHealthCheck = 1,
4418    }
4419    impl DelayStrategy {
4420        /// String value of the enum field names used in the ProtoBuf definition.
4421        ///
4422        /// The values are not transformed in any way and thus are considered stable
4423        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4424        pub fn as_str_name(&self) -> &'static str {
4425            match self {
4426                Self::DelayByTime => "DELAY_BY_TIME",
4427                Self::DelayByHealthCheck => "DELAY_BY_HEALTH_CHECK",
4428            }
4429        }
4430        /// Creates an enum from field names used in the ProtoBuf definition.
4431        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4432            match value {
4433                "DELAY_BY_TIME" => Some(Self::DelayByTime),
4434                "DELAY_BY_HEALTH_CHECK" => Some(Self::DelayByHealthCheck),
4435                _ => None,
4436            }
4437        }
4438    }
4439}
4440#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
4441pub struct Warmup {
4442    /// enable warmup
4443    #[prost(bool, tag = "1")]
4444    pub enable: bool,
4445    /// total warmup interval by second
4446    #[prost(int32, tag = "2")]
4447    pub interval_second: i32,
4448    /// warmup stop when most of the instances in service are in warmup status
4449    #[prost(bool, tag = "3")]
4450    pub enable_overload_protection: bool,
4451    /// the threshold to active overload protection, default is 50, threshld = sum(WarmupInstances)/sum(AllInstances)\*100
4452    #[prost(int32, tag = "4")]
4453    pub overload_protection_threshold: i32,
4454    /// curvature for warmup register, default is 1
4455    #[prost(int32, tag = "5")]
4456    pub curvature: i32,
4457}
4458#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
4459pub struct Readiness {
4460    /// enable /readiness expose
4461    #[prost(bool, tag = "1")]
4462    pub enable: bool,
4463}
4464#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
4465pub struct LosslessOffline {
4466    /// enable /offline expose
4467    #[prost(bool, tag = "1")]
4468    pub enable: bool,
4469}
4470#[derive(Clone, PartialEq, ::prost::Message)]
4471pub struct DiscoverFilter {
4472    #[prost(bool, tag = "1")]
4473    pub only_healthy_instance: bool,
4474    /// pole.io 自定义信息
4475    #[prost(message, optional, tag = "100")]
4476    pub caller: ::core::option::Option<Caller>,
4477}
4478#[derive(Clone, PartialEq, ::prost::Message)]
4479pub struct DiscoverRequest {
4480    #[prost(enumeration = "discover_request::DiscoverRequestType", tag = "1")]
4481    pub r#type: i32,
4482    #[prost(message, optional, tag = "2")]
4483    pub service: ::core::option::Option<Service>,
4484    #[prost(message, optional, tag = "30")]
4485    pub filter: ::core::option::Option<DiscoverFilter>,
4486}
4487/// Nested message and enum types in `DiscoverRequest`.
4488pub mod discover_request {
4489    #[derive(
4490        Clone,
4491        Copy,
4492        Debug,
4493        PartialEq,
4494        Eq,
4495        Hash,
4496        PartialOrd,
4497        Ord,
4498        ::prost::Enumeration
4499    )]
4500    #[repr(i32)]
4501    pub enum DiscoverRequestType {
4502        Unknown = 0,
4503        /// 拉起命名空间列表
4504        Namespaces = 1,
4505        /// 服务列表
4506        Services = 2,
4507        /// 服务实例列表
4508        Instance = 3,
4509        /// 服务契约列表
4510        ServiceContracts = 4,
4511        /// 限流规则
4512        RateLimit = 20,
4513        /// 熔断规则
4514        CircuitBreaker = 21,
4515        /// 故障检测规则
4516        FaultDetector = 22,
4517        /// 自定义路由规则
4518        CustomRouteRule = 23,
4519        /// 就近路由规则
4520        NearbyRouteRule = 24,
4521        /// 泳道规则
4522        Lane = 25,
4523        /// 无损上下线规则
4524        Lossless = 26,
4525        /// 服务黑白名单规则
4526        BlockAllowRule = 27,
4527        /// 服务订阅视图
4528        ServiceSubscribers = 50,
4529    }
4530    impl DiscoverRequestType {
4531        /// String value of the enum field names used in the ProtoBuf definition.
4532        ///
4533        /// The values are not transformed in any way and thus are considered stable
4534        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4535        pub fn as_str_name(&self) -> &'static str {
4536            match self {
4537                Self::Unknown => "UNKNOWN",
4538                Self::Namespaces => "NAMESPACES",
4539                Self::Services => "SERVICES",
4540                Self::Instance => "INSTANCE",
4541                Self::ServiceContracts => "SERVICE_CONTRACTS",
4542                Self::RateLimit => "RATE_LIMIT",
4543                Self::CircuitBreaker => "CIRCUIT_BREAKER",
4544                Self::FaultDetector => "FAULT_DETECTOR",
4545                Self::CustomRouteRule => "CUSTOM_ROUTE_RULE",
4546                Self::NearbyRouteRule => "NEARBY_ROUTE_RULE",
4547                Self::Lane => "LANE",
4548                Self::Lossless => "LOSSLESS",
4549                Self::BlockAllowRule => "BLOCK_ALLOW_RULE",
4550                Self::ServiceSubscribers => "SERVICE_SUBSCRIBERS",
4551            }
4552        }
4553        /// Creates an enum from field names used in the ProtoBuf definition.
4554        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4555            match value {
4556                "UNKNOWN" => Some(Self::Unknown),
4557                "NAMESPACES" => Some(Self::Namespaces),
4558                "SERVICES" => Some(Self::Services),
4559                "INSTANCE" => Some(Self::Instance),
4560                "SERVICE_CONTRACTS" => Some(Self::ServiceContracts),
4561                "RATE_LIMIT" => Some(Self::RateLimit),
4562                "CIRCUIT_BREAKER" => Some(Self::CircuitBreaker),
4563                "FAULT_DETECTOR" => Some(Self::FaultDetector),
4564                "CUSTOM_ROUTE_RULE" => Some(Self::CustomRouteRule),
4565                "NEARBY_ROUTE_RULE" => Some(Self::NearbyRouteRule),
4566                "LANE" => Some(Self::Lane),
4567                "LOSSLESS" => Some(Self::Lossless),
4568                "BLOCK_ALLOW_RULE" => Some(Self::BlockAllowRule),
4569                "SERVICE_SUBSCRIBERS" => Some(Self::ServiceSubscribers),
4570                _ => None,
4571            }
4572        }
4573    }
4574}
4575#[derive(Clone, PartialEq, ::prost::Message)]
4576pub struct DiscoverResponse {
4577    #[prost(uint32, tag = "1")]
4578    pub code: u32,
4579    #[prost(string, tag = "2")]
4580    pub info: ::prost::alloc::string::String,
4581    #[prost(enumeration = "discover_response::DiscoverResponseType", tag = "3")]
4582    pub r#type: i32,
4583    /// 服务
4584    #[prost(message, optional, tag = "4")]
4585    pub service: ::core::option::Option<Service>,
4586    /// 服务真实名称
4587    #[prost(message, optional, tag = "5")]
4588    pub alias_for: ::core::option::Option<Service>,
4589    /// 命名空间列表
4590    #[prost(message, repeated, tag = "6")]
4591    pub namespaces: ::prost::alloc::vec::Vec<Namespace>,
4592    /// 服务列表
4593    #[prost(message, repeated, tag = "7")]
4594    pub services: ::prost::alloc::vec::Vec<Service>,
4595    /// 服务实例列表
4596    #[prost(message, repeated, tag = "8")]
4597    pub instances: ::prost::alloc::vec::Vec<Instance>,
4598    /// 服务契约
4599    #[prost(message, repeated, tag = "9")]
4600    pub service_contracts: ::prost::alloc::vec::Vec<ServiceContract>,
4601    /// 限流规则
4602    #[prost(message, repeated, tag = "20")]
4603    pub rate_limit: ::prost::alloc::vec::Vec<RateLimit>,
4604    /// 熔断规则
4605    #[prost(message, repeated, tag = "21")]
4606    pub circuit_breaker: ::prost::alloc::vec::Vec<CircuitBreakerRule>,
4607    /// 故障检测规则
4608    #[prost(message, optional, tag = "22")]
4609    pub fault_detector: ::core::option::Option<FaultDetector>,
4610    /// 全链路灰度泳道
4611    #[prost(message, repeated, tag = "23")]
4612    pub lanes: ::prost::alloc::vec::Vec<LaneGroup>,
4613    /// 自定义路由规则内容
4614    #[prost(message, repeated, tag = "24")]
4615    pub custom_route_rules: ::prost::alloc::vec::Vec<RouteRule>,
4616    /// 就近路由规则内容
4617    #[prost(message, repeated, tag = "25")]
4618    pub nearby_route_rules: ::prost::alloc::vec::Vec<RouteRule>,
4619    /// 无损上下线规则内容
4620    #[prost(message, repeated, tag = "26")]
4621    pub lossless_rules: ::prost::alloc::vec::Vec<LosslessRule>,
4622    /// 服务黑白名单鉴权规则
4623    #[prost(message, repeated, tag = "27")]
4624    pub block_allow_list_rule: ::prost::alloc::vec::Vec<BlockAllowListRule>,
4625}
4626/// Nested message and enum types in `DiscoverResponse`.
4627pub mod discover_response {
4628    #[derive(
4629        Clone,
4630        Copy,
4631        Debug,
4632        PartialEq,
4633        Eq,
4634        Hash,
4635        PartialOrd,
4636        Ord,
4637        ::prost::Enumeration
4638    )]
4639    #[repr(i32)]
4640    pub enum DiscoverResponseType {
4641        Unknown = 0,
4642        /// 拉起命名空间列表
4643        Namespaces = 1,
4644        /// 服务列表
4645        Services = 2,
4646        /// 服务实例列表
4647        Instance = 3,
4648        /// 服务契约列表
4649        ServiceContracts = 4,
4650        /// 限流规则
4651        RateLimit = 20,
4652        /// 熔断规则
4653        CircuitBreaker = 21,
4654        /// 故障检测规则
4655        FaultDetector = 22,
4656        /// 自定义路由规则
4657        CustomRouteRule = 23,
4658        /// 就近路由规则
4659        NearbyRouteRule = 24,
4660        /// 泳道规则
4661        Lane = 25,
4662        /// 无损上下线规则
4663        Lossless = 26,
4664        /// 服务黑白名单规则
4665        BlockAllowRule = 27,
4666        /// 服务订阅视图
4667        ServiceSubscribers = 50,
4668    }
4669    impl DiscoverResponseType {
4670        /// String value of the enum field names used in the ProtoBuf definition.
4671        ///
4672        /// The values are not transformed in any way and thus are considered stable
4673        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4674        pub fn as_str_name(&self) -> &'static str {
4675            match self {
4676                Self::Unknown => "UNKNOWN",
4677                Self::Namespaces => "NAMESPACES",
4678                Self::Services => "SERVICES",
4679                Self::Instance => "INSTANCE",
4680                Self::ServiceContracts => "SERVICE_CONTRACTS",
4681                Self::RateLimit => "RATE_LIMIT",
4682                Self::CircuitBreaker => "CIRCUIT_BREAKER",
4683                Self::FaultDetector => "FAULT_DETECTOR",
4684                Self::CustomRouteRule => "CUSTOM_ROUTE_RULE",
4685                Self::NearbyRouteRule => "NEARBY_ROUTE_RULE",
4686                Self::Lane => "LANE",
4687                Self::Lossless => "LOSSLESS",
4688                Self::BlockAllowRule => "BLOCK_ALLOW_RULE",
4689                Self::ServiceSubscribers => "SERVICE_SUBSCRIBERS",
4690            }
4691        }
4692        /// Creates an enum from field names used in the ProtoBuf definition.
4693        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4694            match value {
4695                "UNKNOWN" => Some(Self::Unknown),
4696                "NAMESPACES" => Some(Self::Namespaces),
4697                "SERVICES" => Some(Self::Services),
4698                "INSTANCE" => Some(Self::Instance),
4699                "SERVICE_CONTRACTS" => Some(Self::ServiceContracts),
4700                "RATE_LIMIT" => Some(Self::RateLimit),
4701                "CIRCUIT_BREAKER" => Some(Self::CircuitBreaker),
4702                "FAULT_DETECTOR" => Some(Self::FaultDetector),
4703                "CUSTOM_ROUTE_RULE" => Some(Self::CustomRouteRule),
4704                "NEARBY_ROUTE_RULE" => Some(Self::NearbyRouteRule),
4705                "LANE" => Some(Self::Lane),
4706                "LOSSLESS" => Some(Self::Lossless),
4707                "BLOCK_ALLOW_RULE" => Some(Self::BlockAllowRule),
4708                "SERVICE_SUBSCRIBERS" => Some(Self::ServiceSubscribers),
4709                _ => None,
4710            }
4711        }
4712    }
4713}
4714/// Generated client implementations.
4715pub mod discover_grpc_client {
4716    #![allow(
4717        unused_variables,
4718        dead_code,
4719        missing_docs,
4720        clippy::wildcard_imports,
4721        clippy::let_unit_value,
4722    )]
4723    use tonic::codegen::*;
4724    use tonic::codegen::http::Uri;
4725    #[derive(Debug, Clone)]
4726    pub struct DiscoverGrpcClient<T> {
4727        inner: tonic::client::Grpc<T>,
4728    }
4729    impl DiscoverGrpcClient<tonic::transport::Channel> {
4730        /// Attempt to create a new client by connecting to a given endpoint.
4731        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4732        where
4733            D: TryInto<tonic::transport::Endpoint>,
4734            D::Error: Into<StdError>,
4735        {
4736            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4737            Ok(Self::new(conn))
4738        }
4739    }
4740    impl<T> DiscoverGrpcClient<T>
4741    where
4742        T: tonic::client::GrpcService<tonic::body::Body>,
4743        T::Error: Into<StdError>,
4744        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4745        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4746    {
4747        pub fn new(inner: T) -> Self {
4748            let inner = tonic::client::Grpc::new(inner);
4749            Self { inner }
4750        }
4751        pub fn with_origin(inner: T, origin: Uri) -> Self {
4752            let inner = tonic::client::Grpc::with_origin(inner, origin);
4753            Self { inner }
4754        }
4755        pub fn with_interceptor<F>(
4756            inner: T,
4757            interceptor: F,
4758        ) -> DiscoverGrpcClient<InterceptedService<T, F>>
4759        where
4760            F: tonic::service::Interceptor,
4761            T::ResponseBody: Default,
4762            T: tonic::codegen::Service<
4763                http::Request<tonic::body::Body>,
4764                Response = http::Response<
4765                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4766                >,
4767            >,
4768            <T as tonic::codegen::Service<
4769                http::Request<tonic::body::Body>,
4770            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4771        {
4772            DiscoverGrpcClient::new(InterceptedService::new(inner, interceptor))
4773        }
4774        /// Compress requests with the given encoding.
4775        ///
4776        /// This requires the server to support it otherwise it might respond with an
4777        /// error.
4778        #[must_use]
4779        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4780            self.inner = self.inner.send_compressed(encoding);
4781            self
4782        }
4783        /// Enable decompressing responses.
4784        #[must_use]
4785        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4786            self.inner = self.inner.accept_compressed(encoding);
4787            self
4788        }
4789        /// Limits the maximum size of a decoded message.
4790        ///
4791        /// Default: `4MB`
4792        #[must_use]
4793        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4794            self.inner = self.inner.max_decoding_message_size(limit);
4795            self
4796        }
4797        /// Limits the maximum size of an encoded message.
4798        ///
4799        /// Default: `usize::MAX`
4800        #[must_use]
4801        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4802            self.inner = self.inner.max_encoding_message_size(limit);
4803            self
4804        }
4805        /// 客户端上报
4806        pub async fn report_client(
4807            &mut self,
4808            request: impl tonic::IntoRequest<super::Client>,
4809        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
4810            self.inner
4811                .ready()
4812                .await
4813                .map_err(|e| {
4814                    tonic::Status::unknown(
4815                        format!("Service was not ready: {}", e.into()),
4816                    )
4817                })?;
4818            let codec = tonic_prost::ProstCodec::default();
4819            let path = http::uri::PathAndQuery::from_static(
4820                "/v1.DiscoverGRPC/ReportClient",
4821            );
4822            let mut req = request.into_request();
4823            req.extensions_mut()
4824                .insert(GrpcMethod::new("v1.DiscoverGRPC", "ReportClient"));
4825            self.inner.unary(req, path, codec).await
4826        }
4827        /// 被调方注册服务实例
4828        pub async fn register_instance(
4829            &mut self,
4830            request: impl tonic::IntoRequest<super::Instance>,
4831        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
4832            self.inner
4833                .ready()
4834                .await
4835                .map_err(|e| {
4836                    tonic::Status::unknown(
4837                        format!("Service was not ready: {}", e.into()),
4838                    )
4839                })?;
4840            let codec = tonic_prost::ProstCodec::default();
4841            let path = http::uri::PathAndQuery::from_static(
4842                "/v1.DiscoverGRPC/RegisterInstance",
4843            );
4844            let mut req = request.into_request();
4845            req.extensions_mut()
4846                .insert(GrpcMethod::new("v1.DiscoverGRPC", "RegisterInstance"));
4847            self.inner.unary(req, path, codec).await
4848        }
4849        /// 被调方反注册服务实例
4850        pub async fn deregister_instance(
4851            &mut self,
4852            request: impl tonic::IntoRequest<super::Instance>,
4853        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
4854            self.inner
4855                .ready()
4856                .await
4857                .map_err(|e| {
4858                    tonic::Status::unknown(
4859                        format!("Service was not ready: {}", e.into()),
4860                    )
4861                })?;
4862            let codec = tonic_prost::ProstCodec::default();
4863            let path = http::uri::PathAndQuery::from_static(
4864                "/v1.DiscoverGRPC/DeregisterInstance",
4865            );
4866            let mut req = request.into_request();
4867            req.extensions_mut()
4868                .insert(GrpcMethod::new("v1.DiscoverGRPC", "DeregisterInstance"));
4869            self.inner.unary(req, path, codec).await
4870        }
4871        /// 统一发现接口
4872        pub async fn discover(
4873            &mut self,
4874            request: impl tonic::IntoStreamingRequest<Message = super::DiscoverRequest>,
4875        ) -> std::result::Result<
4876            tonic::Response<tonic::codec::Streaming<super::DiscoverResponse>>,
4877            tonic::Status,
4878        > {
4879            self.inner
4880                .ready()
4881                .await
4882                .map_err(|e| {
4883                    tonic::Status::unknown(
4884                        format!("Service was not ready: {}", e.into()),
4885                    )
4886                })?;
4887            let codec = tonic_prost::ProstCodec::default();
4888            let path = http::uri::PathAndQuery::from_static("/v1.DiscoverGRPC/Discover");
4889            let mut req = request.into_streaming_request();
4890            req.extensions_mut().insert(GrpcMethod::new("v1.DiscoverGRPC", "Discover"));
4891            self.inner.streaming(req, path, codec).await
4892        }
4893        /// 被调方批量上报心跳
4894        pub async fn heartbeat(
4895            &mut self,
4896            request: impl tonic::IntoStreamingRequest<Message = super::HeartbeatsRequest>,
4897        ) -> std::result::Result<
4898            tonic::Response<tonic::codec::Streaming<super::HeartbeatsResponse>>,
4899            tonic::Status,
4900        > {
4901            self.inner
4902                .ready()
4903                .await
4904                .map_err(|e| {
4905                    tonic::Status::unknown(
4906                        format!("Service was not ready: {}", e.into()),
4907                    )
4908                })?;
4909            let codec = tonic_prost::ProstCodec::default();
4910            let path = http::uri::PathAndQuery::from_static(
4911                "/v1.DiscoverGRPC/Heartbeat",
4912            );
4913            let mut req = request.into_streaming_request();
4914            req.extensions_mut().insert(GrpcMethod::new("v1.DiscoverGRPC", "Heartbeat"));
4915            self.inner.streaming(req, path, codec).await
4916        }
4917        /// 上报服务契约
4918        pub async fn report_service_contract(
4919            &mut self,
4920            request: impl tonic::IntoRequest<super::ServiceContract>,
4921        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
4922            self.inner
4923                .ready()
4924                .await
4925                .map_err(|e| {
4926                    tonic::Status::unknown(
4927                        format!("Service was not ready: {}", e.into()),
4928                    )
4929                })?;
4930            let codec = tonic_prost::ProstCodec::default();
4931            let path = http::uri::PathAndQuery::from_static(
4932                "/v1.DiscoverGRPC/ReportServiceContract",
4933            );
4934            let mut req = request.into_request();
4935            req.extensions_mut()
4936                .insert(GrpcMethod::new("v1.DiscoverGRPC", "ReportServiceContract"));
4937            self.inner.unary(req, path, codec).await
4938        }
4939    }
4940}
4941/// Generated server implementations.
4942pub mod discover_grpc_server {
4943    #![allow(
4944        unused_variables,
4945        dead_code,
4946        missing_docs,
4947        clippy::wildcard_imports,
4948        clippy::let_unit_value,
4949    )]
4950    use tonic::codegen::*;
4951    /// Generated trait containing gRPC methods that should be implemented for use with DiscoverGrpcServer.
4952    #[async_trait]
4953    pub trait DiscoverGrpc: std::marker::Send + std::marker::Sync + 'static {
4954        /// 客户端上报
4955        async fn report_client(
4956            &self,
4957            request: tonic::Request<super::Client>,
4958        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
4959        /// 被调方注册服务实例
4960        async fn register_instance(
4961            &self,
4962            request: tonic::Request<super::Instance>,
4963        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
4964        /// 被调方反注册服务实例
4965        async fn deregister_instance(
4966            &self,
4967            request: tonic::Request<super::Instance>,
4968        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
4969        /// Server streaming response type for the Discover method.
4970        type DiscoverStream: tonic::codegen::tokio_stream::Stream<
4971                Item = std::result::Result<super::DiscoverResponse, tonic::Status>,
4972            >
4973            + std::marker::Send
4974            + 'static;
4975        /// 统一发现接口
4976        async fn discover(
4977            &self,
4978            request: tonic::Request<tonic::Streaming<super::DiscoverRequest>>,
4979        ) -> std::result::Result<tonic::Response<Self::DiscoverStream>, tonic::Status>;
4980        /// Server streaming response type for the Heartbeat method.
4981        type HeartbeatStream: tonic::codegen::tokio_stream::Stream<
4982                Item = std::result::Result<super::HeartbeatsResponse, tonic::Status>,
4983            >
4984            + std::marker::Send
4985            + 'static;
4986        /// 被调方批量上报心跳
4987        async fn heartbeat(
4988            &self,
4989            request: tonic::Request<tonic::Streaming<super::HeartbeatsRequest>>,
4990        ) -> std::result::Result<tonic::Response<Self::HeartbeatStream>, tonic::Status>;
4991        /// 上报服务契约
4992        async fn report_service_contract(
4993            &self,
4994            request: tonic::Request<super::ServiceContract>,
4995        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
4996    }
4997    #[derive(Debug)]
4998    pub struct DiscoverGrpcServer<T> {
4999        inner: Arc<T>,
5000        accept_compression_encodings: EnabledCompressionEncodings,
5001        send_compression_encodings: EnabledCompressionEncodings,
5002        max_decoding_message_size: Option<usize>,
5003        max_encoding_message_size: Option<usize>,
5004    }
5005    impl<T> DiscoverGrpcServer<T> {
5006        pub fn new(inner: T) -> Self {
5007            Self::from_arc(Arc::new(inner))
5008        }
5009        pub fn from_arc(inner: Arc<T>) -> Self {
5010            Self {
5011                inner,
5012                accept_compression_encodings: Default::default(),
5013                send_compression_encodings: Default::default(),
5014                max_decoding_message_size: None,
5015                max_encoding_message_size: None,
5016            }
5017        }
5018        pub fn with_interceptor<F>(
5019            inner: T,
5020            interceptor: F,
5021        ) -> InterceptedService<Self, F>
5022        where
5023            F: tonic::service::Interceptor,
5024        {
5025            InterceptedService::new(Self::new(inner), interceptor)
5026        }
5027        /// Enable decompressing requests with the given encoding.
5028        #[must_use]
5029        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5030            self.accept_compression_encodings.enable(encoding);
5031            self
5032        }
5033        /// Compress responses with the given encoding, if the client supports it.
5034        #[must_use]
5035        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5036            self.send_compression_encodings.enable(encoding);
5037            self
5038        }
5039        /// Limits the maximum size of a decoded message.
5040        ///
5041        /// Default: `4MB`
5042        #[must_use]
5043        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5044            self.max_decoding_message_size = Some(limit);
5045            self
5046        }
5047        /// Limits the maximum size of an encoded message.
5048        ///
5049        /// Default: `usize::MAX`
5050        #[must_use]
5051        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5052            self.max_encoding_message_size = Some(limit);
5053            self
5054        }
5055    }
5056    impl<T, B> tonic::codegen::Service<http::Request<B>> for DiscoverGrpcServer<T>
5057    where
5058        T: DiscoverGrpc,
5059        B: Body + std::marker::Send + 'static,
5060        B::Error: Into<StdError> + std::marker::Send + 'static,
5061    {
5062        type Response = http::Response<tonic::body::Body>;
5063        type Error = std::convert::Infallible;
5064        type Future = BoxFuture<Self::Response, Self::Error>;
5065        fn poll_ready(
5066            &mut self,
5067            _cx: &mut Context<'_>,
5068        ) -> Poll<std::result::Result<(), Self::Error>> {
5069            Poll::Ready(Ok(()))
5070        }
5071        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5072            match req.uri().path() {
5073                "/v1.DiscoverGRPC/ReportClient" => {
5074                    #[allow(non_camel_case_types)]
5075                    struct ReportClientSvc<T: DiscoverGrpc>(pub Arc<T>);
5076                    impl<T: DiscoverGrpc> tonic::server::UnaryService<super::Client>
5077                    for ReportClientSvc<T> {
5078                        type Response = super::Response;
5079                        type Future = BoxFuture<
5080                            tonic::Response<Self::Response>,
5081                            tonic::Status,
5082                        >;
5083                        fn call(
5084                            &mut self,
5085                            request: tonic::Request<super::Client>,
5086                        ) -> Self::Future {
5087                            let inner = Arc::clone(&self.0);
5088                            let fut = async move {
5089                                <T as DiscoverGrpc>::report_client(&inner, request).await
5090                            };
5091                            Box::pin(fut)
5092                        }
5093                    }
5094                    let accept_compression_encodings = self.accept_compression_encodings;
5095                    let send_compression_encodings = self.send_compression_encodings;
5096                    let max_decoding_message_size = self.max_decoding_message_size;
5097                    let max_encoding_message_size = self.max_encoding_message_size;
5098                    let inner = self.inner.clone();
5099                    let fut = async move {
5100                        let method = ReportClientSvc(inner);
5101                        let codec = tonic_prost::ProstCodec::default();
5102                        let mut grpc = tonic::server::Grpc::new(codec)
5103                            .apply_compression_config(
5104                                accept_compression_encodings,
5105                                send_compression_encodings,
5106                            )
5107                            .apply_max_message_size_config(
5108                                max_decoding_message_size,
5109                                max_encoding_message_size,
5110                            );
5111                        let res = grpc.unary(method, req).await;
5112                        Ok(res)
5113                    };
5114                    Box::pin(fut)
5115                }
5116                "/v1.DiscoverGRPC/RegisterInstance" => {
5117                    #[allow(non_camel_case_types)]
5118                    struct RegisterInstanceSvc<T: DiscoverGrpc>(pub Arc<T>);
5119                    impl<T: DiscoverGrpc> tonic::server::UnaryService<super::Instance>
5120                    for RegisterInstanceSvc<T> {
5121                        type Response = super::Response;
5122                        type Future = BoxFuture<
5123                            tonic::Response<Self::Response>,
5124                            tonic::Status,
5125                        >;
5126                        fn call(
5127                            &mut self,
5128                            request: tonic::Request<super::Instance>,
5129                        ) -> Self::Future {
5130                            let inner = Arc::clone(&self.0);
5131                            let fut = async move {
5132                                <T as DiscoverGrpc>::register_instance(&inner, request)
5133                                    .await
5134                            };
5135                            Box::pin(fut)
5136                        }
5137                    }
5138                    let accept_compression_encodings = self.accept_compression_encodings;
5139                    let send_compression_encodings = self.send_compression_encodings;
5140                    let max_decoding_message_size = self.max_decoding_message_size;
5141                    let max_encoding_message_size = self.max_encoding_message_size;
5142                    let inner = self.inner.clone();
5143                    let fut = async move {
5144                        let method = RegisterInstanceSvc(inner);
5145                        let codec = tonic_prost::ProstCodec::default();
5146                        let mut grpc = tonic::server::Grpc::new(codec)
5147                            .apply_compression_config(
5148                                accept_compression_encodings,
5149                                send_compression_encodings,
5150                            )
5151                            .apply_max_message_size_config(
5152                                max_decoding_message_size,
5153                                max_encoding_message_size,
5154                            );
5155                        let res = grpc.unary(method, req).await;
5156                        Ok(res)
5157                    };
5158                    Box::pin(fut)
5159                }
5160                "/v1.DiscoverGRPC/DeregisterInstance" => {
5161                    #[allow(non_camel_case_types)]
5162                    struct DeregisterInstanceSvc<T: DiscoverGrpc>(pub Arc<T>);
5163                    impl<T: DiscoverGrpc> tonic::server::UnaryService<super::Instance>
5164                    for DeregisterInstanceSvc<T> {
5165                        type Response = super::Response;
5166                        type Future = BoxFuture<
5167                            tonic::Response<Self::Response>,
5168                            tonic::Status,
5169                        >;
5170                        fn call(
5171                            &mut self,
5172                            request: tonic::Request<super::Instance>,
5173                        ) -> Self::Future {
5174                            let inner = Arc::clone(&self.0);
5175                            let fut = async move {
5176                                <T as DiscoverGrpc>::deregister_instance(&inner, request)
5177                                    .await
5178                            };
5179                            Box::pin(fut)
5180                        }
5181                    }
5182                    let accept_compression_encodings = self.accept_compression_encodings;
5183                    let send_compression_encodings = self.send_compression_encodings;
5184                    let max_decoding_message_size = self.max_decoding_message_size;
5185                    let max_encoding_message_size = self.max_encoding_message_size;
5186                    let inner = self.inner.clone();
5187                    let fut = async move {
5188                        let method = DeregisterInstanceSvc(inner);
5189                        let codec = tonic_prost::ProstCodec::default();
5190                        let mut grpc = tonic::server::Grpc::new(codec)
5191                            .apply_compression_config(
5192                                accept_compression_encodings,
5193                                send_compression_encodings,
5194                            )
5195                            .apply_max_message_size_config(
5196                                max_decoding_message_size,
5197                                max_encoding_message_size,
5198                            );
5199                        let res = grpc.unary(method, req).await;
5200                        Ok(res)
5201                    };
5202                    Box::pin(fut)
5203                }
5204                "/v1.DiscoverGRPC/Discover" => {
5205                    #[allow(non_camel_case_types)]
5206                    struct DiscoverSvc<T: DiscoverGrpc>(pub Arc<T>);
5207                    impl<
5208                        T: DiscoverGrpc,
5209                    > tonic::server::StreamingService<super::DiscoverRequest>
5210                    for DiscoverSvc<T> {
5211                        type Response = super::DiscoverResponse;
5212                        type ResponseStream = T::DiscoverStream;
5213                        type Future = BoxFuture<
5214                            tonic::Response<Self::ResponseStream>,
5215                            tonic::Status,
5216                        >;
5217                        fn call(
5218                            &mut self,
5219                            request: tonic::Request<
5220                                tonic::Streaming<super::DiscoverRequest>,
5221                            >,
5222                        ) -> Self::Future {
5223                            let inner = Arc::clone(&self.0);
5224                            let fut = async move {
5225                                <T as DiscoverGrpc>::discover(&inner, request).await
5226                            };
5227                            Box::pin(fut)
5228                        }
5229                    }
5230                    let accept_compression_encodings = self.accept_compression_encodings;
5231                    let send_compression_encodings = self.send_compression_encodings;
5232                    let max_decoding_message_size = self.max_decoding_message_size;
5233                    let max_encoding_message_size = self.max_encoding_message_size;
5234                    let inner = self.inner.clone();
5235                    let fut = async move {
5236                        let method = DiscoverSvc(inner);
5237                        let codec = tonic_prost::ProstCodec::default();
5238                        let mut grpc = tonic::server::Grpc::new(codec)
5239                            .apply_compression_config(
5240                                accept_compression_encodings,
5241                                send_compression_encodings,
5242                            )
5243                            .apply_max_message_size_config(
5244                                max_decoding_message_size,
5245                                max_encoding_message_size,
5246                            );
5247                        let res = grpc.streaming(method, req).await;
5248                        Ok(res)
5249                    };
5250                    Box::pin(fut)
5251                }
5252                "/v1.DiscoverGRPC/Heartbeat" => {
5253                    #[allow(non_camel_case_types)]
5254                    struct HeartbeatSvc<T: DiscoverGrpc>(pub Arc<T>);
5255                    impl<
5256                        T: DiscoverGrpc,
5257                    > tonic::server::StreamingService<super::HeartbeatsRequest>
5258                    for HeartbeatSvc<T> {
5259                        type Response = super::HeartbeatsResponse;
5260                        type ResponseStream = T::HeartbeatStream;
5261                        type Future = BoxFuture<
5262                            tonic::Response<Self::ResponseStream>,
5263                            tonic::Status,
5264                        >;
5265                        fn call(
5266                            &mut self,
5267                            request: tonic::Request<
5268                                tonic::Streaming<super::HeartbeatsRequest>,
5269                            >,
5270                        ) -> Self::Future {
5271                            let inner = Arc::clone(&self.0);
5272                            let fut = async move {
5273                                <T as DiscoverGrpc>::heartbeat(&inner, request).await
5274                            };
5275                            Box::pin(fut)
5276                        }
5277                    }
5278                    let accept_compression_encodings = self.accept_compression_encodings;
5279                    let send_compression_encodings = self.send_compression_encodings;
5280                    let max_decoding_message_size = self.max_decoding_message_size;
5281                    let max_encoding_message_size = self.max_encoding_message_size;
5282                    let inner = self.inner.clone();
5283                    let fut = async move {
5284                        let method = HeartbeatSvc(inner);
5285                        let codec = tonic_prost::ProstCodec::default();
5286                        let mut grpc = tonic::server::Grpc::new(codec)
5287                            .apply_compression_config(
5288                                accept_compression_encodings,
5289                                send_compression_encodings,
5290                            )
5291                            .apply_max_message_size_config(
5292                                max_decoding_message_size,
5293                                max_encoding_message_size,
5294                            );
5295                        let res = grpc.streaming(method, req).await;
5296                        Ok(res)
5297                    };
5298                    Box::pin(fut)
5299                }
5300                "/v1.DiscoverGRPC/ReportServiceContract" => {
5301                    #[allow(non_camel_case_types)]
5302                    struct ReportServiceContractSvc<T: DiscoverGrpc>(pub Arc<T>);
5303                    impl<
5304                        T: DiscoverGrpc,
5305                    > tonic::server::UnaryService<super::ServiceContract>
5306                    for ReportServiceContractSvc<T> {
5307                        type Response = super::Response;
5308                        type Future = BoxFuture<
5309                            tonic::Response<Self::Response>,
5310                            tonic::Status,
5311                        >;
5312                        fn call(
5313                            &mut self,
5314                            request: tonic::Request<super::ServiceContract>,
5315                        ) -> Self::Future {
5316                            let inner = Arc::clone(&self.0);
5317                            let fut = async move {
5318                                <T as DiscoverGrpc>::report_service_contract(
5319                                        &inner,
5320                                        request,
5321                                    )
5322                                    .await
5323                            };
5324                            Box::pin(fut)
5325                        }
5326                    }
5327                    let accept_compression_encodings = self.accept_compression_encodings;
5328                    let send_compression_encodings = self.send_compression_encodings;
5329                    let max_decoding_message_size = self.max_decoding_message_size;
5330                    let max_encoding_message_size = self.max_encoding_message_size;
5331                    let inner = self.inner.clone();
5332                    let fut = async move {
5333                        let method = ReportServiceContractSvc(inner);
5334                        let codec = tonic_prost::ProstCodec::default();
5335                        let mut grpc = tonic::server::Grpc::new(codec)
5336                            .apply_compression_config(
5337                                accept_compression_encodings,
5338                                send_compression_encodings,
5339                            )
5340                            .apply_max_message_size_config(
5341                                max_decoding_message_size,
5342                                max_encoding_message_size,
5343                            );
5344                        let res = grpc.unary(method, req).await;
5345                        Ok(res)
5346                    };
5347                    Box::pin(fut)
5348                }
5349                _ => {
5350                    Box::pin(async move {
5351                        let mut response = http::Response::new(
5352                            tonic::body::Body::default(),
5353                        );
5354                        let headers = response.headers_mut();
5355                        headers
5356                            .insert(
5357                                tonic::Status::GRPC_STATUS,
5358                                (tonic::Code::Unimplemented as i32).into(),
5359                            );
5360                        headers
5361                            .insert(
5362                                http::header::CONTENT_TYPE,
5363                                tonic::metadata::GRPC_CONTENT_TYPE,
5364                            );
5365                        Ok(response)
5366                    })
5367                }
5368            }
5369        }
5370    }
5371    impl<T> Clone for DiscoverGrpcServer<T> {
5372        fn clone(&self) -> Self {
5373            let inner = self.inner.clone();
5374            Self {
5375                inner,
5376                accept_compression_encodings: self.accept_compression_encodings,
5377                send_compression_encodings: self.send_compression_encodings,
5378                max_decoding_message_size: self.max_decoding_message_size,
5379                max_encoding_message_size: self.max_encoding_message_size,
5380            }
5381        }
5382    }
5383    /// Generated gRPC service name
5384    pub const SERVICE_NAME: &str = "v1.DiscoverGRPC";
5385    impl<T> tonic::server::NamedService for DiscoverGrpcServer<T> {
5386        const NAME: &'static str = SERVICE_NAME;
5387    }
5388}
5389/// Generated client implementations.
5390pub mod pole_heartbeat_grpc_client {
5391    #![allow(
5392        unused_variables,
5393        dead_code,
5394        missing_docs,
5395        clippy::wildcard_imports,
5396        clippy::let_unit_value,
5397    )]
5398    use tonic::codegen::*;
5399    use tonic::codegen::http::Uri;
5400    #[derive(Debug, Clone)]
5401    pub struct PoleHeartbeatGrpcClient<T> {
5402        inner: tonic::client::Grpc<T>,
5403    }
5404    impl PoleHeartbeatGrpcClient<tonic::transport::Channel> {
5405        /// Attempt to create a new client by connecting to a given endpoint.
5406        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5407        where
5408            D: TryInto<tonic::transport::Endpoint>,
5409            D::Error: Into<StdError>,
5410        {
5411            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5412            Ok(Self::new(conn))
5413        }
5414    }
5415    impl<T> PoleHeartbeatGrpcClient<T>
5416    where
5417        T: tonic::client::GrpcService<tonic::body::Body>,
5418        T::Error: Into<StdError>,
5419        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5420        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5421    {
5422        pub fn new(inner: T) -> Self {
5423            let inner = tonic::client::Grpc::new(inner);
5424            Self { inner }
5425        }
5426        pub fn with_origin(inner: T, origin: Uri) -> Self {
5427            let inner = tonic::client::Grpc::with_origin(inner, origin);
5428            Self { inner }
5429        }
5430        pub fn with_interceptor<F>(
5431            inner: T,
5432            interceptor: F,
5433        ) -> PoleHeartbeatGrpcClient<InterceptedService<T, F>>
5434        where
5435            F: tonic::service::Interceptor,
5436            T::ResponseBody: Default,
5437            T: tonic::codegen::Service<
5438                http::Request<tonic::body::Body>,
5439                Response = http::Response<
5440                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5441                >,
5442            >,
5443            <T as tonic::codegen::Service<
5444                http::Request<tonic::body::Body>,
5445            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5446        {
5447            PoleHeartbeatGrpcClient::new(InterceptedService::new(inner, interceptor))
5448        }
5449        /// Compress requests with the given encoding.
5450        ///
5451        /// This requires the server to support it otherwise it might respond with an
5452        /// error.
5453        #[must_use]
5454        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5455            self.inner = self.inner.send_compressed(encoding);
5456            self
5457        }
5458        /// Enable decompressing responses.
5459        #[must_use]
5460        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5461            self.inner = self.inner.accept_compressed(encoding);
5462            self
5463        }
5464        /// Limits the maximum size of a decoded message.
5465        ///
5466        /// Default: `4MB`
5467        #[must_use]
5468        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5469            self.inner = self.inner.max_decoding_message_size(limit);
5470            self
5471        }
5472        /// Limits the maximum size of an encoded message.
5473        ///
5474        /// Default: `usize::MAX`
5475        #[must_use]
5476        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5477            self.inner = self.inner.max_encoding_message_size(limit);
5478            self
5479        }
5480        /// 批量获取心跳记录
5481        pub async fn batch_get_heartbeat(
5482            &mut self,
5483            request: impl tonic::IntoRequest<super::GetHeartbeatsRequest>,
5484        ) -> std::result::Result<
5485            tonic::Response<super::GetHeartbeatsResponse>,
5486            tonic::Status,
5487        > {
5488            self.inner
5489                .ready()
5490                .await
5491                .map_err(|e| {
5492                    tonic::Status::unknown(
5493                        format!("Service was not ready: {}", e.into()),
5494                    )
5495                })?;
5496            let codec = tonic_prost::ProstCodec::default();
5497            let path = http::uri::PathAndQuery::from_static(
5498                "/v1.PoleHeartbeatGRPC/BatchGetHeartbeat",
5499            );
5500            let mut req = request.into_request();
5501            req.extensions_mut()
5502                .insert(GrpcMethod::new("v1.PoleHeartbeatGRPC", "BatchGetHeartbeat"));
5503            self.inner.unary(req, path, codec).await
5504        }
5505        /// 批量删除心跳记录
5506        pub async fn batch_del_heartbeat(
5507            &mut self,
5508            request: impl tonic::IntoRequest<super::DelHeartbeatsRequest>,
5509        ) -> std::result::Result<
5510            tonic::Response<super::DelHeartbeatsResponse>,
5511            tonic::Status,
5512        > {
5513            self.inner
5514                .ready()
5515                .await
5516                .map_err(|e| {
5517                    tonic::Status::unknown(
5518                        format!("Service was not ready: {}", e.into()),
5519                    )
5520                })?;
5521            let codec = tonic_prost::ProstCodec::default();
5522            let path = http::uri::PathAndQuery::from_static(
5523                "/v1.PoleHeartbeatGRPC/BatchDelHeartbeat",
5524            );
5525            let mut req = request.into_request();
5526            req.extensions_mut()
5527                .insert(GrpcMethod::new("v1.PoleHeartbeatGRPC", "BatchDelHeartbeat"));
5528            self.inner.unary(req, path, codec).await
5529        }
5530    }
5531}
5532/// Generated server implementations.
5533pub mod pole_heartbeat_grpc_server {
5534    #![allow(
5535        unused_variables,
5536        dead_code,
5537        missing_docs,
5538        clippy::wildcard_imports,
5539        clippy::let_unit_value,
5540    )]
5541    use tonic::codegen::*;
5542    /// Generated trait containing gRPC methods that should be implemented for use with PoleHeartbeatGrpcServer.
5543    #[async_trait]
5544    pub trait PoleHeartbeatGrpc: std::marker::Send + std::marker::Sync + 'static {
5545        /// 批量获取心跳记录
5546        async fn batch_get_heartbeat(
5547            &self,
5548            request: tonic::Request<super::GetHeartbeatsRequest>,
5549        ) -> std::result::Result<
5550            tonic::Response<super::GetHeartbeatsResponse>,
5551            tonic::Status,
5552        >;
5553        /// 批量删除心跳记录
5554        async fn batch_del_heartbeat(
5555            &self,
5556            request: tonic::Request<super::DelHeartbeatsRequest>,
5557        ) -> std::result::Result<
5558            tonic::Response<super::DelHeartbeatsResponse>,
5559            tonic::Status,
5560        >;
5561    }
5562    #[derive(Debug)]
5563    pub struct PoleHeartbeatGrpcServer<T> {
5564        inner: Arc<T>,
5565        accept_compression_encodings: EnabledCompressionEncodings,
5566        send_compression_encodings: EnabledCompressionEncodings,
5567        max_decoding_message_size: Option<usize>,
5568        max_encoding_message_size: Option<usize>,
5569    }
5570    impl<T> PoleHeartbeatGrpcServer<T> {
5571        pub fn new(inner: T) -> Self {
5572            Self::from_arc(Arc::new(inner))
5573        }
5574        pub fn from_arc(inner: Arc<T>) -> Self {
5575            Self {
5576                inner,
5577                accept_compression_encodings: Default::default(),
5578                send_compression_encodings: Default::default(),
5579                max_decoding_message_size: None,
5580                max_encoding_message_size: None,
5581            }
5582        }
5583        pub fn with_interceptor<F>(
5584            inner: T,
5585            interceptor: F,
5586        ) -> InterceptedService<Self, F>
5587        where
5588            F: tonic::service::Interceptor,
5589        {
5590            InterceptedService::new(Self::new(inner), interceptor)
5591        }
5592        /// Enable decompressing requests with the given encoding.
5593        #[must_use]
5594        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5595            self.accept_compression_encodings.enable(encoding);
5596            self
5597        }
5598        /// Compress responses with the given encoding, if the client supports it.
5599        #[must_use]
5600        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5601            self.send_compression_encodings.enable(encoding);
5602            self
5603        }
5604        /// Limits the maximum size of a decoded message.
5605        ///
5606        /// Default: `4MB`
5607        #[must_use]
5608        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5609            self.max_decoding_message_size = Some(limit);
5610            self
5611        }
5612        /// Limits the maximum size of an encoded message.
5613        ///
5614        /// Default: `usize::MAX`
5615        #[must_use]
5616        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5617            self.max_encoding_message_size = Some(limit);
5618            self
5619        }
5620    }
5621    impl<T, B> tonic::codegen::Service<http::Request<B>> for PoleHeartbeatGrpcServer<T>
5622    where
5623        T: PoleHeartbeatGrpc,
5624        B: Body + std::marker::Send + 'static,
5625        B::Error: Into<StdError> + std::marker::Send + 'static,
5626    {
5627        type Response = http::Response<tonic::body::Body>;
5628        type Error = std::convert::Infallible;
5629        type Future = BoxFuture<Self::Response, Self::Error>;
5630        fn poll_ready(
5631            &mut self,
5632            _cx: &mut Context<'_>,
5633        ) -> Poll<std::result::Result<(), Self::Error>> {
5634            Poll::Ready(Ok(()))
5635        }
5636        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5637            match req.uri().path() {
5638                "/v1.PoleHeartbeatGRPC/BatchGetHeartbeat" => {
5639                    #[allow(non_camel_case_types)]
5640                    struct BatchGetHeartbeatSvc<T: PoleHeartbeatGrpc>(pub Arc<T>);
5641                    impl<
5642                        T: PoleHeartbeatGrpc,
5643                    > tonic::server::UnaryService<super::GetHeartbeatsRequest>
5644                    for BatchGetHeartbeatSvc<T> {
5645                        type Response = super::GetHeartbeatsResponse;
5646                        type Future = BoxFuture<
5647                            tonic::Response<Self::Response>,
5648                            tonic::Status,
5649                        >;
5650                        fn call(
5651                            &mut self,
5652                            request: tonic::Request<super::GetHeartbeatsRequest>,
5653                        ) -> Self::Future {
5654                            let inner = Arc::clone(&self.0);
5655                            let fut = async move {
5656                                <T as PoleHeartbeatGrpc>::batch_get_heartbeat(
5657                                        &inner,
5658                                        request,
5659                                    )
5660                                    .await
5661                            };
5662                            Box::pin(fut)
5663                        }
5664                    }
5665                    let accept_compression_encodings = self.accept_compression_encodings;
5666                    let send_compression_encodings = self.send_compression_encodings;
5667                    let max_decoding_message_size = self.max_decoding_message_size;
5668                    let max_encoding_message_size = self.max_encoding_message_size;
5669                    let inner = self.inner.clone();
5670                    let fut = async move {
5671                        let method = BatchGetHeartbeatSvc(inner);
5672                        let codec = tonic_prost::ProstCodec::default();
5673                        let mut grpc = tonic::server::Grpc::new(codec)
5674                            .apply_compression_config(
5675                                accept_compression_encodings,
5676                                send_compression_encodings,
5677                            )
5678                            .apply_max_message_size_config(
5679                                max_decoding_message_size,
5680                                max_encoding_message_size,
5681                            );
5682                        let res = grpc.unary(method, req).await;
5683                        Ok(res)
5684                    };
5685                    Box::pin(fut)
5686                }
5687                "/v1.PoleHeartbeatGRPC/BatchDelHeartbeat" => {
5688                    #[allow(non_camel_case_types)]
5689                    struct BatchDelHeartbeatSvc<T: PoleHeartbeatGrpc>(pub Arc<T>);
5690                    impl<
5691                        T: PoleHeartbeatGrpc,
5692                    > tonic::server::UnaryService<super::DelHeartbeatsRequest>
5693                    for BatchDelHeartbeatSvc<T> {
5694                        type Response = super::DelHeartbeatsResponse;
5695                        type Future = BoxFuture<
5696                            tonic::Response<Self::Response>,
5697                            tonic::Status,
5698                        >;
5699                        fn call(
5700                            &mut self,
5701                            request: tonic::Request<super::DelHeartbeatsRequest>,
5702                        ) -> Self::Future {
5703                            let inner = Arc::clone(&self.0);
5704                            let fut = async move {
5705                                <T as PoleHeartbeatGrpc>::batch_del_heartbeat(
5706                                        &inner,
5707                                        request,
5708                                    )
5709                                    .await
5710                            };
5711                            Box::pin(fut)
5712                        }
5713                    }
5714                    let accept_compression_encodings = self.accept_compression_encodings;
5715                    let send_compression_encodings = self.send_compression_encodings;
5716                    let max_decoding_message_size = self.max_decoding_message_size;
5717                    let max_encoding_message_size = self.max_encoding_message_size;
5718                    let inner = self.inner.clone();
5719                    let fut = async move {
5720                        let method = BatchDelHeartbeatSvc(inner);
5721                        let codec = tonic_prost::ProstCodec::default();
5722                        let mut grpc = tonic::server::Grpc::new(codec)
5723                            .apply_compression_config(
5724                                accept_compression_encodings,
5725                                send_compression_encodings,
5726                            )
5727                            .apply_max_message_size_config(
5728                                max_decoding_message_size,
5729                                max_encoding_message_size,
5730                            );
5731                        let res = grpc.unary(method, req).await;
5732                        Ok(res)
5733                    };
5734                    Box::pin(fut)
5735                }
5736                _ => {
5737                    Box::pin(async move {
5738                        let mut response = http::Response::new(
5739                            tonic::body::Body::default(),
5740                        );
5741                        let headers = response.headers_mut();
5742                        headers
5743                            .insert(
5744                                tonic::Status::GRPC_STATUS,
5745                                (tonic::Code::Unimplemented as i32).into(),
5746                            );
5747                        headers
5748                            .insert(
5749                                http::header::CONTENT_TYPE,
5750                                tonic::metadata::GRPC_CONTENT_TYPE,
5751                            );
5752                        Ok(response)
5753                    })
5754                }
5755            }
5756        }
5757    }
5758    impl<T> Clone for PoleHeartbeatGrpcServer<T> {
5759        fn clone(&self) -> Self {
5760            let inner = self.inner.clone();
5761            Self {
5762                inner,
5763                accept_compression_encodings: self.accept_compression_encodings,
5764                send_compression_encodings: self.send_compression_encodings,
5765                max_decoding_message_size: self.max_decoding_message_size,
5766                max_encoding_message_size: self.max_encoding_message_size,
5767            }
5768        }
5769    }
5770    /// Generated gRPC service name
5771    pub const SERVICE_NAME: &str = "v1.PoleHeartbeatGRPC";
5772    impl<T> tonic::server::NamedService for PoleHeartbeatGrpcServer<T> {
5773        const NAME: &'static str = SERVICE_NAME;
5774    }
5775}