Skip to main content

pole_specification/
v1.rs

1// This file is @generated by prost-build.
2#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3#[repr(i32)]
4pub enum Code {
5    /// base module status codes
6    Unknown = 0,
7    ExecuteSuccess = 200000,
8    DataNoChange = 200001,
9    NoNeedUpdate = 200002,
10    BadRequest = 400000,
11    ParseException = 400001,
12    EmptyRequest = 400002,
13    BatchSizeOverLimit = 400003,
14    InvalidDiscoverResource = 400004,
15    InvalidRequestId = 400100,
16    InvalidUserName = 400101,
17    InvalidUserToken = 400102,
18    InvalidParameter = 400103,
19    EmptyQueryParameter = 400104,
20    InvalidQueryInsParameter = 400105,
21    HealthCheckNotOpen = 400140,
22    HeartbeatOnDisabledIns = 400141,
23    HeartbeatExceedLimit = 400142,
24    HeartbeatTypeNotFound = 400143,
25    InvalidMetadata = 400150,
26    InvalidMatchRule = 400904,
27    InvalidWorkloadCredentialRequest = 400910,
28    /// network relative codes
29    ServicesExistedMesh = 400170,
30    ResourcesExistedMesh = 400171,
31    InvalidMeshParameter = 400172,
32    ExistedResource = 400201,
33    NamespaceExistedServices = 400203,
34    ServiceExistedInstances = 400204,
35    ServiceExistedRoutings = 400205,
36    ServiceExistedRateLimits = 400206,
37    ExistReleasedConfig = 400207,
38    SameInstanceRequest = 400208,
39    ServiceExistedCircuitBreakers = 400209,
40    ServiceExistedAlias = 400210,
41    NamespaceExistedMeshResources = 400211,
42    NamespaceExistedCircuitBreakers = 400212,
43    ServiceSubscribedByMeshes = 400213,
44    ServiceExistedFluxRateLimits = 400214,
45    NamespaceExistedConfigGroups = 400219,
46    NamespaceExistedGovernanceRules = 400220,
47    ClientApiNotOpen = 400401,
48    NotFoundResource = 404202,
49    Unauthorized = 401000,
50    NotAllowedAccess = 401001,
51    CmdbNotFindHost = 404001,
52    DataConflict = 409000,
53    InstanceTooManyRequests = 429001,
54    IpRateLimit = 429002,
55    ApiRateLimit = 403003,
56    ExecuteException = 500000,
57    StoreLayerException = 500001,
58    CmdbPluginException = 500002,
59    HeartbeatException = 500007,
60    InstanceRegisTimeout = 500008,
61    /// config center status codes
62    EncryptConfigFileException = 400809,
63    GroupExistActiveRelease = 400810,
64    DecryptConfigFileException = 400811,
65    /// auth codes
66    InvalidUserOwners = 400410,
67    InvalidUserId = 400411,
68    InvalidUserPassword = 400412,
69    InvalidUserGroupOwners = 400420,
70    InvalidUserGroupId = 400421,
71    InvalidAuthStrategyOwners = 400430,
72    InvalidAuthStrategyName = 400431,
73    InvalidAuthStrategyId = 400432,
74    InvalidPrincipalType = 400440,
75    UserExisted = 400215,
76    UserGroupExisted = 400216,
77    AuthStrategyRuleExisted = 400217,
78    SubAccountExisted = 400218,
79    NotFoundUser = 400312,
80    NotFoundOwnerUser = 400313,
81    NotFoundUserGroup = 400314,
82    NotFoundAuthStrategyRule = 400315,
83    NotAllowModifyDefaultStrategyPrincipal = 400508,
84    NotAllowModifyOwnerDefaultStrategy = 400509,
85    EmptyAutToken = 401002,
86    TokenDisabled = 401003,
87    TokenNotExisted = 401004,
88    InvalidWorkloadCredential = 401010,
89    ExpiredWorkloadCredential = 401011,
90    AuthTokenForbidden = 403001,
91    OperationRoleForbidden = 403002,
92    WorkloadCredentialIssueForbidden = 403010,
93    StaleServiceIdentityRevision = 409010,
94    WorkloadCredentialRateLimited = 429010,
95    WorkloadCredentialIssuerUnavailable = 500010,
96}
97impl Code {
98    /// String value of the enum field names used in the ProtoBuf definition.
99    ///
100    /// The values are not transformed in any way and thus are considered stable
101    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
102    pub fn as_str_name(&self) -> &'static str {
103        match self {
104            Self::Unknown => "Unknown",
105            Self::ExecuteSuccess => "ExecuteSuccess",
106            Self::DataNoChange => "DataNoChange",
107            Self::NoNeedUpdate => "NoNeedUpdate",
108            Self::BadRequest => "BadRequest",
109            Self::ParseException => "ParseException",
110            Self::EmptyRequest => "EmptyRequest",
111            Self::BatchSizeOverLimit => "BatchSizeOverLimit",
112            Self::InvalidDiscoverResource => "InvalidDiscoverResource",
113            Self::InvalidRequestId => "InvalidRequestID",
114            Self::InvalidUserName => "InvalidUserName",
115            Self::InvalidUserToken => "InvalidUserToken",
116            Self::InvalidParameter => "InvalidParameter",
117            Self::EmptyQueryParameter => "EmptyQueryParameter",
118            Self::InvalidQueryInsParameter => "InvalidQueryInsParameter",
119            Self::HealthCheckNotOpen => "HealthCheckNotOpen",
120            Self::HeartbeatOnDisabledIns => "HeartbeatOnDisabledIns",
121            Self::HeartbeatExceedLimit => "HeartbeatExceedLimit",
122            Self::HeartbeatTypeNotFound => "HeartbeatTypeNotFound",
123            Self::InvalidMetadata => "InvalidMetadata",
124            Self::InvalidMatchRule => "InvalidMatchRule",
125            Self::InvalidWorkloadCredentialRequest => "InvalidWorkloadCredentialRequest",
126            Self::ServicesExistedMesh => "ServicesExistedMesh",
127            Self::ResourcesExistedMesh => "ResourcesExistedMesh",
128            Self::InvalidMeshParameter => "InvalidMeshParameter",
129            Self::ExistedResource => "ExistedResource",
130            Self::NamespaceExistedServices => "NamespaceExistedServices",
131            Self::ServiceExistedInstances => "ServiceExistedInstances",
132            Self::ServiceExistedRoutings => "ServiceExistedRoutings",
133            Self::ServiceExistedRateLimits => "ServiceExistedRateLimits",
134            Self::ExistReleasedConfig => "ExistReleasedConfig",
135            Self::SameInstanceRequest => "SameInstanceRequest",
136            Self::ServiceExistedCircuitBreakers => "ServiceExistedCircuitBreakers",
137            Self::ServiceExistedAlias => "ServiceExistedAlias",
138            Self::NamespaceExistedMeshResources => "NamespaceExistedMeshResources",
139            Self::NamespaceExistedCircuitBreakers => "NamespaceExistedCircuitBreakers",
140            Self::ServiceSubscribedByMeshes => "ServiceSubscribedByMeshes",
141            Self::ServiceExistedFluxRateLimits => "ServiceExistedFluxRateLimits",
142            Self::NamespaceExistedConfigGroups => "NamespaceExistedConfigGroups",
143            Self::NamespaceExistedGovernanceRules => "NamespaceExistedGovernanceRules",
144            Self::ClientApiNotOpen => "ClientAPINotOpen",
145            Self::NotFoundResource => "NotFoundResource",
146            Self::Unauthorized => "Unauthorized",
147            Self::NotAllowedAccess => "NotAllowedAccess",
148            Self::CmdbNotFindHost => "CMDBNotFindHost",
149            Self::DataConflict => "DataConflict",
150            Self::InstanceTooManyRequests => "InstanceTooManyRequests",
151            Self::IpRateLimit => "IPRateLimit",
152            Self::ApiRateLimit => "APIRateLimit",
153            Self::ExecuteException => "ExecuteException",
154            Self::StoreLayerException => "StoreLayerException",
155            Self::CmdbPluginException => "CMDBPluginException",
156            Self::HeartbeatException => "HeartbeatException",
157            Self::InstanceRegisTimeout => "InstanceRegisTimeout",
158            Self::EncryptConfigFileException => "EncryptConfigFileException",
159            Self::GroupExistActiveRelease => "GroupExistActiveRelease",
160            Self::DecryptConfigFileException => "DecryptConfigFileException",
161            Self::InvalidUserOwners => "InvalidUserOwners",
162            Self::InvalidUserId => "InvalidUserID",
163            Self::InvalidUserPassword => "InvalidUserPassword",
164            Self::InvalidUserGroupOwners => "InvalidUserGroupOwners",
165            Self::InvalidUserGroupId => "InvalidUserGroupID",
166            Self::InvalidAuthStrategyOwners => "InvalidAuthStrategyOwners",
167            Self::InvalidAuthStrategyName => "InvalidAuthStrategyName",
168            Self::InvalidAuthStrategyId => "InvalidAuthStrategyID",
169            Self::InvalidPrincipalType => "InvalidPrincipalType",
170            Self::UserExisted => "UserExisted",
171            Self::UserGroupExisted => "UserGroupExisted",
172            Self::AuthStrategyRuleExisted => "AuthStrategyRuleExisted",
173            Self::SubAccountExisted => "SubAccountExisted",
174            Self::NotFoundUser => "NotFoundUser",
175            Self::NotFoundOwnerUser => "NotFoundOwnerUser",
176            Self::NotFoundUserGroup => "NotFoundUserGroup",
177            Self::NotFoundAuthStrategyRule => "NotFoundAuthStrategyRule",
178            Self::NotAllowModifyDefaultStrategyPrincipal => {
179                "NotAllowModifyDefaultStrategyPrincipal"
180            }
181            Self::NotAllowModifyOwnerDefaultStrategy => {
182                "NotAllowModifyOwnerDefaultStrategy"
183            }
184            Self::EmptyAutToken => "EmptyAutToken",
185            Self::TokenDisabled => "TokenDisabled",
186            Self::TokenNotExisted => "TokenNotExisted",
187            Self::InvalidWorkloadCredential => "InvalidWorkloadCredential",
188            Self::ExpiredWorkloadCredential => "ExpiredWorkloadCredential",
189            Self::AuthTokenForbidden => "AuthTokenForbidden",
190            Self::OperationRoleForbidden => "OperationRoleForbidden",
191            Self::WorkloadCredentialIssueForbidden => "WorkloadCredentialIssueForbidden",
192            Self::StaleServiceIdentityRevision => "StaleServiceIdentityRevision",
193            Self::WorkloadCredentialRateLimited => "WorkloadCredentialRateLimited",
194            Self::WorkloadCredentialIssuerUnavailable => {
195                "WorkloadCredentialIssuerUnavailable"
196            }
197        }
198    }
199    /// Creates an enum from field names used in the ProtoBuf definition.
200    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
201        match value {
202            "Unknown" => Some(Self::Unknown),
203            "ExecuteSuccess" => Some(Self::ExecuteSuccess),
204            "DataNoChange" => Some(Self::DataNoChange),
205            "NoNeedUpdate" => Some(Self::NoNeedUpdate),
206            "BadRequest" => Some(Self::BadRequest),
207            "ParseException" => Some(Self::ParseException),
208            "EmptyRequest" => Some(Self::EmptyRequest),
209            "BatchSizeOverLimit" => Some(Self::BatchSizeOverLimit),
210            "InvalidDiscoverResource" => Some(Self::InvalidDiscoverResource),
211            "InvalidRequestID" => Some(Self::InvalidRequestId),
212            "InvalidUserName" => Some(Self::InvalidUserName),
213            "InvalidUserToken" => Some(Self::InvalidUserToken),
214            "InvalidParameter" => Some(Self::InvalidParameter),
215            "EmptyQueryParameter" => Some(Self::EmptyQueryParameter),
216            "InvalidQueryInsParameter" => Some(Self::InvalidQueryInsParameter),
217            "HealthCheckNotOpen" => Some(Self::HealthCheckNotOpen),
218            "HeartbeatOnDisabledIns" => Some(Self::HeartbeatOnDisabledIns),
219            "HeartbeatExceedLimit" => Some(Self::HeartbeatExceedLimit),
220            "HeartbeatTypeNotFound" => Some(Self::HeartbeatTypeNotFound),
221            "InvalidMetadata" => Some(Self::InvalidMetadata),
222            "InvalidMatchRule" => Some(Self::InvalidMatchRule),
223            "InvalidWorkloadCredentialRequest" => {
224                Some(Self::InvalidWorkloadCredentialRequest)
225            }
226            "ServicesExistedMesh" => Some(Self::ServicesExistedMesh),
227            "ResourcesExistedMesh" => Some(Self::ResourcesExistedMesh),
228            "InvalidMeshParameter" => Some(Self::InvalidMeshParameter),
229            "ExistedResource" => Some(Self::ExistedResource),
230            "NamespaceExistedServices" => Some(Self::NamespaceExistedServices),
231            "ServiceExistedInstances" => Some(Self::ServiceExistedInstances),
232            "ServiceExistedRoutings" => Some(Self::ServiceExistedRoutings),
233            "ServiceExistedRateLimits" => Some(Self::ServiceExistedRateLimits),
234            "ExistReleasedConfig" => Some(Self::ExistReleasedConfig),
235            "SameInstanceRequest" => Some(Self::SameInstanceRequest),
236            "ServiceExistedCircuitBreakers" => Some(Self::ServiceExistedCircuitBreakers),
237            "ServiceExistedAlias" => Some(Self::ServiceExistedAlias),
238            "NamespaceExistedMeshResources" => Some(Self::NamespaceExistedMeshResources),
239            "NamespaceExistedCircuitBreakers" => {
240                Some(Self::NamespaceExistedCircuitBreakers)
241            }
242            "ServiceSubscribedByMeshes" => Some(Self::ServiceSubscribedByMeshes),
243            "ServiceExistedFluxRateLimits" => Some(Self::ServiceExistedFluxRateLimits),
244            "NamespaceExistedConfigGroups" => Some(Self::NamespaceExistedConfigGroups),
245            "NamespaceExistedGovernanceRules" => {
246                Some(Self::NamespaceExistedGovernanceRules)
247            }
248            "ClientAPINotOpen" => Some(Self::ClientApiNotOpen),
249            "NotFoundResource" => Some(Self::NotFoundResource),
250            "Unauthorized" => Some(Self::Unauthorized),
251            "NotAllowedAccess" => Some(Self::NotAllowedAccess),
252            "CMDBNotFindHost" => Some(Self::CmdbNotFindHost),
253            "DataConflict" => Some(Self::DataConflict),
254            "InstanceTooManyRequests" => Some(Self::InstanceTooManyRequests),
255            "IPRateLimit" => Some(Self::IpRateLimit),
256            "APIRateLimit" => Some(Self::ApiRateLimit),
257            "ExecuteException" => Some(Self::ExecuteException),
258            "StoreLayerException" => Some(Self::StoreLayerException),
259            "CMDBPluginException" => Some(Self::CmdbPluginException),
260            "HeartbeatException" => Some(Self::HeartbeatException),
261            "InstanceRegisTimeout" => Some(Self::InstanceRegisTimeout),
262            "EncryptConfigFileException" => Some(Self::EncryptConfigFileException),
263            "GroupExistActiveRelease" => Some(Self::GroupExistActiveRelease),
264            "DecryptConfigFileException" => Some(Self::DecryptConfigFileException),
265            "InvalidUserOwners" => Some(Self::InvalidUserOwners),
266            "InvalidUserID" => Some(Self::InvalidUserId),
267            "InvalidUserPassword" => Some(Self::InvalidUserPassword),
268            "InvalidUserGroupOwners" => Some(Self::InvalidUserGroupOwners),
269            "InvalidUserGroupID" => Some(Self::InvalidUserGroupId),
270            "InvalidAuthStrategyOwners" => Some(Self::InvalidAuthStrategyOwners),
271            "InvalidAuthStrategyName" => Some(Self::InvalidAuthStrategyName),
272            "InvalidAuthStrategyID" => Some(Self::InvalidAuthStrategyId),
273            "InvalidPrincipalType" => Some(Self::InvalidPrincipalType),
274            "UserExisted" => Some(Self::UserExisted),
275            "UserGroupExisted" => Some(Self::UserGroupExisted),
276            "AuthStrategyRuleExisted" => Some(Self::AuthStrategyRuleExisted),
277            "SubAccountExisted" => Some(Self::SubAccountExisted),
278            "NotFoundUser" => Some(Self::NotFoundUser),
279            "NotFoundOwnerUser" => Some(Self::NotFoundOwnerUser),
280            "NotFoundUserGroup" => Some(Self::NotFoundUserGroup),
281            "NotFoundAuthStrategyRule" => Some(Self::NotFoundAuthStrategyRule),
282            "NotAllowModifyDefaultStrategyPrincipal" => {
283                Some(Self::NotAllowModifyDefaultStrategyPrincipal)
284            }
285            "NotAllowModifyOwnerDefaultStrategy" => {
286                Some(Self::NotAllowModifyOwnerDefaultStrategy)
287            }
288            "EmptyAutToken" => Some(Self::EmptyAutToken),
289            "TokenDisabled" => Some(Self::TokenDisabled),
290            "TokenNotExisted" => Some(Self::TokenNotExisted),
291            "InvalidWorkloadCredential" => Some(Self::InvalidWorkloadCredential),
292            "ExpiredWorkloadCredential" => Some(Self::ExpiredWorkloadCredential),
293            "AuthTokenForbidden" => Some(Self::AuthTokenForbidden),
294            "OperationRoleForbidden" => Some(Self::OperationRoleForbidden),
295            "WorkloadCredentialIssueForbidden" => {
296                Some(Self::WorkloadCredentialIssueForbidden)
297            }
298            "StaleServiceIdentityRevision" => Some(Self::StaleServiceIdentityRevision),
299            "WorkloadCredentialRateLimited" => Some(Self::WorkloadCredentialRateLimited),
300            "WorkloadCredentialIssuerUnavailable" => {
301                Some(Self::WorkloadCredentialIssuerUnavailable)
302            }
303            _ => None,
304        }
305    }
306}
307/// 主调服务信息数据
308#[derive(Clone, PartialEq, ::prost::Message)]
309pub struct Caller {
310    #[prost(string, tag = "2")]
311    pub namespace: ::prost::alloc::string::String,
312    #[prost(string, tag = "3")]
313    pub service: ::prost::alloc::string::String,
314    /// 客户端标签
315    #[prost(message, repeated, tag = "10")]
316    pub labels: ::prost::alloc::vec::Vec<ClientLabel>,
317}
318#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
319pub struct Location {
320    #[prost(string, tag = "1")]
321    pub region: ::prost::alloc::string::String,
322    #[prost(string, tag = "2")]
323    pub zone: ::prost::alloc::string::String,
324    #[prost(string, tag = "3")]
325    pub campus: ::prost::alloc::string::String,
326}
327#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
328pub struct MatchString {
329    #[prost(enumeration = "match_string::MatchStringType", tag = "1")]
330    pub r#type: i32,
331    #[prost(string, tag = "2")]
332    pub value: ::prost::alloc::string::String,
333    #[prost(enumeration = "match_string::ValueType", tag = "3")]
334    pub value_type: i32,
335}
336/// Nested message and enum types in `MatchString`.
337pub mod match_string {
338    #[derive(
339        Clone,
340        Copy,
341        Debug,
342        PartialEq,
343        Eq,
344        Hash,
345        PartialOrd,
346        Ord,
347        ::prost::Enumeration
348    )]
349    #[repr(i32)]
350    pub enum MatchStringType {
351        /// Equivalent match
352        Exact = 0,
353        /// Regular match
354        Regex = 1,
355        /// Not equals match
356        NotEquals = 2,
357        /// Include match
358        In = 3,
359        /// Not include match
360        NotIn = 4,
361        /// Range match
362        Range = 5,
363    }
364    impl MatchStringType {
365        /// String value of the enum field names used in the ProtoBuf definition.
366        ///
367        /// The values are not transformed in any way and thus are considered stable
368        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
369        pub fn as_str_name(&self) -> &'static str {
370            match self {
371                Self::Exact => "EXACT",
372                Self::Regex => "REGEX",
373                Self::NotEquals => "NOT_EQUALS",
374                Self::In => "IN",
375                Self::NotIn => "NOT_IN",
376                Self::Range => "RANGE",
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                "EXACT" => Some(Self::Exact),
383                "REGEX" => Some(Self::Regex),
384                "NOT_EQUALS" => Some(Self::NotEquals),
385                "IN" => Some(Self::In),
386                "NOT_IN" => Some(Self::NotIn),
387                "RANGE" => Some(Self::Range),
388                _ => None,
389            }
390        }
391    }
392    #[derive(
393        Clone,
394        Copy,
395        Debug,
396        PartialEq,
397        Eq,
398        Hash,
399        PartialOrd,
400        Ord,
401        ::prost::Enumeration
402    )]
403    #[repr(i32)]
404    pub enum ValueType {
405        Text = 0,
406        Parameter = 1,
407    }
408    impl ValueType {
409        /// String value of the enum field names used in the ProtoBuf definition.
410        ///
411        /// The values are not transformed in any way and thus are considered stable
412        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
413        pub fn as_str_name(&self) -> &'static str {
414            match self {
415                Self::Text => "TEXT",
416                Self::Parameter => "PARAMETER",
417            }
418        }
419        /// Creates an enum from field names used in the ProtoBuf definition.
420        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
421            match value {
422                "TEXT" => Some(Self::Text),
423                "PARAMETER" => Some(Self::Parameter),
424                _ => None,
425            }
426        }
427    }
428}
429#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
430pub struct StringList {
431    #[prost(string, repeated, tag = "1")]
432    pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
433}
434/// 汇总查询数据
435#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
436pub struct Summary {
437    /// 服务总数
438    #[prost(uint32, tag = "1")]
439    pub total_service_count: u32,
440    /// 健康实例总数
441    #[prost(uint32, tag = "2")]
442    pub total_health_instance_count: u32,
443    /// 实例总数
444    #[prost(uint32, tag = "3")]
445    pub total_instance_count: u32,
446}
447#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
448pub struct ClientLabel {
449    #[prost(string, tag = "1")]
450    pub key: ::prost::alloc::string::String,
451    #[prost(message, optional, tag = "2")]
452    pub value: ::core::option::Option<MatchString>,
453}
454/// API统一数据结构
455#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
456pub struct Api {
457    /// API的协议,\*或者为空代表全部
458    #[prost(string, tag = "1")]
459    pub protocol: ::prost::alloc::string::String,
460    /// API的方法,\*或者为空代表全部
461    #[prost(string, tag = "2")]
462    pub method: ::prost::alloc::string::String,
463    /// API的路径,支持多种匹配方式
464    #[prost(message, optional, tag = "3")]
465    pub path: ::core::option::Option<MatchString>,
466}
467/// 治理规则发布请求
468#[derive(Clone, PartialEq, ::prost::Message)]
469pub struct RuleRelease {
470    #[prost(string, tag = "1")]
471    pub id: ::prost::alloc::string::String,
472    #[prost(string, tag = "2")]
473    pub rule_id: ::prost::alloc::string::String,
474    #[prost(string, tag = "3")]
475    pub rule_name: ::prost::alloc::string::String,
476    #[prost(string, tag = "4")]
477    pub release_name: ::prost::alloc::string::String,
478    #[prost(string, tag = "5")]
479    pub description: ::prost::alloc::string::String,
480    #[prost(string, tag = "6")]
481    pub release_type: ::prost::alloc::string::String,
482    #[prost(message, repeated, tag = "7")]
483    pub client_labels: ::prost::alloc::vec::Vec<ClientLabel>,
484    #[prost(uint64, tag = "8")]
485    pub version: u64,
486    #[prost(enumeration = "rule_release::RuleType", tag = "9")]
487    pub resource: i32,
488    #[prost(bool, tag = "10")]
489    pub active: bool,
490    #[prost(string, tag = "20")]
491    pub ctime: ::prost::alloc::string::String,
492    #[prost(string, tag = "21")]
493    pub mtime: ::prost::alloc::string::String,
494}
495/// Nested message and enum types in `RuleRelease`.
496pub mod rule_release {
497    #[derive(
498        Clone,
499        Copy,
500        Debug,
501        PartialEq,
502        Eq,
503        Hash,
504        PartialOrd,
505        Ord,
506        ::prost::Enumeration
507    )]
508    #[repr(i32)]
509    pub enum RuleType {
510        RouteRules = 0,
511        RateLimitRules = 1,
512        CircuitBreakerRules = 2,
513        FaultDetectRules = 3,
514        LaneRules = 4,
515        LosslessRules = 5,
516        TrafficMirrorRules = 6,
517        TrafficSecurityRules = 7,
518        TrafficMockRules = 8,
519    }
520    impl RuleType {
521        /// String value of the enum field names used in the ProtoBuf definition.
522        ///
523        /// The values are not transformed in any way and thus are considered stable
524        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
525        pub fn as_str_name(&self) -> &'static str {
526            match self {
527                Self::RouteRules => "RouteRules",
528                Self::RateLimitRules => "RateLimitRules",
529                Self::CircuitBreakerRules => "CircuitBreakerRules",
530                Self::FaultDetectRules => "FaultDetectRules",
531                Self::LaneRules => "LaneRules",
532                Self::LosslessRules => "LosslessRules",
533                Self::TrafficMirrorRules => "TrafficMirrorRules",
534                Self::TrafficSecurityRules => "TrafficSecurityRules",
535                Self::TrafficMockRules => "TrafficMockRules",
536            }
537        }
538        /// Creates an enum from field names used in the ProtoBuf definition.
539        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
540            match value {
541                "RouteRules" => Some(Self::RouteRules),
542                "RateLimitRules" => Some(Self::RateLimitRules),
543                "CircuitBreakerRules" => Some(Self::CircuitBreakerRules),
544                "FaultDetectRules" => Some(Self::FaultDetectRules),
545                "LaneRules" => Some(Self::LaneRules),
546                "LosslessRules" => Some(Self::LosslessRules),
547                "TrafficMirrorRules" => Some(Self::TrafficMirrorRules),
548                "TrafficSecurityRules" => Some(Self::TrafficSecurityRules),
549                "TrafficMockRules" => Some(Self::TrafficMockRules),
550                _ => None,
551            }
552        }
553    }
554}
555/// configuration root for route
556#[derive(Clone, PartialEq, ::prost::Message)]
557pub struct RouteRule {
558    #[prost(string, tag = "1")]
559    pub id: ::prost::alloc::string::String,
560    /// route rule name
561    #[prost(string, tag = "2")]
562    pub name: ::prost::alloc::string::String,
563    /// Enable this router
564    #[prost(bool, tag = "3")]
565    pub enable: bool,
566    /// Router type
567    #[prost(enumeration = "RoutePolicy", tag = "4")]
568    pub route_policy: i32,
569    /// Routing configuration for router
570    #[prost(message, optional, tag = "5")]
571    pub routing_config: ::core::option::Option<::prost_types::Any>,
572    /// revision routing version
573    #[prost(string, tag = "6")]
574    pub revision: ::prost::alloc::string::String,
575    /// ctime create time of the rules
576    #[prost(string, tag = "7")]
577    pub ctime: ::prost::alloc::string::String,
578    /// mtime modify time of the rules
579    #[prost(string, tag = "8")]
580    pub mtime: ::prost::alloc::string::String,
581    /// etime enable time of the rules
582    #[prost(string, tag = "9")]
583    pub etime: ::prost::alloc::string::String,
584    /// priority rules priority
585    #[prost(uint32, tag = "10")]
586    pub priority: u32,
587    /// description simple description rules
588    #[prost(string, tag = "11")]
589    pub description: ::prost::alloc::string::String,
590    /// 规则标签
591    #[prost(map = "string, string", tag = "12")]
592    pub metadata: ::std::collections::HashMap<
593        ::prost::alloc::string::String,
594        ::prost::alloc::string::String,
595    >,
596    /// 操作标志位
597    #[prost(bool, tag = "13")]
598    pub editable: bool,
599    #[prost(bool, tag = "14")]
600    pub deleteable: bool,
601    /// namespace identifies the environment that owns this rule.
602    #[prost(string, tag = "15")]
603    pub namespace: ::prost::alloc::string::String,
604}
605#[derive(Clone, PartialEq, ::prost::Message)]
606pub struct MetadataFailover {
607    /// failover_range metadata route bottom type
608    #[prost(enumeration = "metadata_failover::FailoverRange", tag = "1")]
609    pub failover_range: i32,
610    /// only use to failover_range == OTHER_KEYS
611    #[prost(map = "string, string", tag = "2")]
612    pub labels: ::std::collections::HashMap<
613        ::prost::alloc::string::String,
614        ::prost::alloc::string::String,
615    >,
616}
617/// Nested message and enum types in `MetadataFailover`.
618pub mod metadata_failover {
619    #[derive(
620        Clone,
621        Copy,
622        Debug,
623        PartialEq,
624        Eq,
625        Hash,
626        PartialOrd,
627        Ord,
628        ::prost::Enumeration
629    )]
630    #[repr(i32)]
631    pub enum FailoverRange {
632        /// ALL return all instances
633        All = 0,
634        /// OTHERS retuen without thie labels instances
635        Others = 1,
636        /// OTHER_KEYS return other instances which match keys
637        OtherKeys = 2,
638    }
639    impl FailoverRange {
640        /// String value of the enum field names used in the ProtoBuf definition.
641        ///
642        /// The values are not transformed in any way and thus are considered stable
643        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
644        pub fn as_str_name(&self) -> &'static str {
645            match self {
646                Self::All => "ALL",
647                Self::Others => "OTHERS",
648                Self::OtherKeys => "OTHER_KEYS",
649            }
650        }
651        /// Creates an enum from field names used in the ProtoBuf definition.
652        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
653            match value {
654                "ALL" => Some(Self::All),
655                "OTHERS" => Some(Self::Others),
656                "OTHER_KEYS" => Some(Self::OtherKeys),
657                _ => None,
658            }
659        }
660    }
661}
662/// MetadataRoutingConfig metadata routing configuration
663#[derive(Clone, PartialEq, ::prost::Message)]
664pub struct MetadataRoutingConfig {
665    /// service
666    #[prost(string, tag = "1")]
667    pub service: ::prost::alloc::string::String,
668    /// namespace
669    #[prost(string, tag = "2")]
670    pub namespace: ::prost::alloc::string::String,
671    #[prost(map = "string, string", tag = "3")]
672    pub labels: ::std::collections::HashMap<
673        ::prost::alloc::string::String,
674        ::prost::alloc::string::String,
675    >,
676    /// When metadata not found, it will fall back to the
677    #[prost(message, optional, tag = "4")]
678    pub failover: ::core::option::Option<MetadataFailover>,
679}
680/// NearbyRoutingConfig routing configuration
681#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
682pub struct NearbyRoutingConfig {
683    /// 被调服务名,支持\*,代表全部服务
684    #[prost(string, tag = "1")]
685    pub service: ::prost::alloc::string::String,
686    /// 被调命名空间
687    #[prost(string, tag = "2")]
688    pub namespace: ::prost::alloc::string::String,
689    /// 默认就近级别
690    #[prost(enumeration = "nearby_routing_config::LocationLevel", tag = "3")]
691    pub match_level: i32,
692    /// 最大就近级别
693    #[prost(enumeration = "nearby_routing_config::LocationLevel", tag = "4")]
694    pub max_match_level: i32,
695    /// 是否强制就近
696    #[prost(bool, tag = "5")]
697    pub strict_nearby: bool,
698}
699/// Nested message and enum types in `NearbyRoutingConfig`.
700pub mod nearby_routing_config {
701    #[derive(
702        Clone,
703        Copy,
704        Debug,
705        PartialEq,
706        Eq,
707        Hash,
708        PartialOrd,
709        Ord,
710        ::prost::Enumeration
711    )]
712    #[repr(i32)]
713    pub enum LocationLevel {
714        /// 未知就近级别,等同于未定义级别
715        Unknown = 0,
716        /// 机房就近级别
717        Campus = 1,
718        /// 可用区就近级别
719        Zone = 2,
720        /// 地域就近级别
721        Region = 3,
722        /// 全局就近级别
723        All = 4,
724    }
725    impl LocationLevel {
726        /// String value of the enum field names used in the ProtoBuf definition.
727        ///
728        /// The values are not transformed in any way and thus are considered stable
729        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
730        pub fn as_str_name(&self) -> &'static str {
731            match self {
732                Self::Unknown => "UNKNOWN",
733                Self::Campus => "CAMPUS",
734                Self::Zone => "ZONE",
735                Self::Region => "REGION",
736                Self::All => "ALL",
737            }
738        }
739        /// Creates an enum from field names used in the ProtoBuf definition.
740        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
741            match value {
742                "UNKNOWN" => Some(Self::Unknown),
743                "CAMPUS" => Some(Self::Campus),
744                "ZONE" => Some(Self::Zone),
745                "REGION" => Some(Self::Region),
746                "ALL" => Some(Self::All),
747                _ => None,
748            }
749        }
750    }
751}
752/// CustomRoute routing configuration
753#[derive(Clone, PartialEq, ::prost::Message)]
754pub struct CustomRoute {
755    /// source source info
756    /// deprecated_filed  only for compatible to the old version server
757    #[prost(message, optional, tag = "1")]
758    pub caller: ::core::option::Option<custom_route::ServiceKey>,
759    /// destination destinations info
760    /// deprecated_filed  only for compatible to the old version server
761    #[prost(message, optional, tag = "2")]
762    pub callee: ::core::option::Option<custom_route::ServiceKey>,
763    /// rule route chain
764    #[prost(message, repeated, tag = "3")]
765    pub rules: ::prost::alloc::vec::Vec<CustomRouteRule>,
766}
767/// Nested message and enum types in `CustomRoute`.
768pub mod custom_route {
769    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
770    pub struct ServiceKey {
771        /// service service name
772        #[prost(string, tag = "1")]
773        pub service: ::prost::alloc::string::String,
774        /// namespace namespace of service
775        #[prost(string, tag = "2")]
776        pub namespace: ::prost::alloc::string::String,
777    }
778}
779/// SubRuleRouting sub routing configuration
780#[derive(Clone, PartialEq, ::prost::Message)]
781pub struct CustomRouteRule {
782    /// sub routing rule name
783    #[prost(string, tag = "1")]
784    pub name: ::prost::alloc::string::String,
785    /// Master Control Service Example Tag or Request Label
786    /// Value supports regular matching
787    #[prost(message, optional, tag = "2")]
788    pub arguments: ::core::option::Option<TrafficMatchRule>,
789    /// destination destinations info
790    #[prost(message, repeated, tag = "3")]
791    pub destinations: ::prost::alloc::vec::Vec<DestinationGroup>,
792}
793#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
794pub struct SourceService {
795    /// Main tuning service and namespace
796    #[prost(string, tag = "1")]
797    pub service: ::prost::alloc::string::String,
798    #[prost(string, tag = "2")]
799    pub namespace: ::prost::alloc::string::String,
800}
801#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
802pub struct DestinationService {
803    /// Main tuning service and namespace
804    #[prost(string, tag = "1")]
805    pub service: ::prost::alloc::string::String,
806    #[prost(string, tag = "2")]
807    pub namespace: ::prost::alloc::string::String,
808}
809#[derive(Clone, PartialEq, ::prost::Message)]
810pub struct DestinationGroup {
811    /// Templated service and namespace
812    #[prost(string, tag = "1")]
813    pub service: ::prost::alloc::string::String,
814    #[prost(string, tag = "2")]
815    pub namespace: ::prost::alloc::string::String,
816    /// Templated service example label
817    /// Value supports regular matching
818    #[prost(map = "string, message", tag = "3")]
819    pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
820    /// According to the service name and service instance Metadata Filter the
821    /// qualified service instance subset Service instance subset can set priority
822    /// and weight Priority: integer, range \[0, 9\], the highest priority is 0
823    /// Weight: Integer
824    /// Press priority routing, if there is high priority, low priority will not
825    /// use If there is a subset of the same priority, then assign by weight
826    /// Priority and weight can be not set / set up one / set two
827    /// If the section is set priority, some are not set, it is considered that the
828    /// priority is not set. If the part is set, some is not set, it is considered
829    /// that the weight is not set to 0 If you have no weight, you think the weight
830    /// is the same
831    #[prost(uint32, tag = "4")]
832    pub priority: u32,
833    #[prost(uint32, tag = "5")]
834    pub weight: u32,
835    /// Forward requests to proxy service
836    #[prost(string, tag = "6")]
837    pub transfer: ::prost::alloc::string::String,
838    /// Whether to isolate the SET, after isolation, no traffic will be allocated
839    #[prost(bool, tag = "7")]
840    pub isolate: bool,
841    /// name desition name
842    #[prost(string, tag = "8")]
843    pub name: ::prost::alloc::string::String,
844}
845/// TrafficMatchRule 流量匹配规则
846#[derive(Clone, PartialEq, ::prost::Message)]
847pub struct TrafficMatchRule {
848    /// 流量匹配规则,判断哪些流量需要进入泳道
849    #[prost(message, repeated, tag = "1")]
850    pub arguments: ::prost::alloc::vec::Vec<SourceMatch>,
851    /// 随机百分比流量匹配, 1-100, 表示百分之几的流量会被匹配到, 默认值为 100
852    #[prost(uint32, tag = "3")]
853    pub random_percent: u32,
854    #[prost(enumeration = "traffic_match_rule::TrafficMatchMode", tag = "4")]
855    pub match_mode: i32,
856}
857/// Nested message and enum types in `TrafficMatchRule`.
858pub mod traffic_match_rule {
859    /// 多个 SourceMatch 之间的判断关系
860    #[derive(
861        Clone,
862        Copy,
863        Debug,
864        PartialEq,
865        Eq,
866        Hash,
867        PartialOrd,
868        Ord,
869        ::prost::Enumeration
870    )]
871    #[repr(i32)]
872    pub enum TrafficMatchMode {
873        /// 与模式
874        And = 0,
875        /// 或模式
876        Or = 1,
877    }
878    impl TrafficMatchMode {
879        /// String value of the enum field names used in the ProtoBuf definition.
880        ///
881        /// The values are not transformed in any way and thus are considered stable
882        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
883        pub fn as_str_name(&self) -> &'static str {
884            match self {
885                Self::And => "AND",
886                Self::Or => "OR",
887            }
888        }
889        /// Creates an enum from field names used in the ProtoBuf definition.
890        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
891            match value {
892                "AND" => Some(Self::And),
893                "OR" => Some(Self::Or),
894                _ => None,
895            }
896        }
897    }
898}
899/// SourceMatch
900#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
901pub struct SourceMatch {
902    #[prost(enumeration = "source_match::Type", tag = "1")]
903    pub r#type: i32,
904    /// header key or query key
905    #[prost(string, tag = "2")]
906    pub key: ::prost::alloc::string::String,
907    /// header value or query value
908    #[prost(message, optional, tag = "3")]
909    pub value: ::core::option::Option<MatchString>,
910}
911/// Nested message and enum types in `SourceMatch`.
912pub mod source_match {
913    /// label type for gateway request
914    #[derive(
915        Clone,
916        Copy,
917        Debug,
918        PartialEq,
919        Eq,
920        Hash,
921        PartialOrd,
922        Ord,
923        ::prost::Enumeration
924    )]
925    #[repr(i32)]
926    pub enum Type {
927        /// custom arguments
928        Custom = 0,
929        /// method, match the http post/get/put/delete or grpc method
930        Method = 1,
931        /// header, match the http header, dubbo attachment, grpc header
932        Header = 2,
933        /// query, match the http query, dubbo argument
934        Query = 3,
935        /// caller host ip
936        CallerIp = 4,
937        /// path, math the http url
938        Path = 5,
939        /// cookie match http cookie
940        Cookie = 6,
941        /// indicate the caller instance metadata
942        CallerMetadata = 7,
943        /// caller service name or namespace/service pair
944        CallerService = 8,
945    }
946    impl Type {
947        /// String value of the enum field names used in the ProtoBuf definition.
948        ///
949        /// The values are not transformed in any way and thus are considered stable
950        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
951        pub fn as_str_name(&self) -> &'static str {
952            match self {
953                Self::Custom => "CUSTOM",
954                Self::Method => "METHOD",
955                Self::Header => "HEADER",
956                Self::Query => "QUERY",
957                Self::CallerIp => "CALLER_IP",
958                Self::Path => "PATH",
959                Self::Cookie => "COOKIE",
960                Self::CallerMetadata => "CALLER_METADATA",
961                Self::CallerService => "CALLER_SERVICE",
962            }
963        }
964        /// Creates an enum from field names used in the ProtoBuf definition.
965        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
966            match value {
967                "CUSTOM" => Some(Self::Custom),
968                "METHOD" => Some(Self::Method),
969                "HEADER" => Some(Self::Header),
970                "QUERY" => Some(Self::Query),
971                "CALLER_IP" => Some(Self::CallerIp),
972                "PATH" => Some(Self::Path),
973                "COOKIE" => Some(Self::Cookie),
974                "CALLER_METADATA" => Some(Self::CallerMetadata),
975                "CALLER_SERVICE" => Some(Self::CallerService),
976                _ => None,
977            }
978        }
979    }
980}
981#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
982#[repr(i32)]
983pub enum RoutePolicy {
984    /// Route by rule rule => RuleRoutingConfig
985    RulePolicy = 0,
986    /// Route by destination metadata ==> MetadataRoutingConfig
987    MetadataPolicy = 1,
988    /// Route by Nearby rule => NearByRoutingConfig
989    NearbyPolicy = 2,
990}
991impl RoutePolicy {
992    /// String value of the enum field names used in the ProtoBuf definition.
993    ///
994    /// The values are not transformed in any way and thus are considered stable
995    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
996    pub fn as_str_name(&self) -> &'static str {
997        match self {
998            Self::RulePolicy => "RulePolicy",
999            Self::MetadataPolicy => "MetadataPolicy",
1000            Self::NearbyPolicy => "NearbyPolicy",
1001        }
1002    }
1003    /// Creates an enum from field names used in the ProtoBuf definition.
1004    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1005        match value {
1006            "RulePolicy" => Some(Self::RulePolicy),
1007            "MetadataPolicy" => Some(Self::MetadataPolicy),
1008            "NearbyPolicy" => Some(Self::NearbyPolicy),
1009            _ => None,
1010        }
1011    }
1012}
1013/// 同一服务下限流规则集合
1014#[derive(Clone, PartialEq, ::prost::Message)]
1015pub struct RateLimit {
1016    /// 限流规则唯一标识
1017    #[prost(string, tag = "1")]
1018    pub id: ::prost::alloc::string::String,
1019    /// 限流规则名称
1020    #[prost(string, tag = "2")]
1021    pub name: ::prost::alloc::string::String,
1022    /// 限流规则优先级,0值最高
1023    #[prost(uint32, tag = "3")]
1024    pub priority: u32,
1025    #[prost(enumeration = "rate_limit::Type", tag = "4")]
1026    pub r#type: i32,
1027    /// 限流规则集合
1028    #[prost(message, repeated, tag = "5")]
1029    pub rules: ::prost::alloc::vec::Vec<LimitTrigger>,
1030    /// 限流规则汇总的revision信息
1031    #[prost(string, tag = "6")]
1032    pub revision: ::prost::alloc::string::String,
1033    /// 是否停用该限流规则,默认启用
1034    #[prost(bool, tag = "7")]
1035    pub disable: bool,
1036    /// 限流上报方式,同时支持按固定周期上报,以及达到配额百分比后上报
1037    #[prost(message, optional, tag = "8")]
1038    pub report: ::core::option::Option<Report>,
1039    /// 分布式限流服务集群
1040    #[prost(message, optional, tag = "9")]
1041    pub cluster: ::core::option::Option<RateLimitCluster>,
1042    /// 限流规则创建时间
1043    #[prost(string, tag = "10")]
1044    pub ctime: ::prost::alloc::string::String,
1045    /// 限流规则修改时间
1046    #[prost(string, tag = "11")]
1047    pub mtime: ::prost::alloc::string::String,
1048    /// 规则标签
1049    #[prost(map = "string, string", tag = "12")]
1050    pub metadata: ::std::collections::HashMap<
1051        ::prost::alloc::string::String,
1052        ::prost::alloc::string::String,
1053    >,
1054    /// 操作标志位
1055    #[prost(bool, tag = "13")]
1056    pub editable: bool,
1057    #[prost(bool, tag = "14")]
1058    pub deleteable: bool,
1059    /// namespace identifies the environment that owns this rule.
1060    #[prost(string, tag = "15")]
1061    pub namespace: ::prost::alloc::string::String,
1062    /// 被调服务,规则下发与运行时配额按该服务绑定。
1063    #[prost(message, optional, tag = "16")]
1064    pub callee: ::core::option::Option<DestinationService>,
1065}
1066/// Nested message and enum types in `RateLimit`.
1067pub mod rate_limit {
1068    /// 限流类型
1069    /// global全局限流(默认)或者local单机限流
1070    #[derive(
1071        Clone,
1072        Copy,
1073        Debug,
1074        PartialEq,
1075        Eq,
1076        Hash,
1077        PartialOrd,
1078        Ord,
1079        ::prost::Enumeration
1080    )]
1081    #[repr(i32)]
1082    pub enum Type {
1083        Global = 0,
1084        Local = 1,
1085    }
1086    impl Type {
1087        /// String value of the enum field names used in the ProtoBuf definition.
1088        ///
1089        /// The values are not transformed in any way and thus are considered stable
1090        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1091        pub fn as_str_name(&self) -> &'static str {
1092            match self {
1093                Self::Global => "GLOBAL",
1094                Self::Local => "LOCAL",
1095            }
1096        }
1097        /// Creates an enum from field names used in the ProtoBuf definition.
1098        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1099            match value {
1100                "GLOBAL" => Some(Self::Global),
1101                "LOCAL" => Some(Self::Local),
1102                _ => None,
1103            }
1104        }
1105    }
1106}
1107/// 单个限流规则信息
1108#[derive(Clone, PartialEq, ::prost::Message)]
1109pub struct LimitTrigger {
1110    /// 限流规则名
1111    #[prost(string, tag = "1")]
1112    pub name: ::prost::alloc::string::String,
1113    /// 被调 API 范围,命中任一 API 即进入该子限流规则
1114    #[prost(message, repeated, tag = "2")]
1115    pub apis: ::prost::alloc::vec::Vec<Api>,
1116    #[prost(enumeration = "limit_trigger::Resource", tag = "3")]
1117    pub resource: i32,
1118    /// 被调的参数过滤条件,满足过滤条件才进入限流规则
1119    #[prost(message, repeated, tag = "4")]
1120    pub arguments: ::prost::alloc::vec::Vec<MatchArgument>,
1121    /// 限流阈值
1122    /// 可以有多个粒度的配置(比如同时针对秒级,分钟级,天级),匹配一个则进行限流
1123    /// 全局限流模式下,该值为服务配额总量;单机限流模式下,该值为单个节点能处理的配额量
1124    #[prost(message, repeated, tag = "5")]
1125    pub amounts: ::prost::alloc::vec::Vec<Amount>,
1126    /// 最大排队时长,单位秒
1127    #[prost(uint32, tag = "6")]
1128    pub max_queue_delay: u32,
1129    /// amount for concurrency rate-limit
1130    #[prost(message, optional, tag = "7")]
1131    pub concurrency_amount: ::core::option::Option<ConcurrencyAmount>,
1132    /// fallback configuration
1133    #[prost(message, optional, tag = "8")]
1134    pub custom_response: ::core::option::Option<CustomResponse>,
1135    /// 通配符是否合并计算,默认分开计数
1136    #[prost(bool, tag = "9")]
1137    pub regex_combine: bool,
1138    #[prost(enumeration = "limit_trigger::FailoverType", tag = "10")]
1139    pub failover: i32,
1140    /// 限流动作,和 resource 配合决定插件名称
1141    #[prost(string, tag = "11")]
1142    pub action: ::prost::alloc::string::String,
1143    /// 是否停用该限流规则,默认启用
1144    #[prost(bool, tag = "12")]
1145    pub disable: bool,
1146    #[prost(enumeration = "limit_trigger::AmountMode", tag = "14")]
1147    pub amount_mode: i32,
1148}
1149/// Nested message and enum types in `LimitTrigger`.
1150pub mod limit_trigger {
1151    /// 限流资源
1152    #[derive(
1153        Clone,
1154        Copy,
1155        Debug,
1156        PartialEq,
1157        Eq,
1158        Hash,
1159        PartialOrd,
1160        Ord,
1161        ::prost::Enumeration
1162    )]
1163    #[repr(i32)]
1164    pub enum Resource {
1165        /// 针对QPS进行限流
1166        Qps = 0,
1167        /// 针对并发数进行限流
1168        Concurrency = 1,
1169        /// 针对系统资源进行限流
1170        System = 2,
1171        /// 针对可变权重配额进行限流,例如 LLM token
1172        Token = 3,
1173    }
1174    impl Resource {
1175        /// String value of the enum field names used in the ProtoBuf definition.
1176        ///
1177        /// The values are not transformed in any way and thus are considered stable
1178        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1179        pub fn as_str_name(&self) -> &'static str {
1180            match self {
1181                Self::Qps => "QPS",
1182                Self::Concurrency => "CONCURRENCY",
1183                Self::System => "SYSTEM",
1184                Self::Token => "TOKEN",
1185            }
1186        }
1187        /// Creates an enum from field names used in the ProtoBuf definition.
1188        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1189            match value {
1190                "QPS" => Some(Self::Qps),
1191                "CONCURRENCY" => Some(Self::Concurrency),
1192                "SYSTEM" => Some(Self::System),
1193                "TOKEN" => Some(Self::Token),
1194                _ => None,
1195            }
1196        }
1197    }
1198    /// 与限流集群连接失败时降级模式
1199    #[derive(
1200        Clone,
1201        Copy,
1202        Debug,
1203        PartialEq,
1204        Eq,
1205        Hash,
1206        PartialOrd,
1207        Ord,
1208        ::prost::Enumeration
1209    )]
1210    #[repr(i32)]
1211    pub enum FailoverType {
1212        /// 降级成本地阈值
1213        FailoverLocal = 0,
1214        /// 降级成直接通过
1215        FailoverPass = 1,
1216    }
1217    impl FailoverType {
1218        /// String value of the enum field names used in the ProtoBuf definition.
1219        ///
1220        /// The values are not transformed in any way and thus are considered stable
1221        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1222        pub fn as_str_name(&self) -> &'static str {
1223            match self {
1224                Self::FailoverLocal => "FAILOVER_LOCAL",
1225                Self::FailoverPass => "FAILOVER_PASS",
1226            }
1227        }
1228        /// Creates an enum from field names used in the ProtoBuf definition.
1229        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1230            match value {
1231                "FAILOVER_LOCAL" => Some(Self::FailoverLocal),
1232                "FAILOVER_PASS" => Some(Self::FailoverPass),
1233                _ => None,
1234            }
1235        }
1236    }
1237    /// 限流阈值模
1238    #[derive(
1239        Clone,
1240        Copy,
1241        Debug,
1242        PartialEq,
1243        Eq,
1244        Hash,
1245        PartialOrd,
1246        Ord,
1247        ::prost::Enumeration
1248    )]
1249    #[repr(i32)]
1250    pub enum AmountMode {
1251        /// 总体阈值
1252        GlobalTotal = 0,
1253        /// 单机均摊阈值
1254        ShareEqually = 1,
1255    }
1256    impl AmountMode {
1257        /// String value of the enum field names used in the ProtoBuf definition.
1258        ///
1259        /// The values are not transformed in any way and thus are considered stable
1260        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1261        pub fn as_str_name(&self) -> &'static str {
1262            match self {
1263                Self::GlobalTotal => "GLOBAL_TOTAL",
1264                Self::ShareEqually => "SHARE_EQUALLY",
1265            }
1266        }
1267        /// Creates an enum from field names used in the ProtoBuf definition.
1268        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1269            match value {
1270                "GLOBAL_TOTAL" => Some(Self::GlobalTotal),
1271                "SHARE_EQUALLY" => Some(Self::ShareEqually),
1272                _ => None,
1273            }
1274        }
1275    }
1276}
1277#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1278pub struct MatchArgument {
1279    #[prost(enumeration = "match_argument::Type", tag = "1")]
1280    pub r#type: i32,
1281    /// header key or query key
1282    #[prost(string, tag = "2")]
1283    pub key: ::prost::alloc::string::String,
1284    /// header value or query value
1285    #[prost(message, optional, tag = "3")]
1286    pub value: ::core::option::Option<MatchString>,
1287}
1288/// Nested message and enum types in `MatchArgument`.
1289pub mod match_argument {
1290    /// label type for gateway request
1291    #[derive(
1292        Clone,
1293        Copy,
1294        Debug,
1295        PartialEq,
1296        Eq,
1297        Hash,
1298        PartialOrd,
1299        Ord,
1300        ::prost::Enumeration
1301    )]
1302    #[repr(i32)]
1303    pub enum Type {
1304        /// custom arguments
1305        Custom = 0,
1306        /// method, match the http post/get/put/delete or grpc method
1307        Method = 1,
1308        /// header, match the http header, dubbo attachment, grpc header
1309        Header = 2,
1310        /// query, match the http query, dubbo argument
1311        Query = 3,
1312        /// caller service
1313        CallerService = 4,
1314        /// caller host ip
1315        CallerIp = 5,
1316        /// caller instance metadata
1317        CallerMetadata = 6,
1318    }
1319    impl Type {
1320        /// String value of the enum field names used in the ProtoBuf definition.
1321        ///
1322        /// The values are not transformed in any way and thus are considered stable
1323        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1324        pub fn as_str_name(&self) -> &'static str {
1325            match self {
1326                Self::Custom => "CUSTOM",
1327                Self::Method => "METHOD",
1328                Self::Header => "HEADER",
1329                Self::Query => "QUERY",
1330                Self::CallerService => "CALLER_SERVICE",
1331                Self::CallerIp => "CALLER_IP",
1332                Self::CallerMetadata => "CALLER_METADATA",
1333            }
1334        }
1335        /// Creates an enum from field names used in the ProtoBuf definition.
1336        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1337            match value {
1338                "CUSTOM" => Some(Self::Custom),
1339                "METHOD" => Some(Self::Method),
1340                "HEADER" => Some(Self::Header),
1341                "QUERY" => Some(Self::Query),
1342                "CALLER_SERVICE" => Some(Self::CallerService),
1343                "CALLER_IP" => Some(Self::CallerIp),
1344                "CALLER_METADATA" => Some(Self::CallerMetadata),
1345                _ => None,
1346            }
1347        }
1348    }
1349}
1350/// concurrency rate-limit amount config
1351#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1352pub struct ConcurrencyAmount {
1353    #[prost(uint32, tag = "1")]
1354    pub max_amount: u32,
1355}
1356/// custom response text when limited
1357#[derive(Clone, PartialEq, ::prost::Message)]
1358pub struct CustomResponse {
1359    #[prost(string, tag = "1")]
1360    pub code: ::prost::alloc::string::String,
1361    #[prost(map = "string, string", tag = "2")]
1362    pub headers: ::std::collections::HashMap<
1363        ::prost::alloc::string::String,
1364        ::prost::alloc::string::String,
1365    >,
1366    #[prost(string, tag = "3")]
1367    pub body: ::prost::alloc::string::String,
1368}
1369/// 分布式限流服务集群
1370#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1371pub struct RateLimitCluster {
1372    #[prost(string, tag = "1")]
1373    pub service: ::prost::alloc::string::String,
1374    /// 限流规则所属命名空间
1375    #[prost(string, tag = "2")]
1376    pub namespace: ::prost::alloc::string::String,
1377}
1378/// 限流配额
1379#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1380pub struct Amount {
1381    /// 时间周期内的最大配额数
1382    #[prost(uint32, tag = "1")]
1383    pub max_amount: u32,
1384    /// 配额生效的时间周期,必须大于等于1s
1385    #[prost(message, optional, tag = "2")]
1386    pub valid_duration: ::core::option::Option<::prost_types::Duration>,
1387    /// 请求统计精度
1388    #[prost(uint32, tag = "3")]
1389    pub precision: u32,
1390    /// 可选,起始限流阈值,爬坡起始值
1391    #[prost(uint32, tag = "4")]
1392    pub start_amount: u32,
1393    /// 可选,最小限流阈值,降低时最小值
1394    #[prost(uint32, tag = "5")]
1395    pub min_amount: u32,
1396}
1397/// 限流上报方式
1398#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1399pub struct Report {
1400    /// 配额固定上报周期,单位毫秒
1401    #[prost(message, optional, tag = "1")]
1402    pub interval: ::core::option::Option<::prost_types::Duration>,
1403    /// 使用了百分之多少配额后启动一次实时上报,值范围(0,100\]
1404    #[prost(uint32, tag = "2")]
1405    pub amount_percent: u32,
1406}
1407#[derive(Clone, PartialEq, ::prost::Message)]
1408pub struct ServiceContract {
1409    /// 契约ID
1410    #[prost(string, tag = "1")]
1411    pub id: ::prost::alloc::string::String,
1412    /// 契约名称
1413    /// deprecated, use type field
1414    #[prost(string, tag = "2")]
1415    pub name: ::prost::alloc::string::String,
1416    /// 所属命名空间
1417    #[prost(string, tag = "3")]
1418    pub namespace: ::prost::alloc::string::String,
1419    /// 所属服务名称
1420    #[prost(string, tag = "4")]
1421    pub service: ::prost::alloc::string::String,
1422    /// 协议,http/grpc/dubbo/thrift
1423    #[prost(string, tag = "5")]
1424    pub protocol: ::prost::alloc::string::String,
1425    /// 契约版本
1426    #[prost(string, tag = "6")]
1427    pub version: ::prost::alloc::string::String,
1428    /// 信息摘要
1429    #[prost(string, tag = "7")]
1430    pub revision: ::prost::alloc::string::String,
1431    /// 额外描述
1432    #[prost(string, tag = "8")]
1433    pub content: ::prost::alloc::string::String,
1434    /// 接口描述信息
1435    #[prost(message, repeated, tag = "9")]
1436    pub interfaces: ::prost::alloc::vec::Vec<InterfaceDescriptor>,
1437    /// 创建时间
1438    #[prost(string, tag = "10")]
1439    pub ctime: ::prost::alloc::string::String,
1440    /// 更新时间
1441    #[prost(string, tag = "11")]
1442    pub mtime: ::prost::alloc::string::String,
1443    /// 接口状态,Offline/Online
1444    #[prost(string, tag = "12")]
1445    pub status: ::prost::alloc::string::String,
1446    /// 类型
1447    #[prost(string, tag = "14")]
1448    pub r#type: ::prost::alloc::string::String,
1449    /// 标签
1450    #[prost(map = "string, string", tag = "15")]
1451    pub metadata: ::std::collections::HashMap<
1452        ::prost::alloc::string::String,
1453        ::prost::alloc::string::String,
1454    >,
1455    /// 内容摘要
1456    #[prost(string, tag = "16")]
1457    pub content_digest: ::prost::alloc::string::String,
1458}
1459#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1460pub struct InterfaceDescriptor {
1461    /// 接口ID
1462    #[prost(string, tag = "1")]
1463    pub id: ::prost::alloc::string::String,
1464    /// 方法名称,对应 http method/ dubbo interface func/grpc service func
1465    #[prost(string, tag = "2")]
1466    pub method: ::prost::alloc::string::String,
1467    /// 接口名称,http path/dubbo interface/grpc service
1468    #[prost(string, tag = "3")]
1469    pub path: ::prost::alloc::string::String,
1470    /// 接口描述信息
1471    #[prost(string, tag = "4")]
1472    pub content: ::prost::alloc::string::String,
1473    /// 创建来源
1474    #[prost(enumeration = "interface_descriptor::Source", tag = "5")]
1475    pub source: i32,
1476    /// 接口信息摘要
1477    #[prost(string, tag = "6")]
1478    pub revision: ::prost::alloc::string::String,
1479    /// 创建时间
1480    #[prost(string, tag = "7")]
1481    pub ctime: ::prost::alloc::string::String,
1482    /// 更新时间
1483    #[prost(string, tag = "8")]
1484    pub mtime: ::prost::alloc::string::String,
1485    /// 接口名称描述信息
1486    /// deprecated, use type field
1487    #[prost(string, tag = "9")]
1488    pub name: ::prost::alloc::string::String,
1489    /// 所属命名空间
1490    #[prost(string, tag = "10")]
1491    pub namespace: ::prost::alloc::string::String,
1492    /// 所属服务名称
1493    #[prost(string, tag = "11")]
1494    pub service: ::prost::alloc::string::String,
1495    /// 协议,http/grpc/dubbo/thrift
1496    #[prost(string, tag = "12")]
1497    pub protocol: ::prost::alloc::string::String,
1498    /// 契约版本
1499    #[prost(string, tag = "13")]
1500    pub version: ::prost::alloc::string::String,
1501    /// 类型
1502    #[prost(string, tag = "14")]
1503    pub r#type: ::prost::alloc::string::String,
1504    /// 内容摘要
1505    #[prost(string, tag = "15")]
1506    pub content_digest: ::prost::alloc::string::String,
1507}
1508/// Nested message and enum types in `InterfaceDescriptor`.
1509pub mod interface_descriptor {
1510    #[derive(
1511        Clone,
1512        Copy,
1513        Debug,
1514        PartialEq,
1515        Eq,
1516        Hash,
1517        PartialOrd,
1518        Ord,
1519        ::prost::Enumeration
1520    )]
1521    #[repr(i32)]
1522    pub enum Source {
1523        Unknown = 0,
1524        Manual = 1,
1525        Client = 2,
1526    }
1527    impl Source {
1528        /// String value of the enum field names used in the ProtoBuf definition.
1529        ///
1530        /// The values are not transformed in any way and thus are considered stable
1531        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1532        pub fn as_str_name(&self) -> &'static str {
1533            match self {
1534                Self::Unknown => "UNKNOWN",
1535                Self::Manual => "Manual",
1536                Self::Client => "Client",
1537            }
1538        }
1539        /// Creates an enum from field names used in the ProtoBuf definition.
1540        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1541            match value {
1542                "UNKNOWN" => Some(Self::Unknown),
1543                "Manual" => Some(Self::Manual),
1544                "Client" => Some(Self::Client),
1545                _ => None,
1546            }
1547        }
1548    }
1549}
1550#[derive(Clone, PartialEq, ::prost::Message)]
1551pub struct LoginRequest {
1552    #[prost(string, tag = "1")]
1553    pub owner: ::prost::alloc::string::String,
1554    #[prost(string, tag = "2")]
1555    pub name: ::prost::alloc::string::String,
1556    #[prost(string, tag = "3")]
1557    pub password: ::prost::alloc::string::String,
1558    #[prost(map = "string, string", tag = "4")]
1559    pub options: ::std::collections::HashMap<
1560        ::prost::alloc::string::String,
1561        ::prost::alloc::string::String,
1562    >,
1563}
1564#[derive(Clone, PartialEq, ::prost::Message)]
1565pub struct LoginResponse {
1566    #[prost(string, tag = "1")]
1567    pub user_id: ::prost::alloc::string::String,
1568    #[prost(string, tag = "2")]
1569    pub name: ::prost::alloc::string::String,
1570    #[prost(string, tag = "3")]
1571    pub role: ::prost::alloc::string::String,
1572    #[prost(string, tag = "4")]
1573    pub owner_id: ::prost::alloc::string::String,
1574    #[prost(string, tag = "5")]
1575    pub token: ::prost::alloc::string::String,
1576    #[prost(map = "string, string", tag = "6")]
1577    pub options: ::std::collections::HashMap<
1578        ::prost::alloc::string::String,
1579        ::prost::alloc::string::String,
1580    >,
1581}
1582#[derive(Clone, PartialEq, ::prost::Message)]
1583pub struct User {
1584    #[prost(string, tag = "1")]
1585    pub id: ::prost::alloc::string::String,
1586    #[prost(string, tag = "2")]
1587    pub name: ::prost::alloc::string::String,
1588    #[prost(string, tag = "3")]
1589    pub password: ::prost::alloc::string::String,
1590    #[prost(string, tag = "4")]
1591    pub owner: ::prost::alloc::string::String,
1592    #[prost(string, tag = "5")]
1593    pub source: ::prost::alloc::string::String,
1594    #[prost(string, tag = "6")]
1595    pub auth_token: ::prost::alloc::string::String,
1596    #[prost(bool, tag = "7")]
1597    pub token_enable: bool,
1598    #[prost(string, tag = "8")]
1599    pub comment: ::prost::alloc::string::String,
1600    #[prost(string, tag = "9")]
1601    pub ctime: ::prost::alloc::string::String,
1602    #[prost(string, tag = "10")]
1603    pub mtime: ::prost::alloc::string::String,
1604    #[prost(string, tag = "11")]
1605    pub user_type: ::prost::alloc::string::String,
1606    #[prost(string, tag = "12")]
1607    pub mobile: ::prost::alloc::string::String,
1608    #[prost(string, tag = "13")]
1609    pub email: ::prost::alloc::string::String,
1610    #[prost(map = "string, string", tag = "14")]
1611    pub metadata: ::std::collections::HashMap<
1612        ::prost::alloc::string::String,
1613        ::prost::alloc::string::String,
1614    >,
1615}
1616#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1617pub struct ModifyUserPassword {
1618    #[prost(string, tag = "1")]
1619    pub id: ::prost::alloc::string::String,
1620    #[prost(string, tag = "2")]
1621    pub old_password: ::prost::alloc::string::String,
1622    #[prost(string, tag = "3")]
1623    pub new_password: ::prost::alloc::string::String,
1624}
1625#[derive(Clone, PartialEq, ::prost::Message)]
1626pub struct UserGroupRelation {
1627    #[prost(string, tag = "1")]
1628    pub group_id: ::prost::alloc::string::String,
1629    #[prost(message, repeated, tag = "2")]
1630    pub users: ::prost::alloc::vec::Vec<User>,
1631}
1632#[derive(Clone, PartialEq, ::prost::Message)]
1633pub struct UserGroup {
1634    #[prost(string, tag = "1")]
1635    pub id: ::prost::alloc::string::String,
1636    #[prost(string, tag = "2")]
1637    pub name: ::prost::alloc::string::String,
1638    #[prost(string, tag = "3")]
1639    pub owner: ::prost::alloc::string::String,
1640    #[prost(string, tag = "4")]
1641    pub auth_token: ::prost::alloc::string::String,
1642    #[prost(bool, tag = "5")]
1643    pub token_enable: bool,
1644    #[prost(string, tag = "6")]
1645    pub comment: ::prost::alloc::string::String,
1646    #[prost(string, tag = "7")]
1647    pub ctime: ::prost::alloc::string::String,
1648    #[prost(string, tag = "8")]
1649    pub mtime: ::prost::alloc::string::String,
1650    #[prost(message, optional, tag = "9")]
1651    pub relation: ::core::option::Option<UserGroupRelation>,
1652    #[prost(uint32, tag = "10")]
1653    pub user_count: u32,
1654    #[prost(string, tag = "11")]
1655    pub source: ::prost::alloc::string::String,
1656    #[prost(map = "string, string", tag = "12")]
1657    pub metadata: ::std::collections::HashMap<
1658        ::prost::alloc::string::String,
1659        ::prost::alloc::string::String,
1660    >,
1661}
1662#[derive(Clone, PartialEq, ::prost::Message)]
1663pub struct ModifyUserGroup {
1664    #[prost(string, tag = "1")]
1665    pub id: ::prost::alloc::string::String,
1666    #[prost(string, tag = "2")]
1667    pub owner: ::prost::alloc::string::String,
1668    #[prost(string, tag = "3")]
1669    pub name: ::prost::alloc::string::String,
1670    #[prost(string, tag = "4")]
1671    pub auth_token: ::prost::alloc::string::String,
1672    #[prost(bool, tag = "5")]
1673    pub token_enable: bool,
1674    #[prost(string, tag = "6")]
1675    pub comment: ::prost::alloc::string::String,
1676    #[prost(message, optional, tag = "7")]
1677    pub add_relations: ::core::option::Option<UserGroupRelation>,
1678    #[prost(message, optional, tag = "8")]
1679    pub remove_relations: ::core::option::Option<UserGroupRelation>,
1680    #[prost(map = "string, string", tag = "9")]
1681    pub metadata: ::std::collections::HashMap<
1682        ::prost::alloc::string::String,
1683        ::prost::alloc::string::String,
1684    >,
1685    #[prost(string, tag = "10")]
1686    pub source: ::prost::alloc::string::String,
1687}
1688#[derive(Clone, PartialEq, ::prost::Message)]
1689pub struct Role {
1690    #[prost(string, tag = "1")]
1691    pub id: ::prost::alloc::string::String,
1692    #[prost(string, tag = "2")]
1693    pub name: ::prost::alloc::string::String,
1694    #[prost(string, tag = "4")]
1695    pub owner: ::prost::alloc::string::String,
1696    #[prost(string, tag = "5")]
1697    pub source: ::prost::alloc::string::String,
1698    #[prost(bool, tag = "6")]
1699    pub default_role: bool,
1700    #[prost(map = "string, string", tag = "7")]
1701    pub metadata: ::std::collections::HashMap<
1702        ::prost::alloc::string::String,
1703        ::prost::alloc::string::String,
1704    >,
1705    #[prost(string, tag = "8")]
1706    pub comment: ::prost::alloc::string::String,
1707    #[prost(string, tag = "9")]
1708    pub ctime: ::prost::alloc::string::String,
1709    #[prost(string, tag = "10")]
1710    pub mtime: ::prost::alloc::string::String,
1711    #[prost(message, repeated, tag = "20")]
1712    pub users: ::prost::alloc::vec::Vec<User>,
1713    #[prost(message, repeated, tag = "21")]
1714    pub user_groups: ::prost::alloc::vec::Vec<UserGroup>,
1715}
1716#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1717pub struct Principal {
1718    #[prost(string, tag = "1")]
1719    pub id: ::prost::alloc::string::String,
1720    #[prost(string, tag = "2")]
1721    pub name: ::prost::alloc::string::String,
1722}
1723#[derive(Clone, PartialEq, ::prost::Message)]
1724pub struct Principals {
1725    #[prost(message, repeated, tag = "1")]
1726    pub users: ::prost::alloc::vec::Vec<Principal>,
1727    #[prost(message, repeated, tag = "2")]
1728    pub groups: ::prost::alloc::vec::Vec<Principal>,
1729    #[prost(message, repeated, tag = "3")]
1730    pub roles: ::prost::alloc::vec::Vec<Principal>,
1731}
1732#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1733pub struct StrategyResourceEntry {
1734    #[prost(string, tag = "1")]
1735    pub id: ::prost::alloc::string::String,
1736    #[prost(string, tag = "2")]
1737    pub namespace: ::prost::alloc::string::String,
1738    #[prost(string, tag = "3")]
1739    pub name: ::prost::alloc::string::String,
1740}
1741#[derive(Clone, PartialEq, ::prost::Message)]
1742pub struct StrategyResources {
1743    #[prost(string, tag = "1")]
1744    pub strategy_id: ::prost::alloc::string::String,
1745    #[prost(message, repeated, tag = "2")]
1746    pub namespaces: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
1747    #[prost(message, repeated, tag = "3")]
1748    pub services: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
1749    #[prost(message, repeated, tag = "4")]
1750    pub config_groups: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
1751    #[prost(message, repeated, tag = "5")]
1752    pub route_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
1753    #[prost(message, repeated, tag = "6")]
1754    pub ratelimit_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
1755    #[prost(message, repeated, tag = "7")]
1756    pub circuitbreaker_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
1757    #[prost(message, repeated, tag = "8")]
1758    pub faultdetect_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
1759    #[prost(message, repeated, tag = "9")]
1760    pub lane_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
1761    #[prost(message, repeated, tag = "10")]
1762    pub lossless_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
1763    #[prost(message, repeated, tag = "11")]
1764    pub mirror_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
1765    #[prost(message, repeated, tag = "12")]
1766    pub security_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
1767    #[prost(message, repeated, tag = "13")]
1768    pub mock_rules: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
1769    #[prost(message, repeated, tag = "21")]
1770    pub users: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
1771    #[prost(message, repeated, tag = "22")]
1772    pub user_groups: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
1773    #[prost(message, repeated, tag = "23")]
1774    pub roles: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
1775    #[prost(message, repeated, tag = "24")]
1776    pub auth_policies: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
1777    #[prost(message, repeated, tag = "30")]
1778    pub mcp_servers: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
1779    #[prost(message, repeated, tag = "31")]
1780    pub a2a_agents: ::prost::alloc::vec::Vec<StrategyResourceEntry>,
1781}
1782#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1783pub struct StrategyResourceLabel {
1784    #[prost(string, tag = "1")]
1785    pub key: ::prost::alloc::string::String,
1786    #[prost(string, tag = "2")]
1787    pub value: ::prost::alloc::string::String,
1788    #[prost(string, tag = "3")]
1789    pub compare_type: ::prost::alloc::string::String,
1790}
1791#[derive(Clone, PartialEq, ::prost::Message)]
1792pub struct AuthStrategy {
1793    #[prost(string, tag = "1")]
1794    pub id: ::prost::alloc::string::String,
1795    #[prost(string, tag = "2")]
1796    pub name: ::prost::alloc::string::String,
1797    #[prost(message, optional, tag = "3")]
1798    pub principals: ::core::option::Option<Principals>,
1799    #[prost(message, optional, tag = "4")]
1800    pub resources: ::core::option::Option<StrategyResources>,
1801    #[prost(enumeration = "AuthAction", tag = "5")]
1802    pub action: i32,
1803    #[prost(string, tag = "6")]
1804    pub comment: ::prost::alloc::string::String,
1805    #[prost(string, tag = "7")]
1806    pub owner: ::prost::alloc::string::String,
1807    #[prost(string, tag = "8")]
1808    pub ctime: ::prost::alloc::string::String,
1809    #[prost(string, tag = "9")]
1810    pub mtime: ::prost::alloc::string::String,
1811    #[prost(string, tag = "10")]
1812    pub auth_token: ::prost::alloc::string::String,
1813    #[prost(bool, tag = "11")]
1814    pub default_strategy: bool,
1815    #[prost(map = "string, string", tag = "12")]
1816    pub metadata: ::std::collections::HashMap<
1817        ::prost::alloc::string::String,
1818        ::prost::alloc::string::String,
1819    >,
1820    #[prost(string, tag = "13")]
1821    pub source: ::prost::alloc::string::String,
1822    #[prost(string, repeated, tag = "14")]
1823    pub functions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1824    #[prost(message, repeated, tag = "15")]
1825    pub resource_labels: ::prost::alloc::vec::Vec<StrategyResourceLabel>,
1826}
1827#[derive(Clone, PartialEq, ::prost::Message)]
1828pub struct ModifyAuthStrategy {
1829    #[prost(string, tag = "1")]
1830    pub id: ::prost::alloc::string::String,
1831    #[prost(string, tag = "2")]
1832    pub name: ::prost::alloc::string::String,
1833    #[prost(message, optional, tag = "3")]
1834    pub add_principals: ::core::option::Option<Principals>,
1835    #[prost(message, optional, tag = "4")]
1836    pub remove_principals: ::core::option::Option<Principals>,
1837    #[prost(message, optional, tag = "5")]
1838    pub add_resources: ::core::option::Option<StrategyResources>,
1839    #[prost(message, optional, tag = "6")]
1840    pub remove_resources: ::core::option::Option<StrategyResources>,
1841    #[prost(enumeration = "AuthAction", tag = "7")]
1842    pub action: i32,
1843    #[prost(string, tag = "8")]
1844    pub comment: ::prost::alloc::string::String,
1845    #[prost(string, tag = "9")]
1846    pub owner: ::prost::alloc::string::String,
1847    #[prost(map = "string, string", tag = "12")]
1848    pub metadata: ::std::collections::HashMap<
1849        ::prost::alloc::string::String,
1850        ::prost::alloc::string::String,
1851    >,
1852    #[prost(string, tag = "13")]
1853    pub source: ::prost::alloc::string::String,
1854    #[prost(string, repeated, tag = "14")]
1855    pub functions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1856    #[prost(message, repeated, tag = "15")]
1857    pub resource_labels: ::prost::alloc::vec::Vec<StrategyResourceLabel>,
1858}
1859#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1860#[repr(i32)]
1861pub enum AuthAction {
1862    /// deprecated_filed 该字段从未使用过
1863    OnlyRead = 0,
1864    /// deprecated_filed 使用 ALLOW 进行替代
1865    ReadWrite = 1,
1866    Allow = 10,
1867    Deny = 11,
1868}
1869impl AuthAction {
1870    /// String value of the enum field names used in the ProtoBuf definition.
1871    ///
1872    /// The values are not transformed in any way and thus are considered stable
1873    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1874    pub fn as_str_name(&self) -> &'static str {
1875        match self {
1876            Self::OnlyRead => "ONLY_READ",
1877            Self::ReadWrite => "READ_WRITE",
1878            Self::Allow => "ALLOW",
1879            Self::Deny => "DENY",
1880        }
1881    }
1882    /// Creates an enum from field names used in the ProtoBuf definition.
1883    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1884        match value {
1885            "ONLY_READ" => Some(Self::OnlyRead),
1886            "READ_WRITE" => Some(Self::ReadWrite),
1887            "ALLOW" => Some(Self::Allow),
1888            "DENY" => Some(Self::Deny),
1889            _ => None,
1890        }
1891    }
1892}
1893#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1894#[repr(i32)]
1895pub enum ResourceType {
1896    Namespaces = 0,
1897    Services = 1,
1898    ConfigGroups = 2,
1899    RouteRules = 3,
1900    RateLimitRules = 4,
1901    CircuitBreakerRules = 5,
1902    FaultDetectRules = 6,
1903    LaneRules = 7,
1904    LosslessRules = 8,
1905    MirrorRules = 9,
1906    SecurityRules = 10,
1907    MockRules = 11,
1908    Users = 20,
1909    UserGroups = 21,
1910    Roles = 22,
1911    PolicyRules = 23,
1912    McpServerResources = 30,
1913    A2aAgentResources = 31,
1914}
1915impl ResourceType {
1916    /// String value of the enum field names used in the ProtoBuf definition.
1917    ///
1918    /// The values are not transformed in any way and thus are considered stable
1919    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1920    pub fn as_str_name(&self) -> &'static str {
1921        match self {
1922            Self::Namespaces => "Namespaces",
1923            Self::Services => "Services",
1924            Self::ConfigGroups => "ConfigGroups",
1925            Self::RouteRules => "RouteRules",
1926            Self::RateLimitRules => "RateLimitRules",
1927            Self::CircuitBreakerRules => "CircuitBreakerRules",
1928            Self::FaultDetectRules => "FaultDetectRules",
1929            Self::LaneRules => "LaneRules",
1930            Self::LosslessRules => "LosslessRules",
1931            Self::MirrorRules => "MirrorRules",
1932            Self::SecurityRules => "SecurityRules",
1933            Self::MockRules => "MockRules",
1934            Self::Users => "Users",
1935            Self::UserGroups => "UserGroups",
1936            Self::Roles => "Roles",
1937            Self::PolicyRules => "PolicyRules",
1938            Self::McpServerResources => "MCPServerResources",
1939            Self::A2aAgentResources => "A2AAgentResources",
1940        }
1941    }
1942    /// Creates an enum from field names used in the ProtoBuf definition.
1943    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1944        match value {
1945            "Namespaces" => Some(Self::Namespaces),
1946            "Services" => Some(Self::Services),
1947            "ConfigGroups" => Some(Self::ConfigGroups),
1948            "RouteRules" => Some(Self::RouteRules),
1949            "RateLimitRules" => Some(Self::RateLimitRules),
1950            "CircuitBreakerRules" => Some(Self::CircuitBreakerRules),
1951            "FaultDetectRules" => Some(Self::FaultDetectRules),
1952            "LaneRules" => Some(Self::LaneRules),
1953            "LosslessRules" => Some(Self::LosslessRules),
1954            "MirrorRules" => Some(Self::MirrorRules),
1955            "SecurityRules" => Some(Self::SecurityRules),
1956            "MockRules" => Some(Self::MockRules),
1957            "Users" => Some(Self::Users),
1958            "UserGroups" => Some(Self::UserGroups),
1959            "Roles" => Some(Self::Roles),
1960            "PolicyRules" => Some(Self::PolicyRules),
1961            "MCPServerResources" => Some(Self::McpServerResources),
1962            "A2AAgentResources" => Some(Self::A2aAgentResources),
1963            _ => None,
1964        }
1965    }
1966}
1967#[derive(Clone, PartialEq, ::prost::Message)]
1968pub struct FaultDetectRule {
1969    #[prost(string, tag = "1")]
1970    pub id: ::prost::alloc::string::String,
1971    /// rule name
1972    #[prost(string, tag = "2")]
1973    pub name: ::prost::alloc::string::String,
1974    /// revision routing version
1975    #[prost(string, tag = "3")]
1976    pub revision: ::prost::alloc::string::String,
1977    /// ctime create time of the rules
1978    #[prost(string, tag = "4")]
1979    pub ctime: ::prost::alloc::string::String,
1980    /// mtime modify time of the rules
1981    #[prost(string, tag = "5")]
1982    pub mtime: ::prost::alloc::string::String,
1983    /// description simple description rules
1984    #[prost(string, tag = "6")]
1985    pub description: ::prost::alloc::string::String,
1986    /// detect target
1987    #[prost(message, optional, tag = "7")]
1988    pub target_service: ::core::option::Option<fault_detect_rule::DestinationService>,
1989    /// priority rules priority
1990    #[prost(uint32, tag = "8")]
1991    pub priority: u32,
1992    /// 规则标签
1993    #[prost(map = "string, string", tag = "9")]
1994    pub metadata: ::std::collections::HashMap<
1995        ::prost::alloc::string::String,
1996        ::prost::alloc::string::String,
1997    >,
1998    /// 操作标志位
1999    #[prost(bool, tag = "10")]
2000    pub editable: bool,
2001    #[prost(bool, tag = "11")]
2002    pub deleteable: bool,
2003    /// detect sub rules
2004    #[prost(message, repeated, tag = "12")]
2005    pub rules: ::prost::alloc::vec::Vec<FaultDetectSubRule>,
2006    /// namespace identifies the environment that owns this rule.
2007    #[prost(string, tag = "13")]
2008    pub namespace: ::prost::alloc::string::String,
2009}
2010/// Nested message and enum types in `FaultDetectRule`.
2011pub mod fault_detect_rule {
2012    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2013    pub struct DestinationService {
2014        #[prost(string, tag = "1")]
2015        pub service: ::prost::alloc::string::String,
2016        #[prost(string, tag = "2")]
2017        pub namespace: ::prost::alloc::string::String,
2018        /// deprecated_filed  use api.path instead
2019        #[deprecated]
2020        #[prost(message, optional, tag = "3")]
2021        pub method: ::core::option::Option<super::MatchString>,
2022        #[prost(message, optional, tag = "4")]
2023        pub api: ::core::option::Option<super::Api>,
2024    }
2025    /// detect protocol
2026    #[derive(
2027        Clone,
2028        Copy,
2029        Debug,
2030        PartialEq,
2031        Eq,
2032        Hash,
2033        PartialOrd,
2034        Ord,
2035        ::prost::Enumeration
2036    )]
2037    #[repr(i32)]
2038    pub enum Protocol {
2039        Unknown = 0,
2040        Http = 1,
2041        Tcp = 2,
2042        Udp = 3,
2043    }
2044    impl Protocol {
2045        /// String value of the enum field names used in the ProtoBuf definition.
2046        ///
2047        /// The values are not transformed in any way and thus are considered stable
2048        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2049        pub fn as_str_name(&self) -> &'static str {
2050            match self {
2051                Self::Unknown => "UNKNOWN",
2052                Self::Http => "HTTP",
2053                Self::Tcp => "TCP",
2054                Self::Udp => "UDP",
2055            }
2056        }
2057        /// Creates an enum from field names used in the ProtoBuf definition.
2058        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2059            match value {
2060                "UNKNOWN" => Some(Self::Unknown),
2061                "HTTP" => Some(Self::Http),
2062                "TCP" => Some(Self::Tcp),
2063                "UDP" => Some(Self::Udp),
2064                _ => None,
2065            }
2066        }
2067    }
2068}
2069#[derive(Clone, PartialEq, ::prost::Message)]
2070pub struct FaultDetectSubRule {
2071    /// detect interval
2072    #[prost(uint32, tag = "1")]
2073    pub interval: u32,
2074    /// detect timeout
2075    #[prost(uint32, tag = "2")]
2076    pub timeout: u32,
2077    /// detect port
2078    #[prost(uint32, tag = "3")]
2079    pub port: u32,
2080    /// detect protocol
2081    #[prost(enumeration = "fault_detect_rule::Protocol", tag = "4")]
2082    pub protocol: i32,
2083    /// http detect config
2084    #[prost(message, optional, tag = "5")]
2085    pub http_config: ::core::option::Option<HttpProtocolConfig>,
2086    /// tcp detect config
2087    #[prost(message, optional, tag = "6")]
2088    pub tcp_config: ::core::option::Option<TcpProtocolConfig>,
2089    /// udp detect config
2090    #[prost(message, optional, tag = "7")]
2091    pub udp_config: ::core::option::Option<UdpProtocolConfig>,
2092    /// sub rule disabled
2093    #[prost(bool, tag = "8")]
2094    pub disable: bool,
2095}
2096#[derive(Clone, PartialEq, ::prost::Message)]
2097pub struct HttpProtocolConfig {
2098    #[prost(string, tag = "1")]
2099    pub method: ::prost::alloc::string::String,
2100    #[prost(string, tag = "2")]
2101    pub url: ::prost::alloc::string::String,
2102    #[prost(message, repeated, tag = "3")]
2103    pub headers: ::prost::alloc::vec::Vec<http_protocol_config::MessageHeader>,
2104    #[prost(string, tag = "4")]
2105    pub body: ::prost::alloc::string::String,
2106}
2107/// Nested message and enum types in `HttpProtocolConfig`.
2108pub mod http_protocol_config {
2109    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2110    pub struct MessageHeader {
2111        #[prost(string, tag = "1")]
2112        pub key: ::prost::alloc::string::String,
2113        #[prost(string, tag = "2")]
2114        pub value: ::prost::alloc::string::String,
2115    }
2116}
2117#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2118pub struct TcpProtocolConfig {
2119    #[prost(string, tag = "1")]
2120    pub send: ::prost::alloc::string::String,
2121    #[prost(string, repeated, tag = "2")]
2122    pub receive: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2123}
2124#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2125pub struct UdpProtocolConfig {
2126    #[prost(string, tag = "1")]
2127    pub send: ::prost::alloc::string::String,
2128    #[prost(string, repeated, tag = "2")]
2129    pub receive: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2130}
2131#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2132pub struct RuleMatcher {
2133    #[prost(message, optional, tag = "1")]
2134    pub source: ::core::option::Option<rule_matcher::SourceService>,
2135    #[prost(message, optional, tag = "2")]
2136    pub destination: ::core::option::Option<rule_matcher::DestinationService>,
2137}
2138/// Nested message and enum types in `RuleMatcher`.
2139pub mod rule_matcher {
2140    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2141    pub struct SourceService {
2142        #[prost(string, tag = "1")]
2143        pub service: ::prost::alloc::string::String,
2144        #[prost(string, tag = "2")]
2145        pub namespace: ::prost::alloc::string::String,
2146    }
2147    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2148    pub struct DestinationService {
2149        #[prost(string, tag = "1")]
2150        pub service: ::prost::alloc::string::String,
2151        #[prost(string, tag = "2")]
2152        pub namespace: ::prost::alloc::string::String,
2153        /// deprecated_filed  using api.path in blockConfig instead
2154        #[deprecated]
2155        #[prost(message, optional, tag = "3")]
2156        pub method: ::core::option::Option<super::MatchString>,
2157    }
2158}
2159/// new specific rule for circuitbreaker config
2160#[derive(Clone, PartialEq, ::prost::Message)]
2161pub struct CircuitBreakerRule {
2162    #[prost(string, tag = "1")]
2163    pub id: ::prost::alloc::string::String,
2164    /// rule name
2165    #[prost(string, tag = "2")]
2166    pub name: ::prost::alloc::string::String,
2167    /// enable this router
2168    #[prost(bool, tag = "3")]
2169    pub enable: bool,
2170    /// revision routing version
2171    #[prost(string, tag = "4")]
2172    pub revision: ::prost::alloc::string::String,
2173    /// ctime create time of the rules
2174    #[prost(string, tag = "5")]
2175    pub ctime: ::prost::alloc::string::String,
2176    /// mtime modify time of the rules
2177    #[prost(string, tag = "6")]
2178    pub mtime: ::prost::alloc::string::String,
2179    /// etime enable time of the rules
2180    #[prost(string, tag = "7")]
2181    pub etime: ::prost::alloc::string::String,
2182    /// description simple description rules
2183    #[prost(string, tag = "8")]
2184    pub description: ::prost::alloc::string::String,
2185    /// the circuitbreaking level
2186    #[prost(enumeration = "Level", tag = "9")]
2187    pub level: i32,
2188    /// match condition for this rule
2189    #[prost(message, optional, tag = "10")]
2190    pub rule_matcher: ::core::option::Option<RuleMatcher>,
2191    /// list for block configuration
2192    #[prost(message, repeated, tag = "11")]
2193    pub block_configs: ::prost::alloc::vec::Vec<CircuitBreakerPolicy>,
2194    /// priority rules priority
2195    #[prost(uint32, tag = "12")]
2196    pub priority: u32,
2197    /// 规则标签
2198    #[prost(map = "string, string", tag = "13")]
2199    pub metadata: ::std::collections::HashMap<
2200        ::prost::alloc::string::String,
2201        ::prost::alloc::string::String,
2202    >,
2203    /// 操作标志位
2204    #[prost(bool, tag = "14")]
2205    pub editable: bool,
2206    #[prost(bool, tag = "15")]
2207    pub deleteable: bool,
2208    /// namespace identifies the environment that owns this rule.
2209    #[prost(string, tag = "16")]
2210    pub namespace: ::prost::alloc::string::String,
2211}
2212/// the condition to judge an input invocation as an error
2213#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2214pub struct ErrorCondition {
2215    #[prost(enumeration = "error_condition::InputType", tag = "1")]
2216    pub input_type: i32,
2217    #[prost(message, optional, tag = "2")]
2218    pub condition: ::core::option::Option<MatchString>,
2219}
2220/// Nested message and enum types in `ErrorCondition`.
2221pub mod error_condition {
2222    #[derive(
2223        Clone,
2224        Copy,
2225        Debug,
2226        PartialEq,
2227        Eq,
2228        Hash,
2229        PartialOrd,
2230        Ord,
2231        ::prost::Enumeration
2232    )]
2233    #[repr(i32)]
2234    pub enum InputType {
2235        Unknown = 0,
2236        RetCode = 1,
2237        Delay = 2,
2238    }
2239    impl InputType {
2240        /// String value of the enum field names used in the ProtoBuf definition.
2241        ///
2242        /// The values are not transformed in any way and thus are considered stable
2243        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2244        pub fn as_str_name(&self) -> &'static str {
2245            match self {
2246                Self::Unknown => "UNKNOWN",
2247                Self::RetCode => "RET_CODE",
2248                Self::Delay => "DELAY",
2249            }
2250        }
2251        /// Creates an enum from field names used in the ProtoBuf definition.
2252        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2253            match value {
2254                "UNKNOWN" => Some(Self::Unknown),
2255                "RET_CODE" => Some(Self::RetCode),
2256                "DELAY" => Some(Self::Delay),
2257                _ => None,
2258            }
2259        }
2260    }
2261}
2262/// the error condition to trigger circuitbreaking
2263#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2264pub struct TriggerCondition {
2265    #[prost(enumeration = "trigger_condition::TriggerType", tag = "1")]
2266    pub trigger_type: i32,
2267    #[prost(uint32, tag = "2")]
2268    pub error_count: u32,
2269    #[prost(uint32, tag = "3")]
2270    pub error_percent: u32,
2271    #[prost(uint32, tag = "4")]
2272    pub interval: u32,
2273    #[prost(uint32, tag = "5")]
2274    pub minimum_request: u32,
2275}
2276/// Nested message and enum types in `TriggerCondition`.
2277pub mod trigger_condition {
2278    #[derive(
2279        Clone,
2280        Copy,
2281        Debug,
2282        PartialEq,
2283        Eq,
2284        Hash,
2285        PartialOrd,
2286        Ord,
2287        ::prost::Enumeration
2288    )]
2289    #[repr(i32)]
2290    pub enum TriggerType {
2291        Unknown = 0,
2292        ErrorRate = 1,
2293        ConsecutiveError = 2,
2294    }
2295    impl TriggerType {
2296        /// String value of the enum field names used in the ProtoBuf definition.
2297        ///
2298        /// The values are not transformed in any way and thus are considered stable
2299        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2300        pub fn as_str_name(&self) -> &'static str {
2301            match self {
2302                Self::Unknown => "UNKNOWN",
2303                Self::ErrorRate => "ERROR_RATE",
2304                Self::ConsecutiveError => "CONSECUTIVE_ERROR",
2305            }
2306        }
2307        /// Creates an enum from field names used in the ProtoBuf definition.
2308        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2309            match value {
2310                "UNKNOWN" => Some(Self::Unknown),
2311                "ERROR_RATE" => Some(Self::ErrorRate),
2312                "CONSECUTIVE_ERROR" => Some(Self::ConsecutiveError),
2313                _ => None,
2314            }
2315        }
2316    }
2317}
2318/// circuitbreaking OPEN status recover
2319#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2320pub struct RecoverCondition {
2321    /// seconds from open to half-open
2322    #[prost(uint32, tag = "1")]
2323    pub sleep_window: u32,
2324    /// consecutive success request to recover
2325    #[prost(uint32, tag = "2")]
2326    pub consecutive_success: u32,
2327}
2328/// fault detect config within circuitbreaking
2329#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2330pub struct FaultDetectConfig {
2331    #[prost(bool, tag = "1")]
2332    pub enable: bool,
2333}
2334/// circuitbreaking policy config
2335#[derive(Clone, PartialEq, ::prost::Message)]
2336pub struct CircuitBreakerPolicy {
2337    /// blocking strategy
2338    #[prost(message, optional, tag = "1")]
2339    pub block_config: ::core::option::Option<BlockConfig>,
2340    /// the maximum % of an upstream cluster that can be ejected
2341    #[prost(uint32, tag = "5")]
2342    pub max_ejection_percent: u32,
2343    /// recover condition to make resource open to close
2344    #[prost(message, optional, tag = "6")]
2345    pub recover_condition: ::core::option::Option<RecoverCondition>,
2346    /// fault detection enable config
2347    #[prost(message, optional, tag = "7")]
2348    pub fault_detect_config: ::core::option::Option<FaultDetectConfig>,
2349    /// fall back configuration
2350    #[prost(message, optional, tag = "8")]
2351    pub fallback_config: ::core::option::Option<FallbackConfig>,
2352}
2353/// blocking strategy
2354#[derive(Clone, PartialEq, ::prost::Message)]
2355pub struct BlockConfig {
2356    #[prost(string, tag = "1")]
2357    pub name: ::prost::alloc::string::String,
2358    /// blocking target APIs, any matched API enters this block strategy
2359    #[prost(message, repeated, tag = "2")]
2360    pub apis: ::prost::alloc::vec::Vec<Api>,
2361    /// conditions to judge an invocation as an error
2362    #[prost(message, repeated, tag = "3")]
2363    pub error_conditions: ::prost::alloc::vec::Vec<ErrorCondition>,
2364    /// trigger condition to trigger circuitbreaking
2365    #[prost(message, repeated, tag = "4")]
2366    pub trigger_conditions: ::prost::alloc::vec::Vec<TriggerCondition>,
2367    /// whether regex API matches are counted separately
2368    #[prost(bool, tag = "5")]
2369    pub regex_separate: bool,
2370}
2371/// fallback config
2372#[derive(Clone, PartialEq, ::prost::Message)]
2373pub struct FallbackConfig {
2374    #[prost(bool, tag = "1")]
2375    pub enable: bool,
2376    #[prost(message, optional, tag = "2")]
2377    pub response: ::core::option::Option<FallbackResponse>,
2378}
2379/// fallback response
2380#[derive(Clone, PartialEq, ::prost::Message)]
2381pub struct FallbackResponse {
2382    #[prost(string, tag = "1")]
2383    pub code: ::prost::alloc::string::String,
2384    #[prost(message, repeated, tag = "2")]
2385    pub headers: ::prost::alloc::vec::Vec<fallback_response::MessageHeader>,
2386    #[prost(string, tag = "3")]
2387    pub body: ::prost::alloc::string::String,
2388}
2389/// Nested message and enum types in `FallbackResponse`.
2390pub mod fallback_response {
2391    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2392    pub struct MessageHeader {
2393        #[prost(string, tag = "1")]
2394        pub key: ::prost::alloc::string::String,
2395        #[prost(string, tag = "2")]
2396        pub value: ::prost::alloc::string::String,
2397    }
2398}
2399/// circuitbreaking level
2400#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2401#[repr(i32)]
2402pub enum Level {
2403    Unknown = 0,
2404    /// service level circuitbreaking
2405    Service = 1,
2406    /// method level circuitbreaking
2407    Method = 2,
2408    /// group level circuitbreaking
2409    Group = 3,
2410    /// instance level circuitbreaking
2411    Instance = 4,
2412}
2413impl Level {
2414    /// String value of the enum field names used in the ProtoBuf definition.
2415    ///
2416    /// The values are not transformed in any way and thus are considered stable
2417    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2418    pub fn as_str_name(&self) -> &'static str {
2419        match self {
2420            Self::Unknown => "UNKNOWN",
2421            Self::Service => "SERVICE",
2422            Self::Method => "METHOD",
2423            Self::Group => "GROUP",
2424            Self::Instance => "INSTANCE",
2425        }
2426    }
2427    /// Creates an enum from field names used in the ProtoBuf definition.
2428    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2429        match value {
2430            "UNKNOWN" => Some(Self::Unknown),
2431            "SERVICE" => Some(Self::Service),
2432            "METHOD" => Some(Self::Method),
2433            "GROUP" => Some(Self::Group),
2434            "INSTANCE" => Some(Self::Instance),
2435            _ => None,
2436        }
2437    }
2438}
2439/// MCPServer describes an MCP server registry entry.
2440#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2441pub struct McpServer {
2442    #[prost(string, tag = "1")]
2443    pub id: ::prost::alloc::string::String,
2444    #[prost(string, tag = "2")]
2445    pub name: ::prost::alloc::string::String,
2446    #[prost(string, tag = "3")]
2447    pub namespace: ::prost::alloc::string::String,
2448    #[prost(string, tag = "4")]
2449    pub ports: ::prost::alloc::string::String,
2450    #[prost(string, tag = "5")]
2451    pub business: ::prost::alloc::string::String,
2452    #[prost(string, tag = "6")]
2453    pub department: ::prost::alloc::string::String,
2454    #[prost(string, tag = "7")]
2455    pub description: ::prost::alloc::string::String,
2456    #[prost(string, tag = "8")]
2457    pub revision: ::prost::alloc::string::String,
2458    #[prost(uint32, tag = "9")]
2459    pub flag: u32,
2460    #[prost(string, tag = "10")]
2461    pub reference: ::prost::alloc::string::String,
2462    #[prost(string, tag = "11")]
2463    pub protocol: ::prost::alloc::string::String,
2464    #[prost(string, tag = "12")]
2465    pub ctime: ::prost::alloc::string::String,
2466    #[prost(string, tag = "13")]
2467    pub mtime: ::prost::alloc::string::String,
2468    #[prost(string, tag = "14")]
2469    pub export_to: ::prost::alloc::string::String,
2470    /// backend_type indicates how this MCP server reaches its backend.
2471    /// Supported values: service, address.
2472    #[prost(string, tag = "15")]
2473    pub backend_type: ::prost::alloc::string::String,
2474    /// backend_service_namespace is set when backend_type is service.
2475    #[prost(string, tag = "16")]
2476    pub backend_service_namespace: ::prost::alloc::string::String,
2477    /// backend_service_name is set when backend_type is service.
2478    #[prost(string, tag = "17")]
2479    pub backend_service_name: ::prost::alloc::string::String,
2480    /// backend_address is set when backend_type is address.
2481    #[prost(string, tag = "18")]
2482    pub backend_address: ::prost::alloc::string::String,
2483}
2484#[derive(Clone, PartialEq, ::prost::Message)]
2485pub struct McpServers {
2486    #[prost(message, repeated, tag = "1")]
2487    pub servers: ::prost::alloc::vec::Vec<McpServer>,
2488}
2489#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2490pub struct McpServerQuery {
2491    #[prost(string, tag = "1")]
2492    pub name: ::prost::alloc::string::String,
2493    #[prost(string, tag = "2")]
2494    pub namespace: ::prost::alloc::string::String,
2495    #[prost(string, tag = "3")]
2496    pub business: ::prost::alloc::string::String,
2497    #[prost(string, tag = "4")]
2498    pub department: ::prost::alloc::string::String,
2499    #[prost(string, tag = "5")]
2500    pub protocol: ::prost::alloc::string::String,
2501    #[prost(uint32, tag = "6")]
2502    pub offset: u32,
2503    #[prost(uint32, tag = "7")]
2504    pub limit: u32,
2505    #[prost(string, tag = "8")]
2506    pub backend_type: ::prost::alloc::string::String,
2507    #[prost(string, tag = "9")]
2508    pub backend_service_namespace: ::prost::alloc::string::String,
2509    #[prost(string, tag = "10")]
2510    pub backend_service_name: ::prost::alloc::string::String,
2511}
2512#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2513pub struct McpServerDeleteRequest {
2514    #[prost(string, repeated, tag = "1")]
2515    pub server_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2516}
2517#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2518pub struct McpServerTool {
2519    #[prost(string, tag = "1")]
2520    pub id: ::prost::alloc::string::String,
2521    #[prost(string, tag = "2")]
2522    pub mcp_server_id: ::prost::alloc::string::String,
2523    #[prost(string, tag = "3")]
2524    pub name: ::prost::alloc::string::String,
2525    #[prost(string, tag = "4")]
2526    pub description: ::prost::alloc::string::String,
2527    #[prost(string, tag = "5")]
2528    pub input_schema: ::prost::alloc::string::String,
2529    #[prost(string, tag = "6")]
2530    pub output_schema: ::prost::alloc::string::String,
2531    #[prost(string, tag = "7")]
2532    pub annotations: ::prost::alloc::string::String,
2533    #[prost(uint32, tag = "8")]
2534    pub flag: u32,
2535    #[prost(string, tag = "9")]
2536    pub ctime: ::prost::alloc::string::String,
2537    #[prost(string, tag = "10")]
2538    pub mtime: ::prost::alloc::string::String,
2539}
2540#[derive(Clone, PartialEq, ::prost::Message)]
2541pub struct McpServerTools {
2542    #[prost(message, repeated, tag = "1")]
2543    pub tools: ::prost::alloc::vec::Vec<McpServerTool>,
2544}
2545#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2546pub struct McpServerToolQuery {
2547    #[prost(string, tag = "1")]
2548    pub server_id: ::prost::alloc::string::String,
2549    #[prost(string, tag = "2")]
2550    pub server_name: ::prost::alloc::string::String,
2551    #[prost(string, tag = "3")]
2552    pub server_namespace: ::prost::alloc::string::String,
2553    #[prost(uint32, tag = "4")]
2554    pub offset: u32,
2555    #[prost(uint32, tag = "5")]
2556    pub limit: u32,
2557}
2558#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2559pub struct McpServerToolDeleteRequest {
2560    #[prost(string, repeated, tag = "1")]
2561    pub tool_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2562}
2563/// 流量 Mock 规则,用于在命中请求时直接返回模拟响应。
2564#[derive(Clone, PartialEq, ::prost::Message)]
2565pub struct TrafficMock {
2566    #[prost(string, tag = "1")]
2567    pub id: ::prost::alloc::string::String,
2568    /// 流量 Mock 规则名称
2569    #[prost(string, tag = "2")]
2570    pub name: ::prost::alloc::string::String,
2571    /// 流量 Mock 规则描述
2572    #[prost(string, tag = "3")]
2573    pub description: ::prost::alloc::string::String,
2574    /// 主调服务范围,namespace/service 均为 "\*" 表示全部服务。
2575    #[prost(message, optional, tag = "4")]
2576    pub caller: ::core::option::Option<SourceService>,
2577    /// 被调服务,规则归属和下发绑定到该服务。
2578    #[prost(message, optional, tag = "5")]
2579    pub callee: ::core::option::Option<DestinationService>,
2580    /// 流量 Mock 子规则集合
2581    #[prost(message, repeated, tag = "6")]
2582    pub rules: ::prost::alloc::vec::Vec<MockRule>,
2583    /// 是否启用
2584    #[prost(bool, tag = "7")]
2585    pub enable: bool,
2586    /// 流量 Mock 规则 revision 信息
2587    #[prost(string, tag = "8")]
2588    pub revision: ::prost::alloc::string::String,
2589    /// 规则优先级
2590    #[prost(uint32, tag = "9")]
2591    pub priority: u32,
2592    /// 创建时间
2593    #[prost(string, tag = "10")]
2594    pub ctime: ::prost::alloc::string::String,
2595    /// 修改时间
2596    #[prost(string, tag = "11")]
2597    pub mtime: ::prost::alloc::string::String,
2598    /// 规则标签
2599    #[prost(map = "string, string", tag = "12")]
2600    pub metadata: ::std::collections::HashMap<
2601        ::prost::alloc::string::String,
2602        ::prost::alloc::string::String,
2603    >,
2604    /// 操作标志位
2605    #[prost(bool, tag = "13")]
2606    pub editable: bool,
2607    #[prost(bool, tag = "14")]
2608    pub deleteable: bool,
2609    /// namespace identifies the environment that owns this rule.
2610    #[prost(string, tag = "15")]
2611    pub namespace: ::prost::alloc::string::String,
2612}
2613#[derive(Clone, PartialEq, ::prost::Message)]
2614pub struct MockRule {
2615    /// Mock 接口范围,命中任一 API 即执行 Mock。
2616    #[prost(message, repeated, tag = "1")]
2617    pub apis: ::prost::alloc::vec::Vec<Api>,
2618    /// 主调、请求头、查询参数、路径、Cookie 等流量匹配条件。
2619    #[prost(message, optional, tag = "2")]
2620    pub traffic_match_rule: ::core::option::Option<TrafficMatchRule>,
2621    /// 命中后返回的模拟响应
2622    #[prost(message, optional, tag = "3")]
2623    pub response: ::core::option::Option<MockResponse>,
2624    /// Mock 命中百分比,0-100
2625    #[prost(uint32, tag = "4")]
2626    pub mock_percent: u32,
2627    /// 响应延迟,默认无延迟
2628    #[prost(message, optional, tag = "5")]
2629    pub delay: ::core::option::Option<::prost_types::Duration>,
2630    /// 子规则是否禁用,默认启用
2631    #[prost(bool, tag = "6")]
2632    pub disable: bool,
2633}
2634#[derive(Clone, PartialEq, ::prost::Message)]
2635pub struct MockResponse {
2636    /// 业务错误码
2637    #[prost(string, tag = "1")]
2638    pub code: ::prost::alloc::string::String,
2639    /// 响应头
2640    #[prost(map = "string, string", tag = "2")]
2641    pub headers: ::std::collections::HashMap<
2642        ::prost::alloc::string::String,
2643        ::prost::alloc::string::String,
2644    >,
2645    /// 响应体
2646    #[prost(string, tag = "3")]
2647    pub body: ::prost::alloc::string::String,
2648}
2649#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2650pub struct HeartbeatRecord {
2651    #[prost(string, tag = "1")]
2652    pub instance_id: ::prost::alloc::string::String,
2653    #[prost(int64, tag = "6")]
2654    pub last_heartbeat_sec: i64,
2655    #[prost(bool, tag = "7")]
2656    pub exist: bool,
2657}
2658#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2659pub struct InstanceHeartbeat {
2660    #[prost(string, tag = "1")]
2661    pub instance_id: ::prost::alloc::string::String,
2662    #[prost(string, tag = "2")]
2663    pub service: ::prost::alloc::string::String,
2664    #[prost(string, tag = "3")]
2665    pub namespace: ::prost::alloc::string::String,
2666    #[prost(string, tag = "4")]
2667    pub host: ::prost::alloc::string::String,
2668    #[prost(uint32, tag = "5")]
2669    pub port: u32,
2670}
2671#[derive(Clone, PartialEq, ::prost::Message)]
2672pub struct HeartbeatsRequest {
2673    #[prost(message, repeated, tag = "1")]
2674    pub heartbeats: ::prost::alloc::vec::Vec<InstanceHeartbeat>,
2675}
2676#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2677pub struct HeartbeatsResponse {}
2678#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2679pub struct GetHeartbeatsRequest {
2680    #[prost(string, repeated, tag = "1")]
2681    pub instance_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2682}
2683#[derive(Clone, PartialEq, ::prost::Message)]
2684pub struct GetHeartbeatsResponse {
2685    #[prost(message, repeated, tag = "1")]
2686    pub records: ::prost::alloc::vec::Vec<HeartbeatRecord>,
2687}
2688#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2689pub struct DelHeartbeatsRequest {
2690    #[prost(string, repeated, tag = "1")]
2691    pub instance_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2692}
2693#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2694pub struct DelHeartbeatsResponse {
2695    #[prost(uint32, tag = "1")]
2696    pub code: u32,
2697    #[prost(string, tag = "2")]
2698    pub info: ::prost::alloc::string::String,
2699}
2700#[derive(Clone, PartialEq, ::prost::Message)]
2701pub struct Client {
2702    /// client ip
2703    #[prost(string, tag = "1")]
2704    pub host: ::prost::alloc::string::String,
2705    /// client type
2706    #[prost(enumeration = "client::ClientType", tag = "2")]
2707    pub r#type: i32,
2708    /// client version
2709    #[prost(string, tag = "3")]
2710    pub version: ::prost::alloc::string::String,
2711    /// location 客户端地址位置
2712    #[prost(message, optional, tag = "4")]
2713    pub location: ::core::option::Option<Location>,
2714    /// client id
2715    #[prost(string, tag = "5")]
2716    pub id: ::prost::alloc::string::String,
2717    /// stat 监控数据上报信息
2718    #[prost(message, repeated, tag = "6")]
2719    pub stat: ::prost::alloc::vec::Vec<StatInfo>,
2720    /// creation time
2721    #[prost(string, tag = "7")]
2722    pub ctime: ::prost::alloc::string::String,
2723    /// modify time
2724    #[prost(string, tag = "8")]
2725    pub mtime: ::prost::alloc::string::String,
2726}
2727/// Nested message and enum types in `Client`.
2728pub mod client {
2729    /// client type
2730    #[derive(
2731        Clone,
2732        Copy,
2733        Debug,
2734        PartialEq,
2735        Eq,
2736        Hash,
2737        PartialOrd,
2738        Ord,
2739        ::prost::Enumeration
2740    )]
2741    #[repr(i32)]
2742    pub enum ClientType {
2743        Unknown = 0,
2744        Sdk = 1,
2745        Agent = 2,
2746    }
2747    impl ClientType {
2748        /// String value of the enum field names used in the ProtoBuf definition.
2749        ///
2750        /// The values are not transformed in any way and thus are considered stable
2751        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2752        pub fn as_str_name(&self) -> &'static str {
2753            match self {
2754                Self::Unknown => "UNKNOWN",
2755                Self::Sdk => "SDK",
2756                Self::Agent => "AGENT",
2757            }
2758        }
2759        /// Creates an enum from field names used in the ProtoBuf definition.
2760        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2761            match value {
2762                "UNKNOWN" => Some(Self::Unknown),
2763                "SDK" => Some(Self::Sdk),
2764                "AGENT" => Some(Self::Agent),
2765                _ => None,
2766            }
2767        }
2768    }
2769}
2770#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2771pub struct StatInfo {
2772    /// target ip
2773    #[prost(string, tag = "1")]
2774    pub target: ::prost::alloc::string::String,
2775    /// target port
2776    #[prost(uint32, tag = "2")]
2777    pub port: u32,
2778    /// api path
2779    #[prost(string, tag = "3")]
2780    pub path: ::prost::alloc::string::String,
2781    /// metrics protocol
2782    #[prost(string, tag = "4")]
2783    pub protocol: ::prost::alloc::string::String,
2784}
2785#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2786pub struct SimpleService {
2787    #[prost(string, tag = "2")]
2788    pub name: ::prost::alloc::string::String,
2789    #[prost(string, tag = "3")]
2790    pub namespace: ::prost::alloc::string::String,
2791}
2792#[derive(Clone, PartialEq, ::prost::Message)]
2793pub struct Service {
2794    #[prost(string, tag = "1")]
2795    pub id: ::prost::alloc::string::String,
2796    #[prost(string, tag = "2")]
2797    pub name: ::prost::alloc::string::String,
2798    #[prost(string, tag = "3")]
2799    pub namespace: ::prost::alloc::string::String,
2800    #[prost(map = "string, string", tag = "4")]
2801    pub metadata: ::std::collections::HashMap<
2802        ::prost::alloc::string::String,
2803        ::prost::alloc::string::String,
2804    >,
2805    #[prost(string, tag = "5")]
2806    pub ports: ::prost::alloc::string::String,
2807    #[prost(string, tag = "6")]
2808    pub business: ::prost::alloc::string::String,
2809    #[prost(string, tag = "7")]
2810    pub department: ::prost::alloc::string::String,
2811    #[prost(string, tag = "8")]
2812    pub cmdb_mod1: ::prost::alloc::string::String,
2813    #[prost(string, tag = "9")]
2814    pub cmdb_mod2: ::prost::alloc::string::String,
2815    #[prost(string, tag = "10")]
2816    pub cmdb_mod3: ::prost::alloc::string::String,
2817    #[prost(string, tag = "11")]
2818    pub comment: ::prost::alloc::string::String,
2819    #[prost(string, tag = "12")]
2820    pub owners: ::prost::alloc::string::String,
2821    #[prost(string, tag = "13")]
2822    pub token: ::prost::alloc::string::String,
2823    #[prost(string, tag = "14")]
2824    pub ctime: ::prost::alloc::string::String,
2825    #[prost(string, tag = "15")]
2826    pub mtime: ::prost::alloc::string::String,
2827    #[prost(string, tag = "16")]
2828    pub revision: ::prost::alloc::string::String,
2829    #[prost(string, repeated, tag = "17")]
2830    pub export_to: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2831    #[prost(uint32, tag = "30")]
2832    pub total_instance_count: u32,
2833    #[prost(uint32, tag = "31")]
2834    pub healthy_instance_count: u32,
2835    #[prost(bool, tag = "40")]
2836    pub editable: bool,
2837    #[prost(bool, tag = "41")]
2838    pub deleteable: bool,
2839}
2840/// LogicalService is a control-plane-only aggregate that groups environment
2841/// services which may use different runtime names. It is never used for SDK
2842/// registration or discovery addressing.
2843#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2844pub struct LogicalService {
2845    #[prost(string, tag = "1")]
2846    pub id: ::prost::alloc::string::String,
2847    #[prost(string, tag = "2")]
2848    pub name: ::prost::alloc::string::String,
2849    #[prost(string, tag = "3")]
2850    pub comment: ::prost::alloc::string::String,
2851    #[prost(string, tag = "4")]
2852    pub owners: ::prost::alloc::string::String,
2853    #[prost(string, tag = "5")]
2854    pub business: ::prost::alloc::string::String,
2855    #[prost(string, tag = "6")]
2856    pub department: ::prost::alloc::string::String,
2857    #[prost(string, tag = "7")]
2858    pub revision: ::prost::alloc::string::String,
2859    #[prost(string, tag = "8")]
2860    pub ctime: ::prost::alloc::string::String,
2861    #[prost(string, tag = "9")]
2862    pub mtime: ::prost::alloc::string::String,
2863    #[prost(uint32, tag = "20")]
2864    pub environment_count: u32,
2865    #[prost(uint32, tag = "21")]
2866    pub total_instance_count: u32,
2867    #[prost(uint32, tag = "22")]
2868    pub healthy_instance_count: u32,
2869    #[prost(bool, tag = "30")]
2870    pub editable: bool,
2871    #[prost(bool, tag = "31")]
2872    pub deleteable: bool,
2873}
2874/// ServiceEnvironmentBinding connects one existing runtime Service to one
2875/// LogicalService. service_id is the authoritative binding identity;
2876/// namespace and service_name are response snapshots for management clients.
2877#[derive(Clone, PartialEq, ::prost::Message)]
2878pub struct ServiceEnvironmentBinding {
2879    #[prost(string, tag = "1")]
2880    pub logical_service_id: ::prost::alloc::string::String,
2881    #[prost(string, tag = "2")]
2882    pub service_id: ::prost::alloc::string::String,
2883    #[prost(string, tag = "3")]
2884    pub namespace: ::prost::alloc::string::String,
2885    #[prost(string, tag = "4")]
2886    pub service_name: ::prost::alloc::string::String,
2887    #[prost(string, tag = "5")]
2888    pub ctime: ::prost::alloc::string::String,
2889    #[prost(string, tag = "6")]
2890    pub mtime: ::prost::alloc::string::String,
2891    #[prost(message, optional, tag = "10")]
2892    pub service: ::core::option::Option<Service>,
2893}
2894#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2895pub struct BindServiceEnvironmentRequest {
2896    #[prost(string, tag = "1")]
2897    pub logical_service_id: ::prost::alloc::string::String,
2898    #[prost(string, tag = "2")]
2899    pub service_id: ::prost::alloc::string::String,
2900}
2901#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2902pub struct UnbindServiceEnvironmentRequest {
2903    #[prost(string, tag = "1")]
2904    pub logical_service_id: ::prost::alloc::string::String,
2905    #[prost(string, tag = "2")]
2906    pub service_id: ::prost::alloc::string::String,
2907}
2908#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2909pub struct ServiceAlias {
2910    #[prost(string, tag = "1")]
2911    pub service: ::prost::alloc::string::String,
2912    #[prost(string, tag = "2")]
2913    pub namespace: ::prost::alloc::string::String,
2914    #[prost(string, tag = "3")]
2915    pub alias: ::prost::alloc::string::String,
2916    #[prost(string, tag = "4")]
2917    pub alias_namespace: ::prost::alloc::string::String,
2918    #[prost(enumeration = "AliasType", tag = "5")]
2919    pub r#type: i32,
2920    #[prost(string, tag = "6")]
2921    pub owners: ::prost::alloc::string::String,
2922    #[prost(string, tag = "7")]
2923    pub comment: ::prost::alloc::string::String,
2924    #[prost(string, tag = "8")]
2925    pub service_token: ::prost::alloc::string::String,
2926    #[prost(string, tag = "9")]
2927    pub ctime: ::prost::alloc::string::String,
2928    #[prost(string, tag = "10")]
2929    pub mtime: ::prost::alloc::string::String,
2930    #[prost(string, tag = "11")]
2931    pub id: ::prost::alloc::string::String,
2932    #[prost(bool, tag = "12")]
2933    pub editable: bool,
2934    #[prost(bool, tag = "13")]
2935    pub deleteable: bool,
2936}
2937#[derive(Clone, PartialEq, ::prost::Message)]
2938pub struct Instance {
2939    #[prost(string, tag = "1")]
2940    pub id: ::prost::alloc::string::String,
2941    #[prost(string, tag = "2")]
2942    pub service: ::prost::alloc::string::String,
2943    #[prost(string, tag = "3")]
2944    pub namespace: ::prost::alloc::string::String,
2945    #[prost(string, tag = "4")]
2946    pub host: ::prost::alloc::string::String,
2947    #[prost(uint32, tag = "5")]
2948    pub port: u32,
2949    #[prost(string, tag = "6")]
2950    pub protocol: ::prost::alloc::string::String,
2951    #[prost(string, tag = "7")]
2952    pub version: ::prost::alloc::string::String,
2953    #[prost(uint32, tag = "8")]
2954    pub priority: u32,
2955    #[prost(uint32, tag = "9")]
2956    pub weight: u32,
2957    #[prost(bool, tag = "20")]
2958    pub enable_health_check: bool,
2959    #[prost(message, optional, tag = "10")]
2960    pub health_check: ::core::option::Option<HealthCheck>,
2961    #[prost(bool, tag = "11")]
2962    pub healthy: bool,
2963    #[prost(bool, tag = "12")]
2964    pub isolate: bool,
2965    #[prost(message, optional, tag = "13")]
2966    pub location: ::core::option::Option<Location>,
2967    #[prost(map = "string, string", tag = "14")]
2968    pub metadata: ::std::collections::HashMap<
2969        ::prost::alloc::string::String,
2970        ::prost::alloc::string::String,
2971    >,
2972    #[prost(string, tag = "16")]
2973    pub ctime: ::prost::alloc::string::String,
2974    #[prost(string, tag = "17")]
2975    pub mtime: ::prost::alloc::string::String,
2976    #[prost(string, tag = "18")]
2977    pub revision: ::prost::alloc::string::String,
2978}
2979#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2980pub struct HealthCheck {
2981    #[prost(enumeration = "health_check::HealthCheckType", tag = "1")]
2982    pub r#type: i32,
2983    #[prost(message, optional, tag = "2")]
2984    pub heartbeat: ::core::option::Option<HeartbeatHealthCheck>,
2985    #[prost(message, optional, tag = "3")]
2986    pub tcp: ::core::option::Option<TcpHealthCheck>,
2987    #[prost(message, optional, tag = "4")]
2988    pub http: ::core::option::Option<HttpHealthCheck>,
2989}
2990/// Nested message and enum types in `HealthCheck`.
2991pub mod health_check {
2992    #[derive(
2993        Clone,
2994        Copy,
2995        Debug,
2996        PartialEq,
2997        Eq,
2998        Hash,
2999        PartialOrd,
3000        Ord,
3001        ::prost::Enumeration
3002    )]
3003    #[repr(i32)]
3004    pub enum HealthCheckType {
3005        Unknown = 0,
3006        Heartbeat = 1,
3007        Tcp = 2,
3008        Http = 3,
3009    }
3010    impl HealthCheckType {
3011        /// String value of the enum field names used in the ProtoBuf definition.
3012        ///
3013        /// The values are not transformed in any way and thus are considered stable
3014        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3015        pub fn as_str_name(&self) -> &'static str {
3016            match self {
3017                Self::Unknown => "UNKNOWN",
3018                Self::Heartbeat => "HEARTBEAT",
3019                Self::Tcp => "TCP",
3020                Self::Http => "HTTP",
3021            }
3022        }
3023        /// Creates an enum from field names used in the ProtoBuf definition.
3024        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3025            match value {
3026                "UNKNOWN" => Some(Self::Unknown),
3027                "HEARTBEAT" => Some(Self::Heartbeat),
3028                "TCP" => Some(Self::Tcp),
3029                "HTTP" => Some(Self::Http),
3030                _ => None,
3031            }
3032        }
3033    }
3034}
3035#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3036pub struct HeartbeatHealthCheck {
3037    #[prost(uint32, tag = "1")]
3038    pub ttl: u32,
3039}
3040#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3041pub struct TcpHealthCheck {
3042    #[prost(uint32, tag = "1")]
3043    pub interval: u32,
3044}
3045#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3046pub struct HttpHealthCheck {
3047    #[prost(uint32, tag = "1")]
3048    pub interval: u32,
3049    #[prost(string, tag = "2")]
3050    pub path: ::prost::alloc::string::String,
3051}
3052#[derive(Clone, PartialEq, ::prost::Message)]
3053pub struct InstanceLabels {
3054    #[prost(string, tag = "2")]
3055    pub namespace: ::prost::alloc::string::String,
3056    #[prost(string, tag = "3")]
3057    pub service: ::prost::alloc::string::String,
3058    #[prost(string, tag = "4")]
3059    pub service_id: ::prost::alloc::string::String,
3060    #[prost(map = "string, message", tag = "1")]
3061    pub labels: ::std::collections::HashMap<::prost::alloc::string::String, StringList>,
3062}
3063#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3064pub struct ServiceKey {
3065    #[prost(string, tag = "1")]
3066    pub name: ::prost::alloc::string::String,
3067    #[prost(string, tag = "2")]
3068    pub namespace: ::prost::alloc::string::String,
3069}
3070#[derive(Clone, PartialEq, ::prost::Message)]
3071pub struct ServiceSubscriber {
3072    #[prost(message, optional, tag = "1")]
3073    pub caller: ::core::option::Option<ServiceKey>,
3074    #[prost(message, repeated, tag = "2")]
3075    pub callee: ::prost::alloc::vec::Vec<ServiceKey>,
3076}
3077#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3078#[repr(i32)]
3079pub enum AliasType {
3080    Default = 0,
3081    Cl5sid = 1,
3082}
3083impl AliasType {
3084    /// String value of the enum field names used in the ProtoBuf definition.
3085    ///
3086    /// The values are not transformed in any way and thus are considered stable
3087    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3088    pub fn as_str_name(&self) -> &'static str {
3089        match self {
3090            Self::Default => "DEFAULT",
3091            Self::Cl5sid => "CL5SID",
3092        }
3093    }
3094    /// Creates an enum from field names used in the ProtoBuf definition.
3095    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3096        match value {
3097            "DEFAULT" => Some(Self::Default),
3098            "CL5SID" => Some(Self::Cl5sid),
3099            _ => None,
3100        }
3101    }
3102}
3103#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3104pub struct Response {
3105    #[prost(uint32, tag = "1")]
3106    pub code: u32,
3107    #[prost(string, tag = "2")]
3108    pub info: ::prost::alloc::string::String,
3109    #[prost(message, optional, tag = "3")]
3110    pub data: ::core::option::Option<::prost_types::Any>,
3111}
3112#[derive(Clone, PartialEq, ::prost::Message)]
3113pub struct BatchWriteResponse {
3114    #[prost(uint32, tag = "1")]
3115    pub code: u32,
3116    #[prost(string, tag = "2")]
3117    pub info: ::prost::alloc::string::String,
3118    #[prost(uint32, tag = "3")]
3119    pub size: u32,
3120    #[prost(message, repeated, tag = "4")]
3121    pub responses: ::prost::alloc::vec::Vec<Response>,
3122}
3123#[derive(Clone, PartialEq, ::prost::Message)]
3124pub struct BatchQueryResponse {
3125    #[prost(uint32, tag = "1")]
3126    pub code: u32,
3127    #[prost(string, tag = "2")]
3128    pub info: ::prost::alloc::string::String,
3129    #[prost(uint32, tag = "3")]
3130    pub amount: u32,
3131    #[prost(uint32, tag = "4")]
3132    pub size: u32,
3133    #[prost(message, repeated, tag = "5")]
3134    pub data: ::prost::alloc::vec::Vec<::prost_types::Any>,
3135}
3136/// WorkloadEvidence 是可选的实例级 bootstrap 证据。
3137/// 所有字段均为敏感数据,不得记录日志、持久化或进入普通缓存。
3138#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3139pub struct WorkloadEvidence {
3140    #[prost(oneof = "workload_evidence::Evidence", tags = "1, 2")]
3141    pub evidence: ::core::option::Option<workload_evidence::Evidence>,
3142}
3143/// Nested message and enum types in `WorkloadEvidence`.
3144pub mod workload_evidence {
3145    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
3146    pub enum Evidence {
3147        #[prost(string, tag = "1")]
3148        KubernetesServiceAccountToken(::prost::alloc::string::String),
3149        #[prost(string, tag = "2")]
3150        CloudIdentityToken(::prost::alloc::string::String),
3151    }
3152}
3153/// WorkloadCredentialIssueRequest 不携带 namespace、service 或 subject。
3154/// control-plane 必须从 gRPC metadata authorization 中已验证的 service token
3155/// 推导服务 principal;请求体不能选择或覆盖目标身份。
3156#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3157pub struct WorkloadCredentialIssueRequest {
3158    /// 当前协议版本固定为 1;未知版本必须 fail-closed。
3159    #[prost(uint32, tag = "1")]
3160    pub protocol_version: u32,
3161    /// 客户端生成的请求关联 ID,仅用于观测与问题定位;不能作为安全主体、
3162    /// 授权依据、凭证绑定依据或敏感响应缓存键。
3163    #[prost(string, tag = "2")]
3164    pub request_id: ::prost::alloc::string::String,
3165    /// 用于防止在身份配置更新后按旧 descriptor 签发。
3166    #[prost(string, tag = "3")]
3167    pub expected_identity_revision: ::prost::alloc::string::String,
3168    /// 调用方可接受的格式;为空时由服务端选择当前默认格式。
3169    #[prost(enumeration = "WorkloadCredentialFormat", repeated, tag = "4")]
3170    pub accepted_formats: ::prost::alloc::vec::Vec<i32>,
3171    /// 为空时只使用 service token bootstrap,并返回 SERVICE_TOKEN binding。
3172    #[prost(message, optional, tag = "5")]
3173    pub evidence: ::core::option::Option<WorkloadEvidence>,
3174}
3175/// Renew 除 metadata service token 外还必须验证 current_credential:它必须未过期、
3176/// 未吊销,并与 metadata principal 解析到同一个 ServiceIdentity subject。
3177/// 已过期凭证不能 Renew,调用方必须重新执行 Issue/bootstrap。
3178#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3179pub struct WorkloadCredentialRenewRequest {
3180    #[prost(uint32, tag = "1")]
3181    pub protocol_version: u32,
3182    /// 客户端生成的请求关联 ID,仅用于观测与问题定位;不能作为安全主体、
3183    /// 授权依据、凭证绑定依据或敏感响应缓存键。
3184    #[prost(string, tag = "2")]
3185    pub request_id: ::prost::alloc::string::String,
3186    /// 敏感字段,不得记录日志或进入普通缓存。
3187    #[prost(string, tag = "3")]
3188    pub current_credential: ::prost::alloc::string::String,
3189    #[prost(enumeration = "WorkloadCredentialFormat", repeated, tag = "4")]
3190    pub accepted_formats: ::prost::alloc::vec::Vec<i32>,
3191    /// 签发策略要求重新证明 workload 时提供。
3192    #[prost(message, optional, tag = "5")]
3193    pub evidence: ::core::option::Option<WorkloadEvidence>,
3194}
3195/// WorkloadCredential 是单个已认证 SDK/workload 的敏感数据面凭证。
3196/// serialized JWT 的必选 claims 为 iss/sub/aud/iat/nbf/exp/jti,以及
3197/// pole_ver、pole_trust_domain、pole_namespace、pole_service、
3198/// pole_identity_revision、pole_binding_type。只有验证过实例级 evidence 后
3199/// 才允许包含 pole_workload_id。数据面使用保留 Header/metadata
3200/// x-pole-workload-credential 携带,不能与 control-plane authorization 混用。
3201#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3202pub struct WorkloadCredential {
3203    #[prost(enumeration = "WorkloadCredentialFormat", tag = "1")]
3204    pub format: i32,
3205    /// compact JWT;任何读取本字段的路径都必须按 secret 处理。
3206    #[prost(string, tag = "2")]
3207    pub serialized: ::prost::alloc::string::String,
3208    #[prost(string, tag = "3")]
3209    pub credential_id: ::prost::alloc::string::String,
3210    #[prost(string, tag = "4")]
3211    pub key_id: ::prost::alloc::string::String,
3212    #[prost(string, tag = "5")]
3213    pub trust_bundle_version: ::prost::alloc::string::String,
3214    #[prost(message, optional, tag = "6")]
3215    pub issued_at: ::core::option::Option<::prost_types::Timestamp>,
3216    #[prost(message, optional, tag = "7")]
3217    pub not_before: ::core::option::Option<::prost_types::Timestamp>,
3218    #[prost(message, optional, tag = "8")]
3219    pub expires_at: ::core::option::Option<::prost_types::Timestamp>,
3220    #[prost(message, optional, tag = "9")]
3221    pub renew_after: ::core::option::Option<::prost_types::Timestamp>,
3222    #[prost(enumeration = "WorkloadBindingType", tag = "10")]
3223    pub binding_type: i32,
3224}
3225#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3226pub struct WorkloadCredentialResponse {
3227    #[prost(uint32, tag = "1")]
3228    pub code: u32,
3229    /// 只能返回稳定、非敏感的错误信息,不得包含 credential、subject 或 evidence。
3230    #[prost(string, tag = "2")]
3231    pub info: ::prost::alloc::string::String,
3232    /// 仅 code=ExecuteSuccess 时存在。
3233    #[prost(message, optional, tag = "3")]
3234    pub credential: ::core::option::Option<WorkloadCredential>,
3235}
3236#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3237pub struct WorkloadVerificationKey {
3238    #[prost(string, tag = "1")]
3239    pub key_id: ::prost::alloc::string::String,
3240    #[prost(enumeration = "WorkloadSigningAlgorithm", tag = "2")]
3241    pub algorithm: i32,
3242    /// Ed25519 使用 32-byte raw public key。
3243    #[prost(bytes = "vec", tag = "3")]
3244    pub public_key: ::prost::alloc::vec::Vec<u8>,
3245    #[prost(enumeration = "VerificationKeyState", tag = "4")]
3246    pub state: i32,
3247    #[prost(message, optional, tag = "5")]
3248    pub not_before: ::core::option::Option<::prost_types::Timestamp>,
3249    #[prost(message, optional, tag = "6")]
3250    pub not_after: ::core::option::Option<::prost_types::Timestamp>,
3251}
3252/// SubjectRevocation 使某主体在指定时间之前签发的全部凭证失效。
3253#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3254pub struct SubjectRevocation {
3255    #[prost(string, tag = "1")]
3256    pub subject: ::prost::alloc::string::String,
3257    #[prost(message, optional, tag = "2")]
3258    pub credentials_issued_before: ::core::option::Option<::prost_types::Timestamp>,
3259    #[prost(string, tag = "3")]
3260    pub reason: ::prost::alloc::string::String,
3261}
3262#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3263pub struct CredentialRevocation {
3264    #[prost(string, tag = "1")]
3265    pub credential_id: ::prost::alloc::string::String,
3266    #[prost(message, optional, tag = "2")]
3267    pub revoked_at: ::core::option::Option<::prost_types::Timestamp>,
3268    #[prost(string, tag = "3")]
3269    pub reason: ::prost::alloc::string::String,
3270}
3271/// WorkloadTrustBundle 只包含公共验证材料,可以独立缓存。
3272/// sequence 在每个 trust_domain 内单调递增,SDK 必须拒绝回滚;bundle 过期后
3273/// 不得继续无限信任其中的 key。
3274#[derive(Clone, PartialEq, ::prost::Message)]
3275pub struct WorkloadTrustBundle {
3276    #[prost(uint32, tag = "1")]
3277    pub schema_version: u32,
3278    #[prost(string, tag = "2")]
3279    pub trust_domain: ::prost::alloc::string::String,
3280    /// 不透明且不可变的 bundle revision/hash。
3281    #[prost(string, tag = "3")]
3282    pub version: ::prost::alloc::string::String,
3283    #[prost(uint64, tag = "4")]
3284    pub sequence: u64,
3285    #[prost(message, optional, tag = "5")]
3286    pub issued_at: ::core::option::Option<::prost_types::Timestamp>,
3287    #[prost(message, optional, tag = "6")]
3288    pub expires_at: ::core::option::Option<::prost_types::Timestamp>,
3289    /// JWT iss claim 必须与该值精确一致,不能仅根据 trust_domain 自行拼接。
3290    #[prost(string, tag = "7")]
3291    pub issuer: ::prost::alloc::string::String,
3292    #[prost(message, repeated, tag = "10")]
3293    pub keys: ::prost::alloc::vec::Vec<WorkloadVerificationKey>,
3294    #[prost(message, repeated, tag = "11")]
3295    pub subject_revocations: ::prost::alloc::vec::Vec<SubjectRevocation>,
3296    #[prost(message, repeated, tag = "12")]
3297    pub credential_revocations: ::prost::alloc::vec::Vec<CredentialRevocation>,
3298}
3299/// trust_domain 不由请求体指定,control-plane 必须从已认证 principal 推导。
3300#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3301pub struct TrustBundleQuery {
3302    #[prost(string, tag = "1")]
3303    pub known_version: ::prost::alloc::string::String,
3304    #[prost(uint64, tag = "2")]
3305    pub known_sequence: u64,
3306}
3307/// WorkloadCredentialFormat 表示数据面凭证的编码与签名格式。
3308/// 未知格式必须 fail-closed,不能降级为未签名身份或自定义 Header。
3309#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3310#[repr(i32)]
3311pub enum WorkloadCredentialFormat {
3312    Unspecified = 0,
3313    /// Ed25519 签名的 compact JWT bearer credential。
3314    /// protected header 必须包含 alg=EdDSA、typ=pole-workload+jwt 和 kid。
3315    JwtEd25519 = 1,
3316}
3317impl WorkloadCredentialFormat {
3318    /// String value of the enum field names used in the ProtoBuf definition.
3319    ///
3320    /// The values are not transformed in any way and thus are considered stable
3321    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3322    pub fn as_str_name(&self) -> &'static str {
3323        match self {
3324            Self::Unspecified => "WORKLOAD_CREDENTIAL_FORMAT_UNSPECIFIED",
3325            Self::JwtEd25519 => "WORKLOAD_CREDENTIAL_FORMAT_JWT_ED25519",
3326        }
3327    }
3328    /// Creates an enum from field names used in the ProtoBuf definition.
3329    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3330        match value {
3331            "WORKLOAD_CREDENTIAL_FORMAT_UNSPECIFIED" => Some(Self::Unspecified),
3332            "WORKLOAD_CREDENTIAL_FORMAT_JWT_ED25519" => Some(Self::JwtEd25519),
3333            _ => None,
3334        }
3335    }
3336}
3337/// WorkloadBindingType 表示签发时实际验证到的 bootstrap 保证强度。
3338/// binding type 是已验证结果,不能由调用方声明。
3339#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3340#[repr(i32)]
3341pub enum WorkloadBindingType {
3342    WorkloadBindingUnspecified = 0,
3343    /// 仅证明 SDK 有权代表该服务,不代表具体 Pod、节点或实例。
3344    WorkloadBindingServiceToken = 1,
3345    WorkloadBindingKubernetesSa = 2,
3346    WorkloadBindingMtlsClientCert = 3,
3347    WorkloadBindingCloudWorkloadIdentity = 4,
3348}
3349impl WorkloadBindingType {
3350    /// String value of the enum field names used in the ProtoBuf definition.
3351    ///
3352    /// The values are not transformed in any way and thus are considered stable
3353    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3354    pub fn as_str_name(&self) -> &'static str {
3355        match self {
3356            Self::WorkloadBindingUnspecified => "WORKLOAD_BINDING_UNSPECIFIED",
3357            Self::WorkloadBindingServiceToken => "WORKLOAD_BINDING_SERVICE_TOKEN",
3358            Self::WorkloadBindingKubernetesSa => "WORKLOAD_BINDING_KUBERNETES_SA",
3359            Self::WorkloadBindingMtlsClientCert => "WORKLOAD_BINDING_MTLS_CLIENT_CERT",
3360            Self::WorkloadBindingCloudWorkloadIdentity => {
3361                "WORKLOAD_BINDING_CLOUD_WORKLOAD_IDENTITY"
3362            }
3363        }
3364    }
3365    /// Creates an enum from field names used in the ProtoBuf definition.
3366    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3367        match value {
3368            "WORKLOAD_BINDING_UNSPECIFIED" => Some(Self::WorkloadBindingUnspecified),
3369            "WORKLOAD_BINDING_SERVICE_TOKEN" => Some(Self::WorkloadBindingServiceToken),
3370            "WORKLOAD_BINDING_KUBERNETES_SA" => Some(Self::WorkloadBindingKubernetesSa),
3371            "WORKLOAD_BINDING_MTLS_CLIENT_CERT" => {
3372                Some(Self::WorkloadBindingMtlsClientCert)
3373            }
3374            "WORKLOAD_BINDING_CLOUD_WORKLOAD_IDENTITY" => {
3375                Some(Self::WorkloadBindingCloudWorkloadIdentity)
3376            }
3377            _ => None,
3378        }
3379    }
3380}
3381#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3382#[repr(i32)]
3383pub enum WorkloadSigningAlgorithm {
3384    Unspecified = 0,
3385    Ed25519 = 1,
3386}
3387impl WorkloadSigningAlgorithm {
3388    /// String value of the enum field names used in the ProtoBuf definition.
3389    ///
3390    /// The values are not transformed in any way and thus are considered stable
3391    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3392    pub fn as_str_name(&self) -> &'static str {
3393        match self {
3394            Self::Unspecified => "WORKLOAD_SIGNING_ALGORITHM_UNSPECIFIED",
3395            Self::Ed25519 => "WORKLOAD_SIGNING_ALGORITHM_ED25519",
3396        }
3397    }
3398    /// Creates an enum from field names used in the ProtoBuf definition.
3399    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3400        match value {
3401            "WORKLOAD_SIGNING_ALGORITHM_UNSPECIFIED" => Some(Self::Unspecified),
3402            "WORKLOAD_SIGNING_ALGORITHM_ED25519" => Some(Self::Ed25519),
3403            _ => None,
3404        }
3405    }
3406}
3407#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3408#[repr(i32)]
3409pub enum VerificationKeyState {
3410    Unspecified = 0,
3411    /// ACTIVE key 可用于签发和验证。
3412    Active = 1,
3413    /// RETIRING key 只用于验证,不得继续签发。
3414    Retiring = 2,
3415    /// REVOKED key 立即停止信任,即使 credential 尚未过期。
3416    Revoked = 3,
3417}
3418impl VerificationKeyState {
3419    /// String value of the enum field names used in the ProtoBuf definition.
3420    ///
3421    /// The values are not transformed in any way and thus are considered stable
3422    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3423    pub fn as_str_name(&self) -> &'static str {
3424        match self {
3425            Self::Unspecified => "VERIFICATION_KEY_STATE_UNSPECIFIED",
3426            Self::Active => "VERIFICATION_KEY_STATE_ACTIVE",
3427            Self::Retiring => "VERIFICATION_KEY_STATE_RETIRING",
3428            Self::Revoked => "VERIFICATION_KEY_STATE_REVOKED",
3429        }
3430    }
3431    /// Creates an enum from field names used in the ProtoBuf definition.
3432    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3433        match value {
3434            "VERIFICATION_KEY_STATE_UNSPECIFIED" => Some(Self::Unspecified),
3435            "VERIFICATION_KEY_STATE_ACTIVE" => Some(Self::Active),
3436            "VERIFICATION_KEY_STATE_RETIRING" => Some(Self::Retiring),
3437            "VERIFICATION_KEY_STATE_REVOKED" => Some(Self::Revoked),
3438            _ => None,
3439        }
3440    }
3441}
3442/// Generated client implementations.
3443pub mod workload_credential_service_client {
3444    #![allow(
3445        unused_variables,
3446        dead_code,
3447        missing_docs,
3448        clippy::wildcard_imports,
3449        clippy::let_unit_value,
3450    )]
3451    use tonic::codegen::*;
3452    use tonic::codegen::http::Uri;
3453    #[derive(Debug, Clone)]
3454    pub struct WorkloadCredentialServiceClient<T> {
3455        inner: tonic::client::Grpc<T>,
3456    }
3457    impl WorkloadCredentialServiceClient<tonic::transport::Channel> {
3458        /// Attempt to create a new client by connecting to a given endpoint.
3459        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3460        where
3461            D: TryInto<tonic::transport::Endpoint>,
3462            D::Error: Into<StdError>,
3463        {
3464            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3465            Ok(Self::new(conn))
3466        }
3467    }
3468    impl<T> WorkloadCredentialServiceClient<T>
3469    where
3470        T: tonic::client::GrpcService<tonic::body::Body>,
3471        T::Error: Into<StdError>,
3472        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3473        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3474    {
3475        pub fn new(inner: T) -> Self {
3476            let inner = tonic::client::Grpc::new(inner);
3477            Self { inner }
3478        }
3479        pub fn with_origin(inner: T, origin: Uri) -> Self {
3480            let inner = tonic::client::Grpc::with_origin(inner, origin);
3481            Self { inner }
3482        }
3483        pub fn with_interceptor<F>(
3484            inner: T,
3485            interceptor: F,
3486        ) -> WorkloadCredentialServiceClient<InterceptedService<T, F>>
3487        where
3488            F: tonic::service::Interceptor,
3489            T::ResponseBody: Default,
3490            T: tonic::codegen::Service<
3491                http::Request<tonic::body::Body>,
3492                Response = http::Response<
3493                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3494                >,
3495            >,
3496            <T as tonic::codegen::Service<
3497                http::Request<tonic::body::Body>,
3498            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3499        {
3500            WorkloadCredentialServiceClient::new(
3501                InterceptedService::new(inner, interceptor),
3502            )
3503        }
3504        /// Compress requests with the given encoding.
3505        ///
3506        /// This requires the server to support it otherwise it might respond with an
3507        /// error.
3508        #[must_use]
3509        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3510            self.inner = self.inner.send_compressed(encoding);
3511            self
3512        }
3513        /// Enable decompressing responses.
3514        #[must_use]
3515        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3516            self.inner = self.inner.accept_compressed(encoding);
3517            self
3518        }
3519        /// Limits the maximum size of a decoded message.
3520        ///
3521        /// Default: `4MB`
3522        #[must_use]
3523        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3524            self.inner = self.inner.max_decoding_message_size(limit);
3525            self
3526        }
3527        /// Limits the maximum size of an encoded message.
3528        ///
3529        /// Default: `usize::MAX`
3530        #[must_use]
3531        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3532            self.inner = self.inner.max_encoding_message_size(limit);
3533            self
3534        }
3535        pub async fn issue(
3536            &mut self,
3537            request: impl tonic::IntoRequest<super::WorkloadCredentialIssueRequest>,
3538        ) -> std::result::Result<
3539            tonic::Response<super::WorkloadCredentialResponse>,
3540            tonic::Status,
3541        > {
3542            self.inner
3543                .ready()
3544                .await
3545                .map_err(|e| {
3546                    tonic::Status::unknown(
3547                        format!("Service was not ready: {}", e.into()),
3548                    )
3549                })?;
3550            let codec = tonic_prost::ProstCodec::default();
3551            let path = http::uri::PathAndQuery::from_static(
3552                "/v1.WorkloadCredentialService/Issue",
3553            );
3554            let mut req = request.into_request();
3555            req.extensions_mut()
3556                .insert(GrpcMethod::new("v1.WorkloadCredentialService", "Issue"));
3557            self.inner.unary(req, path, codec).await
3558        }
3559        pub async fn renew(
3560            &mut self,
3561            request: impl tonic::IntoRequest<super::WorkloadCredentialRenewRequest>,
3562        ) -> std::result::Result<
3563            tonic::Response<super::WorkloadCredentialResponse>,
3564            tonic::Status,
3565        > {
3566            self.inner
3567                .ready()
3568                .await
3569                .map_err(|e| {
3570                    tonic::Status::unknown(
3571                        format!("Service was not ready: {}", e.into()),
3572                    )
3573                })?;
3574            let codec = tonic_prost::ProstCodec::default();
3575            let path = http::uri::PathAndQuery::from_static(
3576                "/v1.WorkloadCredentialService/Renew",
3577            );
3578            let mut req = request.into_request();
3579            req.extensions_mut()
3580                .insert(GrpcMethod::new("v1.WorkloadCredentialService", "Renew"));
3581            self.inner.unary(req, path, codec).await
3582        }
3583    }
3584}
3585/// Generated server implementations.
3586pub mod workload_credential_service_server {
3587    #![allow(
3588        unused_variables,
3589        dead_code,
3590        missing_docs,
3591        clippy::wildcard_imports,
3592        clippy::let_unit_value,
3593    )]
3594    use tonic::codegen::*;
3595    /// Generated trait containing gRPC methods that should be implemented for use with WorkloadCredentialServiceServer.
3596    #[async_trait]
3597    pub trait WorkloadCredentialService: std::marker::Send + std::marker::Sync + 'static {
3598        async fn issue(
3599            &self,
3600            request: tonic::Request<super::WorkloadCredentialIssueRequest>,
3601        ) -> std::result::Result<
3602            tonic::Response<super::WorkloadCredentialResponse>,
3603            tonic::Status,
3604        >;
3605        async fn renew(
3606            &self,
3607            request: tonic::Request<super::WorkloadCredentialRenewRequest>,
3608        ) -> std::result::Result<
3609            tonic::Response<super::WorkloadCredentialResponse>,
3610            tonic::Status,
3611        >;
3612    }
3613    #[derive(Debug)]
3614    pub struct WorkloadCredentialServiceServer<T> {
3615        inner: Arc<T>,
3616        accept_compression_encodings: EnabledCompressionEncodings,
3617        send_compression_encodings: EnabledCompressionEncodings,
3618        max_decoding_message_size: Option<usize>,
3619        max_encoding_message_size: Option<usize>,
3620    }
3621    impl<T> WorkloadCredentialServiceServer<T> {
3622        pub fn new(inner: T) -> Self {
3623            Self::from_arc(Arc::new(inner))
3624        }
3625        pub fn from_arc(inner: Arc<T>) -> Self {
3626            Self {
3627                inner,
3628                accept_compression_encodings: Default::default(),
3629                send_compression_encodings: Default::default(),
3630                max_decoding_message_size: None,
3631                max_encoding_message_size: None,
3632            }
3633        }
3634        pub fn with_interceptor<F>(
3635            inner: T,
3636            interceptor: F,
3637        ) -> InterceptedService<Self, F>
3638        where
3639            F: tonic::service::Interceptor,
3640        {
3641            InterceptedService::new(Self::new(inner), interceptor)
3642        }
3643        /// Enable decompressing requests with the given encoding.
3644        #[must_use]
3645        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3646            self.accept_compression_encodings.enable(encoding);
3647            self
3648        }
3649        /// Compress responses with the given encoding, if the client supports it.
3650        #[must_use]
3651        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3652            self.send_compression_encodings.enable(encoding);
3653            self
3654        }
3655        /// Limits the maximum size of a decoded message.
3656        ///
3657        /// Default: `4MB`
3658        #[must_use]
3659        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3660            self.max_decoding_message_size = Some(limit);
3661            self
3662        }
3663        /// Limits the maximum size of an encoded message.
3664        ///
3665        /// Default: `usize::MAX`
3666        #[must_use]
3667        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3668            self.max_encoding_message_size = Some(limit);
3669            self
3670        }
3671    }
3672    impl<T, B> tonic::codegen::Service<http::Request<B>>
3673    for WorkloadCredentialServiceServer<T>
3674    where
3675        T: WorkloadCredentialService,
3676        B: Body + std::marker::Send + 'static,
3677        B::Error: Into<StdError> + std::marker::Send + 'static,
3678    {
3679        type Response = http::Response<tonic::body::Body>;
3680        type Error = std::convert::Infallible;
3681        type Future = BoxFuture<Self::Response, Self::Error>;
3682        fn poll_ready(
3683            &mut self,
3684            _cx: &mut Context<'_>,
3685        ) -> Poll<std::result::Result<(), Self::Error>> {
3686            Poll::Ready(Ok(()))
3687        }
3688        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3689            match req.uri().path() {
3690                "/v1.WorkloadCredentialService/Issue" => {
3691                    #[allow(non_camel_case_types)]
3692                    struct IssueSvc<T: WorkloadCredentialService>(pub Arc<T>);
3693                    impl<
3694                        T: WorkloadCredentialService,
3695                    > tonic::server::UnaryService<super::WorkloadCredentialIssueRequest>
3696                    for IssueSvc<T> {
3697                        type Response = super::WorkloadCredentialResponse;
3698                        type Future = BoxFuture<
3699                            tonic::Response<Self::Response>,
3700                            tonic::Status,
3701                        >;
3702                        fn call(
3703                            &mut self,
3704                            request: tonic::Request<
3705                                super::WorkloadCredentialIssueRequest,
3706                            >,
3707                        ) -> Self::Future {
3708                            let inner = Arc::clone(&self.0);
3709                            let fut = async move {
3710                                <T as WorkloadCredentialService>::issue(&inner, request)
3711                                    .await
3712                            };
3713                            Box::pin(fut)
3714                        }
3715                    }
3716                    let accept_compression_encodings = self.accept_compression_encodings;
3717                    let send_compression_encodings = self.send_compression_encodings;
3718                    let max_decoding_message_size = self.max_decoding_message_size;
3719                    let max_encoding_message_size = self.max_encoding_message_size;
3720                    let inner = self.inner.clone();
3721                    let fut = async move {
3722                        let method = IssueSvc(inner);
3723                        let codec = tonic_prost::ProstCodec::default();
3724                        let mut grpc = tonic::server::Grpc::new(codec)
3725                            .apply_compression_config(
3726                                accept_compression_encodings,
3727                                send_compression_encodings,
3728                            )
3729                            .apply_max_message_size_config(
3730                                max_decoding_message_size,
3731                                max_encoding_message_size,
3732                            );
3733                        let res = grpc.unary(method, req).await;
3734                        Ok(res)
3735                    };
3736                    Box::pin(fut)
3737                }
3738                "/v1.WorkloadCredentialService/Renew" => {
3739                    #[allow(non_camel_case_types)]
3740                    struct RenewSvc<T: WorkloadCredentialService>(pub Arc<T>);
3741                    impl<
3742                        T: WorkloadCredentialService,
3743                    > tonic::server::UnaryService<super::WorkloadCredentialRenewRequest>
3744                    for RenewSvc<T> {
3745                        type Response = super::WorkloadCredentialResponse;
3746                        type Future = BoxFuture<
3747                            tonic::Response<Self::Response>,
3748                            tonic::Status,
3749                        >;
3750                        fn call(
3751                            &mut self,
3752                            request: tonic::Request<
3753                                super::WorkloadCredentialRenewRequest,
3754                            >,
3755                        ) -> Self::Future {
3756                            let inner = Arc::clone(&self.0);
3757                            let fut = async move {
3758                                <T as WorkloadCredentialService>::renew(&inner, request)
3759                                    .await
3760                            };
3761                            Box::pin(fut)
3762                        }
3763                    }
3764                    let accept_compression_encodings = self.accept_compression_encodings;
3765                    let send_compression_encodings = self.send_compression_encodings;
3766                    let max_decoding_message_size = self.max_decoding_message_size;
3767                    let max_encoding_message_size = self.max_encoding_message_size;
3768                    let inner = self.inner.clone();
3769                    let fut = async move {
3770                        let method = RenewSvc(inner);
3771                        let codec = tonic_prost::ProstCodec::default();
3772                        let mut grpc = tonic::server::Grpc::new(codec)
3773                            .apply_compression_config(
3774                                accept_compression_encodings,
3775                                send_compression_encodings,
3776                            )
3777                            .apply_max_message_size_config(
3778                                max_decoding_message_size,
3779                                max_encoding_message_size,
3780                            );
3781                        let res = grpc.unary(method, req).await;
3782                        Ok(res)
3783                    };
3784                    Box::pin(fut)
3785                }
3786                _ => {
3787                    Box::pin(async move {
3788                        let mut response = http::Response::new(
3789                            tonic::body::Body::default(),
3790                        );
3791                        let headers = response.headers_mut();
3792                        headers
3793                            .insert(
3794                                tonic::Status::GRPC_STATUS,
3795                                (tonic::Code::Unimplemented as i32).into(),
3796                            );
3797                        headers
3798                            .insert(
3799                                http::header::CONTENT_TYPE,
3800                                tonic::metadata::GRPC_CONTENT_TYPE,
3801                            );
3802                        Ok(response)
3803                    })
3804                }
3805            }
3806        }
3807    }
3808    impl<T> Clone for WorkloadCredentialServiceServer<T> {
3809        fn clone(&self) -> Self {
3810            let inner = self.inner.clone();
3811            Self {
3812                inner,
3813                accept_compression_encodings: self.accept_compression_encodings,
3814                send_compression_encodings: self.send_compression_encodings,
3815                max_decoding_message_size: self.max_decoding_message_size,
3816                max_encoding_message_size: self.max_encoding_message_size,
3817            }
3818        }
3819    }
3820    /// Generated gRPC service name
3821    pub const SERVICE_NAME: &str = "v1.WorkloadCredentialService";
3822    impl<T> tonic::server::NamedService for WorkloadCredentialServiceServer<T> {
3823        const NAME: &'static str = SERVICE_NAME;
3824    }
3825}
3826/// 优雅上下线规则的模型
3827#[derive(Clone, PartialEq, ::prost::Message)]
3828pub struct LosslessRule {
3829    /// rule id
3830    #[prost(string, tag = "1")]
3831    pub id: ::prost::alloc::string::String,
3832    /// revision routing version
3833    #[prost(string, tag = "2")]
3834    pub revision: ::prost::alloc::string::String,
3835    /// ctime create time of the rules
3836    #[prost(string, tag = "3")]
3837    pub ctime: ::prost::alloc::string::String,
3838    /// mtime modify time of the rules
3839    #[prost(string, tag = "4")]
3840    pub mtime: ::prost::alloc::string::String,
3841    /// configuration for lossless online
3842    #[prost(message, optional, tag = "5")]
3843    pub lossless_online: ::core::option::Option<LosslessOnline>,
3844    /// configuration for lossless offline
3845    #[prost(message, optional, tag = "6")]
3846    pub lossless_offline: ::core::option::Option<LosslessOffline>,
3847    /// 规则标签
3848    #[prost(map = "string, string", tag = "7")]
3849    pub metadata: ::std::collections::HashMap<
3850        ::prost::alloc::string::String,
3851        ::prost::alloc::string::String,
3852    >,
3853    /// 操作标志位
3854    #[prost(bool, tag = "8")]
3855    pub editable: bool,
3856    #[prost(bool, tag = "9")]
3857    pub deleteable: bool,
3858    /// namespace identifies the environment that owns this rule.
3859    #[prost(string, tag = "10")]
3860    pub namespace: ::prost::alloc::string::String,
3861}
3862#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3863pub struct LosslessOnline {
3864    /// configuration for delayRegister
3865    #[prost(message, optional, tag = "1")]
3866    pub delay_register: ::core::option::Option<DelayRegister>,
3867    /// configuration for warmup
3868    #[prost(message, optional, tag = "2")]
3869    pub warmup: ::core::option::Option<Warmup>,
3870    /// configuration for readiness probe
3871    #[prost(message, optional, tag = "3")]
3872    pub readiness: ::core::option::Option<Readiness>,
3873}
3874#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3875pub struct DelayRegister {
3876    /// enable delay registry
3877    #[prost(bool, tag = "1")]
3878    pub enable: bool,
3879    /// delay register strategy
3880    #[prost(enumeration = "delay_register::DelayStrategy", tag = "2")]
3881    pub strategy: i32,
3882    /// delay register time by second, active when strategy == DELAY_BY_TIME
3883    #[prost(int32, tag = "3")]
3884    pub interval_second: i32,
3885    /// protocol to do health check, default http, active when strategy == DELAY_BY_HEALTH_CHECK
3886    #[prost(string, tag = "4")]
3887    pub health_check_protocol: ::prost::alloc::string::String,
3888    /// method to do health check, default GET, active when strategy == DELAY_BY_HEALTH_CHECK
3889    #[prost(string, tag = "5")]
3890    pub health_check_method: ::prost::alloc::string::String,
3891    /// path to do health check, no default value, active when strategy == DELAY_BY_HEALTH_CHECK
3892    #[prost(string, tag = "6")]
3893    pub health_check_path: ::prost::alloc::string::String,
3894    /// health check interval second, default is 30, active when strategy == DELAY_BY_HEALTH_CHECK
3895    #[prost(string, tag = "7")]
3896    pub health_check_interval_second: ::prost::alloc::string::String,
3897}
3898/// Nested message and enum types in `DelayRegister`.
3899pub mod delay_register {
3900    #[derive(
3901        Clone,
3902        Copy,
3903        Debug,
3904        PartialEq,
3905        Eq,
3906        Hash,
3907        PartialOrd,
3908        Ord,
3909        ::prost::Enumeration
3910    )]
3911    #[repr(i32)]
3912    pub enum DelayStrategy {
3913        /// register instance after delay specific time
3914        DelayByTime = 0,
3915        /// register instance until health check successfully
3916        DelayByHealthCheck = 1,
3917    }
3918    impl DelayStrategy {
3919        /// String value of the enum field names used in the ProtoBuf definition.
3920        ///
3921        /// The values are not transformed in any way and thus are considered stable
3922        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3923        pub fn as_str_name(&self) -> &'static str {
3924            match self {
3925                Self::DelayByTime => "DELAY_BY_TIME",
3926                Self::DelayByHealthCheck => "DELAY_BY_HEALTH_CHECK",
3927            }
3928        }
3929        /// Creates an enum from field names used in the ProtoBuf definition.
3930        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3931            match value {
3932                "DELAY_BY_TIME" => Some(Self::DelayByTime),
3933                "DELAY_BY_HEALTH_CHECK" => Some(Self::DelayByHealthCheck),
3934                _ => None,
3935            }
3936        }
3937    }
3938}
3939#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3940pub struct Warmup {
3941    /// enable warmup
3942    #[prost(bool, tag = "1")]
3943    pub enable: bool,
3944    /// total warmup interval by second
3945    #[prost(int32, tag = "2")]
3946    pub interval_second: i32,
3947    /// warmup stop when most of the instances in service are in warmup status
3948    #[prost(bool, tag = "3")]
3949    pub enable_overload_protection: bool,
3950    /// the threshold to active overload protection, default is 50, threshld = sum(WarmupInstances)/sum(AllInstances)\*100
3951    #[prost(int32, tag = "4")]
3952    pub overload_protection_threshold: i32,
3953    /// curvature for warmup register, default is 1
3954    #[prost(int32, tag = "5")]
3955    pub curvature: i32,
3956}
3957#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3958pub struct Readiness {
3959    /// enable /readiness expose
3960    #[prost(bool, tag = "1")]
3961    pub enable: bool,
3962}
3963#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3964pub struct LosslessOffline {
3965    /// enable /offline expose
3966    #[prost(bool, tag = "1")]
3967    pub enable: bool,
3968}
3969/// 流量入口
3970#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3971pub struct TrafficEntry {
3972    /// 标记流量入口类型
3973    /// type == "pole.io/gateway/spring-cloud-gateway", 则 selector 为
3974    /// ServiceGatewaySelector type == "pole.io/service, 则 selector 为
3975    /// ServiceSelector
3976    #[prost(string, tag = "1")]
3977    pub r#type: ::prost::alloc::string::String,
3978    #[prost(message, optional, tag = "2")]
3979    pub selector: ::core::option::Option<::prost_types::Any>,
3980}
3981/// 微服务网关入口定义
3982#[derive(Clone, PartialEq, ::prost::Message)]
3983pub struct ServiceGatewaySelector {
3984    #[prost(string, tag = "1")]
3985    pub namespace: ::prost::alloc::string::String,
3986    #[prost(string, tag = "2")]
3987    pub service: ::prost::alloc::string::String,
3988    /// 决定要不要部份
3989    #[prost(map = "string, message", tag = "3")]
3990    pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
3991}
3992/// 普通服务入口定义
3993#[derive(Clone, PartialEq, ::prost::Message)]
3994pub struct ServiceSelector {
3995    #[prost(string, tag = "1")]
3996    pub namespace: ::prost::alloc::string::String,
3997    #[prost(string, tag = "2")]
3998    pub service: ::prost::alloc::string::String,
3999    /// 决定要不要部份
4000    #[prost(map = "string, message", tag = "3")]
4001    pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
4002}
4003/// 泳道组实体定义
4004#[derive(Clone, PartialEq, ::prost::Message)]
4005pub struct LaneGroup {
4006    /// 泳道组 ID
4007    #[prost(string, tag = "1")]
4008    pub id: ::prost::alloc::string::String,
4009    /// 泳道组名称
4010    #[prost(string, tag = "2")]
4011    pub name: ::prost::alloc::string::String,
4012    /// 泳道组内的流量入口信息
4013    #[prost(message, repeated, tag = "3")]
4014    pub entries: ::prost::alloc::vec::Vec<TrafficEntry>,
4015    /// 在泳道组内的服务列表信息
4016    #[prost(message, repeated, tag = "4")]
4017    pub destinations: ::prost::alloc::vec::Vec<DestinationGroup>,
4018    /// 泳道组描述信息
4019    #[prost(string, tag = "5")]
4020    pub revision: ::prost::alloc::string::String,
4021    /// 泳道组描述信息
4022    #[prost(string, tag = "6")]
4023    pub description: ::prost::alloc::string::String,
4024    /// 泳道组的创建时间
4025    #[prost(string, tag = "7")]
4026    pub ctime: ::prost::alloc::string::String,
4027    /// 泳道组的更新时间
4028    #[prost(string, tag = "8")]
4029    pub mtime: ::prost::alloc::string::String,
4030    /// 泳道组内的流量入口信息
4031    #[prost(message, repeated, tag = "9")]
4032    pub rules: ::prost::alloc::vec::Vec<LaneRule>,
4033    /// 泳道组标签
4034    #[prost(map = "string, string", tag = "10")]
4035    pub metadata: ::std::collections::HashMap<
4036        ::prost::alloc::string::String,
4037        ::prost::alloc::string::String,
4038    >,
4039    /// 操作标志位
4040    #[prost(bool, tag = "11")]
4041    pub editable: bool,
4042    #[prost(bool, tag = "12")]
4043    pub deleteable: bool,
4044    /// namespace identifies the environment that owns this lane group.
4045    #[prost(string, tag = "13")]
4046    pub namespace: ::prost::alloc::string::String,
4047}
4048/// 泳道规则
4049#[derive(Clone, PartialEq, ::prost::Message)]
4050pub struct LaneRule {
4051    #[prost(string, tag = "1")]
4052    pub id: ::prost::alloc::string::String,
4053    #[prost(string, tag = "2")]
4054    pub name: ::prost::alloc::string::String,
4055    /// 所属泳道组的名称
4056    #[prost(string, tag = "3")]
4057    pub group_name: ::prost::alloc::string::String,
4058    /// 流量匹配规则
4059    #[prost(message, optional, tag = "4")]
4060    pub traffic_match_rule: ::core::option::Option<TrafficMatchRule>,
4061    /// 保存这个泳道的默认实例标签
4062    #[prost(string, tag = "5")]
4063    pub default_label_value: ::prost::alloc::string::String,
4064    /// 泳道规则是否启用
4065    #[prost(bool, tag = "6")]
4066    pub enable: bool,
4067    #[prost(enumeration = "lane_rule::LaneMatchMode", tag = "7")]
4068    pub match_mode: i32,
4069    /// revision routing version
4070    #[prost(string, tag = "8")]
4071    pub revision: ::prost::alloc::string::String,
4072    /// ctime create time of the rules
4073    #[prost(string, tag = "9")]
4074    pub ctime: ::prost::alloc::string::String,
4075    /// mtime modify time of the rules
4076    #[prost(string, tag = "10")]
4077    pub mtime: ::prost::alloc::string::String,
4078    /// etime enable time of the rules
4079    #[prost(string, tag = "11")]
4080    pub etime: ::prost::alloc::string::String,
4081    /// priority rules priority
4082    #[prost(uint32, tag = "12")]
4083    pub priority: u32,
4084    /// description simple description rules
4085    #[prost(string, tag = "13")]
4086    pub description: ::prost::alloc::string::String,
4087    /// 属于该泳道的实例标签KEY,不填默认为lane
4088    #[prost(string, tag = "14")]
4089    pub label_key: ::prost::alloc::string::String,
4090}
4091/// Nested message and enum types in `LaneRule`.
4092pub mod lane_rule {
4093    #[derive(
4094        Clone,
4095        Copy,
4096        Debug,
4097        PartialEq,
4098        Eq,
4099        Hash,
4100        PartialOrd,
4101        Ord,
4102        ::prost::Enumeration
4103    )]
4104    #[repr(i32)]
4105    pub enum LaneMatchMode {
4106        /// 严格匹配模式
4107        Strict = 0,
4108        /// 宽松匹配模式
4109        Permissive = 1,
4110    }
4111    impl LaneMatchMode {
4112        /// String value of the enum field names used in the ProtoBuf definition.
4113        ///
4114        /// The values are not transformed in any way and thus are considered stable
4115        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4116        pub fn as_str_name(&self) -> &'static str {
4117            match self {
4118                Self::Strict => "STRICT",
4119                Self::Permissive => "PERMISSIVE",
4120            }
4121        }
4122        /// Creates an enum from field names used in the ProtoBuf definition.
4123        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4124            match value {
4125                "STRICT" => Some(Self::Strict),
4126                "PERMISSIVE" => Some(Self::Permissive),
4127                _ => None,
4128            }
4129        }
4130    }
4131}
4132#[derive(Clone, PartialEq, ::prost::Message)]
4133pub struct Namespace {
4134    #[prost(string, tag = "1")]
4135    pub id: ::prost::alloc::string::String,
4136    #[prost(string, tag = "2")]
4137    pub name: ::prost::alloc::string::String,
4138    #[prost(string, tag = "3")]
4139    pub comment: ::prost::alloc::string::String,
4140    #[prost(string, tag = "4")]
4141    pub owners: ::prost::alloc::string::String,
4142    #[prost(string, tag = "5")]
4143    pub token: ::prost::alloc::string::String,
4144    #[prost(string, tag = "6")]
4145    pub ctime: ::prost::alloc::string::String,
4146    #[prost(string, tag = "7")]
4147    pub mtime: ::prost::alloc::string::String,
4148    #[prost(string, repeated, tag = "8")]
4149    pub service_export_to: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
4150    #[prost(map = "string, string", tag = "9")]
4151    pub metadata: ::std::collections::HashMap<
4152        ::prost::alloc::string::String,
4153        ::prost::alloc::string::String,
4154    >,
4155    #[prost(enumeration = "NamespaceKind", tag = "10")]
4156    pub kind: i32,
4157    #[prost(uint32, tag = "20")]
4158    pub total_service_count: u32,
4159    #[prost(uint32, tag = "21")]
4160    pub total_health_instance_count: u32,
4161    #[prost(uint32, tag = "22")]
4162    pub total_instance_count: u32,
4163    #[prost(uint32, tag = "23")]
4164    pub total_config_file_count: u32,
4165    #[prost(bool, tag = "30")]
4166    pub editable: bool,
4167    #[prost(bool, tag = "31")]
4168    pub deleteable: bool,
4169}
4170#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
4171#[repr(i32)]
4172pub enum NamespaceKind {
4173    Business = 0,
4174    System = 1,
4175}
4176impl NamespaceKind {
4177    /// String value of the enum field names used in the ProtoBuf definition.
4178    ///
4179    /// The values are not transformed in any way and thus are considered stable
4180    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4181    pub fn as_str_name(&self) -> &'static str {
4182        match self {
4183            Self::Business => "NAMESPACE_KIND_BUSINESS",
4184            Self::System => "NAMESPACE_KIND_SYSTEM",
4185        }
4186    }
4187    /// Creates an enum from field names used in the ProtoBuf definition.
4188    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4189        match value {
4190            "NAMESPACE_KIND_BUSINESS" => Some(Self::Business),
4191            "NAMESPACE_KIND_SYSTEM" => Some(Self::System),
4192            _ => None,
4193        }
4194    }
4195}
4196/// 流量镜像规则
4197#[derive(Clone, PartialEq, ::prost::Message)]
4198pub struct TrafficMirror {
4199    #[prost(string, tag = "1")]
4200    pub id: ::prost::alloc::string::String,
4201    /// 流量镜像规则名称
4202    #[prost(string, tag = "2")]
4203    pub name: ::prost::alloc::string::String,
4204    /// 流量镜像规则描述
4205    #[prost(string, tag = "3")]
4206    pub description: ::prost::alloc::string::String,
4207    /// 主调服务范围,namespace/service 均为 "\*" 表示全部服务。
4208    #[prost(message, optional, tag = "4")]
4209    pub caller: ::core::option::Option<SourceService>,
4210    /// 被调服务,规则归属和下发绑定到该服务。
4211    #[prost(message, optional, tag = "5")]
4212    pub callee: ::core::option::Option<DestinationService>,
4213    /// 流量镜像规则集合
4214    #[prost(message, repeated, tag = "6")]
4215    pub rules: ::prost::alloc::vec::Vec<MirrorRule>,
4216    /// 是否启用
4217    #[prost(bool, tag = "7")]
4218    pub enable: bool,
4219    /// 流量镜像规则revision信息
4220    #[prost(string, tag = "8")]
4221    pub revision: ::prost::alloc::string::String,
4222    /// 规则优先级
4223    #[prost(uint32, tag = "9")]
4224    pub priority: u32,
4225    /// 创建时间
4226    #[prost(string, tag = "10")]
4227    pub ctime: ::prost::alloc::string::String,
4228    /// 修改时间
4229    #[prost(string, tag = "11")]
4230    pub mtime: ::prost::alloc::string::String,
4231    /// 规则标签
4232    #[prost(map = "string, string", tag = "12")]
4233    pub metadata: ::std::collections::HashMap<
4234        ::prost::alloc::string::String,
4235        ::prost::alloc::string::String,
4236    >,
4237    /// 操作标志位
4238    #[prost(bool, tag = "13")]
4239    pub editable: bool,
4240    #[prost(bool, tag = "14")]
4241    pub deleteable: bool,
4242    /// namespace identifies the environment that owns this rule.
4243    #[prost(string, tag = "15")]
4244    pub namespace: ::prost::alloc::string::String,
4245}
4246#[derive(Clone, PartialEq, ::prost::Message)]
4247pub struct MirrorRule {
4248    /// 镜像接口范围,命中任一 API 即执行镜像。
4249    #[prost(message, repeated, tag = "1")]
4250    pub apis: ::prost::alloc::vec::Vec<Api>,
4251    /// 主调、请求头、查询参数、路径、Cookie 等流量匹配条件。
4252    #[prost(message, optional, tag = "2")]
4253    pub traffic_match_rule: ::core::option::Option<TrafficMatchRule>,
4254    /// 目标服务
4255    #[prost(message, optional, tag = "3")]
4256    pub destination: ::core::option::Option<MirrorDestination>,
4257    /// 流量镜像百分比,0-100
4258    #[prost(uint32, tag = "4")]
4259    pub mirror_percent: u32,
4260    /// 流量镜像持续时间,默认无限制
4261    #[prost(message, optional, tag = "5")]
4262    pub duration: ::core::option::Option<::prost_types::Duration>,
4263    /// 子规则是否禁用,默认启用
4264    #[prost(bool, tag = "6")]
4265    pub disable: bool,
4266}
4267#[derive(Clone, PartialEq, ::prost::Message)]
4268pub struct MirrorDestination {
4269    /// 目标服务所在的命名空间
4270    #[prost(string, tag = "1")]
4271    pub namespace: ::prost::alloc::string::String,
4272    /// 目标服务名称
4273    #[prost(string, tag = "2")]
4274    pub service: ::prost::alloc::string::String,
4275    /// 目标服务实例标签选择器
4276    #[prost(map = "string, message", tag = "3")]
4277    pub labels: ::std::collections::HashMap<::prost::alloc::string::String, MatchString>,
4278}
4279/// 流量安全规则,用于描述服务调用运行时鉴权策略。
4280#[derive(Clone, PartialEq, ::prost::Message)]
4281pub struct TrafficSecurityRule {
4282    #[prost(string, tag = "1")]
4283    pub id: ::prost::alloc::string::String,
4284    /// 规则名称
4285    #[prost(string, tag = "2")]
4286    pub name: ::prost::alloc::string::String,
4287    /// 规则描述
4288    #[prost(string, tag = "3")]
4289    pub description: ::prost::alloc::string::String,
4290    /// 规则优先级
4291    #[prost(uint32, tag = "4")]
4292    pub priority: u32,
4293    /// 是否启用
4294    #[prost(bool, tag = "5")]
4295    pub enable: bool,
4296    /// 被调服务,规则只绑定到该服务
4297    #[prost(message, optional, tag = "6")]
4298    pub target_service: ::core::option::Option<DestinationService>,
4299    /// 命中策略列表
4300    #[prost(message, repeated, tag = "7")]
4301    pub policies: ::prost::alloc::vec::Vec<TrafficSecurityPolicy>,
4302    /// 创建时间
4303    #[prost(string, tag = "8")]
4304    pub ctime: ::prost::alloc::string::String,
4305    /// 修改时间
4306    #[prost(string, tag = "9")]
4307    pub mtime: ::prost::alloc::string::String,
4308    /// 规则标签
4309    #[prost(map = "string, string", tag = "10")]
4310    pub metadata: ::std::collections::HashMap<
4311        ::prost::alloc::string::String,
4312        ::prost::alloc::string::String,
4313    >,
4314    /// 规则 revision
4315    #[prost(string, tag = "11")]
4316    pub revision: ::prost::alloc::string::String,
4317    /// 规则的权限操作状态
4318    #[prost(bool, tag = "12")]
4319    pub editable: bool,
4320    #[prost(bool, tag = "13")]
4321    pub deleteable: bool,
4322    /// 规则级认证配置。历史规则缺少该字段时继续按旧请求匹配语义执行。
4323    #[prost(message, optional, tag = "14")]
4324    pub authentication: ::core::option::Option<TrafficSecurityAuthentication>,
4325    /// namespace identifies the environment that owns this rule.
4326    #[prost(string, tag = "15")]
4327    pub namespace: ::prost::alloc::string::String,
4328}
4329/// 规则级认证配置。新建规则必须显式设置 mode。
4330#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4331pub struct TrafficSecurityAuthentication {
4332    #[prost(enumeration = "TrafficSecurityAuthMode", tag = "1")]
4333    pub mode: i32,
4334    #[prost(message, optional, tag = "2")]
4335    pub managed_identity: ::core::option::Option<ManagedIdentityAuthentication>,
4336    #[prost(message, optional, tag = "3")]
4337    pub custom_header: ::core::option::Option<CustomHeaderAuthentication>,
4338}
4339/// Pole 托管身份认证不包含用户可编辑的身份 ID 或凭证。
4340#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
4341pub struct ManagedIdentityAuthentication {}
4342/// 自定义 Header 兼容认证。
4343/// value 是敏感写入字段,管理查询与规则发现不得返回明文。
4344#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4345pub struct CustomHeaderAuthentication {
4346    #[prost(string, tag = "1")]
4347    pub header_name: ::prost::alloc::string::String,
4348    /// 仅由管理面创建/更新请求写入;control-plane 持久化前必须清空。
4349    #[prost(string, tag = "2")]
4350    pub value: ::prost::alloc::string::String,
4351    /// control-plane 生成的数据面精确验证摘要;管理面不得接受调用方写入。
4352    #[prost(string, tag = "3")]
4353    pub value_sha256: ::prost::alloc::string::String,
4354}
4355/// 单条调用鉴权策略。
4356#[derive(Clone, PartialEq, ::prost::Message)]
4357pub struct TrafficSecurityPolicy {
4358    /// 被调 API 范围,命中任一 API 即进入该策略
4359    #[prost(message, repeated, tag = "1")]
4360    pub apis: ::prost::alloc::vec::Vec<Api>,
4361    /// 主调、请求头、查询参数、路径、Cookie 等流量匹配条件
4362    #[prost(message, optional, tag = "2")]
4363    pub traffic_match_rule: ::core::option::Option<TrafficMatchRule>,
4364    /// 命中该策略后的动作
4365    #[prost(enumeration = "TrafficSecurityAction", tag = "3")]
4366    pub action: i32,
4367    /// 拒绝调用时的响应效果,仅 action=DENY 时生效
4368    #[prost(message, optional, tag = "4")]
4369    pub reject_effect: ::core::option::Option<TrafficSecurityRejectEffect>,
4370    /// 托管身份模式下,从已认证主体中匹配可信来源服务。
4371    /// 不得从调用方自行填写的普通 Header 或 metadata 中取值。
4372    #[prost(message, optional, tag = "5")]
4373    pub managed_caller: ::core::option::Option<ManagedCallerSelector>,
4374}
4375#[derive(Clone, PartialEq, ::prost::Message)]
4376pub struct ManagedCallerSelector {
4377    /// 接受任意已通过托管身份认证的服务。
4378    #[prost(bool, tag = "1")]
4379    pub any_authenticated: bool,
4380    /// 明确允许或拒绝的来源服务集合,按 namespace/service 匹配已认证主体。
4381    #[prost(message, repeated, tag = "2")]
4382    pub callers: ::prost::alloc::vec::Vec<SourceService>,
4383}
4384#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4385pub struct TrafficSecurityRejectEffect {
4386    /// 业务错误码
4387    #[prost(string, tag = "1")]
4388    pub code: ::prost::alloc::string::String,
4389    /// 拒绝原因
4390    #[prost(string, tag = "2")]
4391    pub message: ::prost::alloc::string::String,
4392}
4393/// 调用鉴权认证模式。
4394/// 零值必须保留旧语义,避免历史规则在反序列化后静默切换到托管身份。
4395#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
4396#[repr(i32)]
4397pub enum TrafficSecurityAuthMode {
4398    LegacyRequestMatch = 0,
4399    ManagedIdentity = 1,
4400    CustomHeader = 2,
4401}
4402impl TrafficSecurityAuthMode {
4403    /// String value of the enum field names used in the ProtoBuf definition.
4404    ///
4405    /// The values are not transformed in any way and thus are considered stable
4406    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4407    pub fn as_str_name(&self) -> &'static str {
4408        match self {
4409            Self::LegacyRequestMatch => "LEGACY_REQUEST_MATCH",
4410            Self::ManagedIdentity => "MANAGED_IDENTITY",
4411            Self::CustomHeader => "CUSTOM_HEADER",
4412        }
4413    }
4414    /// Creates an enum from field names used in the ProtoBuf definition.
4415    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4416        match value {
4417            "LEGACY_REQUEST_MATCH" => Some(Self::LegacyRequestMatch),
4418            "MANAGED_IDENTITY" => Some(Self::ManagedIdentity),
4419            "CUSTOM_HEADER" => Some(Self::CustomHeader),
4420            _ => None,
4421        }
4422    }
4423}
4424#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
4425#[repr(i32)]
4426pub enum TrafficSecurityAction {
4427    TrafficSecurityAllow = 0,
4428    TrafficSecurityDeny = 1,
4429}
4430impl TrafficSecurityAction {
4431    /// String value of the enum field names used in the ProtoBuf definition.
4432    ///
4433    /// The values are not transformed in any way and thus are considered stable
4434    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4435    pub fn as_str_name(&self) -> &'static str {
4436        match self {
4437            Self::TrafficSecurityAllow => "TRAFFIC_SECURITY_ALLOW",
4438            Self::TrafficSecurityDeny => "TRAFFIC_SECURITY_DENY",
4439        }
4440    }
4441    /// Creates an enum from field names used in the ProtoBuf definition.
4442    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4443        match value {
4444            "TRAFFIC_SECURITY_ALLOW" => Some(Self::TrafficSecurityAllow),
4445            "TRAFFIC_SECURITY_DENY" => Some(Self::TrafficSecurityDeny),
4446            _ => None,
4447        }
4448    }
4449}
4450#[derive(Clone, PartialEq, ::prost::Message)]
4451pub struct DiscoverFilter {
4452    #[prost(bool, tag = "1")]
4453    pub only_healthy_instance: bool,
4454    /// pole.io 自定义信息
4455    #[prost(message, optional, tag = "100")]
4456    pub caller: ::core::option::Option<Caller>,
4457}
4458#[derive(Clone, PartialEq, ::prost::Message)]
4459pub struct DiscoverRequest {
4460    #[prost(enumeration = "discover_request::DiscoverRequestType", tag = "1")]
4461    pub r#type: i32,
4462    #[prost(message, optional, tag = "2")]
4463    pub service: ::core::option::Option<Service>,
4464    #[prost(message, optional, tag = "30")]
4465    pub filter: ::core::option::Option<DiscoverFilter>,
4466    /// 仅 SERVICE_IDENTITY_BUNDLE 使用;trust domain 由认证 principal 推导。
4467    #[prost(message, optional, tag = "31")]
4468    pub trust_bundle_query: ::core::option::Option<TrustBundleQuery>,
4469}
4470/// Nested message and enum types in `DiscoverRequest`.
4471pub mod discover_request {
4472    #[derive(
4473        Clone,
4474        Copy,
4475        Debug,
4476        PartialEq,
4477        Eq,
4478        Hash,
4479        PartialOrd,
4480        Ord,
4481        ::prost::Enumeration
4482    )]
4483    #[repr(i32)]
4484    pub enum DiscoverRequestType {
4485        Unknown = 0,
4486        /// 拉起命名空间列表
4487        Namespaces = 1,
4488        /// 服务列表
4489        Services = 2,
4490        /// 服务实例列表
4491        Instance = 3,
4492        /// 服务契约列表
4493        ServiceContracts = 4,
4494        /// 限流规则
4495        RateLimit = 20,
4496        /// 熔断规则
4497        CircuitBreaker = 21,
4498        /// 故障检测规则
4499        FaultDetector = 22,
4500        /// 自定义路由规则
4501        CustomRouteRule = 23,
4502        /// 就近路由规则
4503        NearbyRouteRule = 24,
4504        /// 泳道规则
4505        Lane = 25,
4506        /// 无损上下线规则
4507        Lossless = 26,
4508        /// 流量安全规则
4509        TrafficSecurityRule = 27,
4510        /// 流量镜像规则
4511        TrafficMirrorRule = 28,
4512        /// 流量 Mock 规则
4513        TrafficMockRule = 29,
4514        /// 当前已认证服务的数据面身份描述
4515        ServiceIdentity = 30,
4516        /// 当前已认证服务所属 trust domain 的公共验证材料
4517        ServiceIdentityBundle = 31,
4518        /// 服务订阅视图
4519        ServiceSubscribers = 50,
4520    }
4521    impl DiscoverRequestType {
4522        /// String value of the enum field names used in the ProtoBuf definition.
4523        ///
4524        /// The values are not transformed in any way and thus are considered stable
4525        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4526        pub fn as_str_name(&self) -> &'static str {
4527            match self {
4528                Self::Unknown => "UNKNOWN",
4529                Self::Namespaces => "NAMESPACES",
4530                Self::Services => "SERVICES",
4531                Self::Instance => "INSTANCE",
4532                Self::ServiceContracts => "SERVICE_CONTRACTS",
4533                Self::RateLimit => "RATE_LIMIT",
4534                Self::CircuitBreaker => "CIRCUIT_BREAKER",
4535                Self::FaultDetector => "FAULT_DETECTOR",
4536                Self::CustomRouteRule => "CUSTOM_ROUTE_RULE",
4537                Self::NearbyRouteRule => "NEARBY_ROUTE_RULE",
4538                Self::Lane => "LANE",
4539                Self::Lossless => "LOSSLESS",
4540                Self::TrafficSecurityRule => "TRAFFIC_SECURITY_RULE",
4541                Self::TrafficMirrorRule => "TRAFFIC_MIRROR_RULE",
4542                Self::TrafficMockRule => "TRAFFIC_MOCK_RULE",
4543                Self::ServiceIdentity => "SERVICE_IDENTITY",
4544                Self::ServiceIdentityBundle => "SERVICE_IDENTITY_BUNDLE",
4545                Self::ServiceSubscribers => "SERVICE_SUBSCRIBERS",
4546            }
4547        }
4548        /// Creates an enum from field names used in the ProtoBuf definition.
4549        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4550            match value {
4551                "UNKNOWN" => Some(Self::Unknown),
4552                "NAMESPACES" => Some(Self::Namespaces),
4553                "SERVICES" => Some(Self::Services),
4554                "INSTANCE" => Some(Self::Instance),
4555                "SERVICE_CONTRACTS" => Some(Self::ServiceContracts),
4556                "RATE_LIMIT" => Some(Self::RateLimit),
4557                "CIRCUIT_BREAKER" => Some(Self::CircuitBreaker),
4558                "FAULT_DETECTOR" => Some(Self::FaultDetector),
4559                "CUSTOM_ROUTE_RULE" => Some(Self::CustomRouteRule),
4560                "NEARBY_ROUTE_RULE" => Some(Self::NearbyRouteRule),
4561                "LANE" => Some(Self::Lane),
4562                "LOSSLESS" => Some(Self::Lossless),
4563                "TRAFFIC_SECURITY_RULE" => Some(Self::TrafficSecurityRule),
4564                "TRAFFIC_MIRROR_RULE" => Some(Self::TrafficMirrorRule),
4565                "TRAFFIC_MOCK_RULE" => Some(Self::TrafficMockRule),
4566                "SERVICE_IDENTITY" => Some(Self::ServiceIdentity),
4567                "SERVICE_IDENTITY_BUNDLE" => Some(Self::ServiceIdentityBundle),
4568                "SERVICE_SUBSCRIBERS" => Some(Self::ServiceSubscribers),
4569                _ => None,
4570            }
4571        }
4572    }
4573}
4574#[derive(Clone, PartialEq, ::prost::Message)]
4575pub struct DiscoverResponse {
4576    #[prost(uint32, tag = "1")]
4577    pub code: u32,
4578    #[prost(string, tag = "2")]
4579    pub info: ::prost::alloc::string::String,
4580    #[prost(enumeration = "discover_response::DiscoverResponseType", tag = "3")]
4581    pub r#type: i32,
4582    /// 服务
4583    #[prost(message, optional, tag = "4")]
4584    pub service: ::core::option::Option<Service>,
4585    /// 服务真实名称
4586    #[prost(message, optional, tag = "5")]
4587    pub alias_for: ::core::option::Option<Service>,
4588    /// 命名空间列表
4589    #[prost(message, repeated, tag = "6")]
4590    pub namespaces: ::prost::alloc::vec::Vec<Namespace>,
4591    /// 服务列表
4592    #[prost(message, repeated, tag = "7")]
4593    pub services: ::prost::alloc::vec::Vec<Service>,
4594    /// 服务实例列表
4595    #[prost(message, repeated, tag = "8")]
4596    pub instances: ::prost::alloc::vec::Vec<Instance>,
4597    /// 服务契约
4598    #[prost(message, repeated, tag = "9")]
4599    pub service_contracts: ::prost::alloc::vec::Vec<ServiceContract>,
4600    /// 限流规则
4601    #[prost(message, repeated, tag = "20")]
4602    pub rate_limit: ::prost::alloc::vec::Vec<RateLimit>,
4603    /// 熔断规则
4604    #[prost(message, repeated, tag = "21")]
4605    pub circuit_breaker: ::prost::alloc::vec::Vec<CircuitBreakerRule>,
4606    /// 故障检测规则
4607    #[prost(message, repeated, tag = "22")]
4608    pub fault_detect_rules: ::prost::alloc::vec::Vec<FaultDetectRule>,
4609    /// 全链路灰度泳道
4610    #[prost(message, repeated, tag = "23")]
4611    pub lanes: ::prost::alloc::vec::Vec<LaneGroup>,
4612    /// 自定义路由规则内容
4613    #[prost(message, repeated, tag = "24")]
4614    pub custom_route_rules: ::prost::alloc::vec::Vec<RouteRule>,
4615    /// 就近路由规则内容
4616    #[prost(message, repeated, tag = "25")]
4617    pub nearby_route_rules: ::prost::alloc::vec::Vec<RouteRule>,
4618    /// 无损上下线规则内容
4619    #[prost(message, repeated, tag = "26")]
4620    pub lossless_rules: ::prost::alloc::vec::Vec<LosslessRule>,
4621    /// 流量安全规则
4622    #[prost(message, repeated, tag = "27")]
4623    pub traffic_security_rules: ::prost::alloc::vec::Vec<TrafficSecurityRule>,
4624    /// 流量镜像规则
4625    #[prost(message, repeated, tag = "28")]
4626    pub traffic_mirror_rules: ::prost::alloc::vec::Vec<TrafficMirror>,
4627    /// 流量 Mock 规则
4628    #[prost(message, repeated, tag = "29")]
4629    pub traffic_mock_rules: ::prost::alloc::vec::Vec<TrafficMock>,
4630    /// 当前已认证服务的数据面身份描述,不包含 Service.token 或 workload 凭证
4631    #[prost(message, optional, tag = "30")]
4632    pub service_identity: ::core::option::Option<ServiceIdentityDescriptor>,
4633    /// 公共验证材料,不包含 workload credential 或任何私钥。
4634    #[prost(message, optional, tag = "31")]
4635    pub service_identity_bundle: ::core::option::Option<WorkloadTrustBundle>,
4636}
4637/// Nested message and enum types in `DiscoverResponse`.
4638pub mod discover_response {
4639    #[derive(
4640        Clone,
4641        Copy,
4642        Debug,
4643        PartialEq,
4644        Eq,
4645        Hash,
4646        PartialOrd,
4647        Ord,
4648        ::prost::Enumeration
4649    )]
4650    #[repr(i32)]
4651    pub enum DiscoverResponseType {
4652        Unknown = 0,
4653        /// 拉起命名空间列表
4654        Namespaces = 1,
4655        /// 服务列表
4656        Services = 2,
4657        /// 服务实例列表
4658        Instance = 3,
4659        /// 服务契约列表
4660        ServiceContracts = 4,
4661        /// 限流规则
4662        RateLimit = 20,
4663        /// 熔断规则
4664        CircuitBreaker = 21,
4665        /// 故障检测规则
4666        FaultDetector = 22,
4667        /// 自定义路由规则
4668        CustomRouteRule = 23,
4669        /// 就近路由规则
4670        NearbyRouteRule = 24,
4671        /// 泳道规则
4672        Lane = 25,
4673        /// 无损上下线规则
4674        Lossless = 26,
4675        /// 流量安全规则
4676        TrafficSecurityRule = 27,
4677        /// 流量镜像规则
4678        TrafficMirrorRule = 28,
4679        /// 流量 Mock 规则
4680        TrafficMockRule = 29,
4681        /// 当前已认证服务的数据面身份描述
4682        ServiceIdentity = 30,
4683        /// 当前已认证服务所属 trust domain 的公共验证材料
4684        ServiceIdentityBundle = 31,
4685        /// 服务订阅视图
4686        ServiceSubscribers = 50,
4687    }
4688    impl DiscoverResponseType {
4689        /// String value of the enum field names used in the ProtoBuf definition.
4690        ///
4691        /// The values are not transformed in any way and thus are considered stable
4692        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4693        pub fn as_str_name(&self) -> &'static str {
4694            match self {
4695                Self::Unknown => "UNKNOWN",
4696                Self::Namespaces => "NAMESPACES",
4697                Self::Services => "SERVICES",
4698                Self::Instance => "INSTANCE",
4699                Self::ServiceContracts => "SERVICE_CONTRACTS",
4700                Self::RateLimit => "RATE_LIMIT",
4701                Self::CircuitBreaker => "CIRCUIT_BREAKER",
4702                Self::FaultDetector => "FAULT_DETECTOR",
4703                Self::CustomRouteRule => "CUSTOM_ROUTE_RULE",
4704                Self::NearbyRouteRule => "NEARBY_ROUTE_RULE",
4705                Self::Lane => "LANE",
4706                Self::Lossless => "LOSSLESS",
4707                Self::TrafficSecurityRule => "TRAFFIC_SECURITY_RULE",
4708                Self::TrafficMirrorRule => "TRAFFIC_MIRROR_RULE",
4709                Self::TrafficMockRule => "TRAFFIC_MOCK_RULE",
4710                Self::ServiceIdentity => "SERVICE_IDENTITY",
4711                Self::ServiceIdentityBundle => "SERVICE_IDENTITY_BUNDLE",
4712                Self::ServiceSubscribers => "SERVICE_SUBSCRIBERS",
4713            }
4714        }
4715        /// Creates an enum from field names used in the ProtoBuf definition.
4716        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4717            match value {
4718                "UNKNOWN" => Some(Self::Unknown),
4719                "NAMESPACES" => Some(Self::Namespaces),
4720                "SERVICES" => Some(Self::Services),
4721                "INSTANCE" => Some(Self::Instance),
4722                "SERVICE_CONTRACTS" => Some(Self::ServiceContracts),
4723                "RATE_LIMIT" => Some(Self::RateLimit),
4724                "CIRCUIT_BREAKER" => Some(Self::CircuitBreaker),
4725                "FAULT_DETECTOR" => Some(Self::FaultDetector),
4726                "CUSTOM_ROUTE_RULE" => Some(Self::CustomRouteRule),
4727                "NEARBY_ROUTE_RULE" => Some(Self::NearbyRouteRule),
4728                "LANE" => Some(Self::Lane),
4729                "LOSSLESS" => Some(Self::Lossless),
4730                "TRAFFIC_SECURITY_RULE" => Some(Self::TrafficSecurityRule),
4731                "TRAFFIC_MIRROR_RULE" => Some(Self::TrafficMirrorRule),
4732                "TRAFFIC_MOCK_RULE" => Some(Self::TrafficMockRule),
4733                "SERVICE_IDENTITY" => Some(Self::ServiceIdentity),
4734                "SERVICE_IDENTITY_BUNDLE" => Some(Self::ServiceIdentityBundle),
4735                "SERVICE_SUBSCRIBERS" => Some(Self::ServiceSubscribers),
4736                _ => None,
4737            }
4738        }
4739    }
4740}
4741/// 服务稳定的数据面身份描述。本对象不是凭证,也不包含任何 secret。
4742/// control-plane 必须根据 gRPC metadata 中已验证的 service token 推导该对象,
4743/// DiscoverRequest.service 只能用于 namespace/service 一致性校验。
4744#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4745pub struct ServiceIdentityDescriptor {
4746    /// SDK 内部使用的稳定主体标识,不作为用户可编辑配置暴露。
4747    #[prost(string, tag = "1")]
4748    pub subject: ::prost::alloc::string::String,
4749    #[prost(string, tag = "2")]
4750    pub namespace: ::prost::alloc::string::String,
4751    #[prost(string, tag = "3")]
4752    pub service: ::prost::alloc::string::String,
4753    #[prost(string, tag = "4")]
4754    pub revision: ::prost::alloc::string::String,
4755    #[prost(string, tag = "5")]
4756    pub credential_mode: ::prost::alloc::string::String,
4757    #[prost(string, tag = "6")]
4758    pub trust_bundle_version: ::prost::alloc::string::String,
4759    #[prost(string, tag = "7")]
4760    pub trust_domain: ::prost::alloc::string::String,
4761    #[prost(string, tag = "8")]
4762    pub audience: ::prost::alloc::string::String,
4763    /// 独立 workload credential RPC 的服务端点;凭证本身不得进入 Discover。
4764    #[prost(string, tag = "9")]
4765    pub credential_endpoint: ::prost::alloc::string::String,
4766    /// typed 协议版本和格式能力;旧 string 字段继续保留用于兼容旧 SDK。
4767    #[prost(uint32, tag = "10")]
4768    pub identity_protocol_version: u32,
4769    #[prost(enumeration = "WorkloadCredentialFormat", repeated, tag = "11")]
4770    pub credential_formats: ::prost::alloc::vec::Vec<i32>,
4771}
4772/// Generated client implementations.
4773pub mod discover_grpc_client {
4774    #![allow(
4775        unused_variables,
4776        dead_code,
4777        missing_docs,
4778        clippy::wildcard_imports,
4779        clippy::let_unit_value,
4780    )]
4781    use tonic::codegen::*;
4782    use tonic::codegen::http::Uri;
4783    #[derive(Debug, Clone)]
4784    pub struct DiscoverGrpcClient<T> {
4785        inner: tonic::client::Grpc<T>,
4786    }
4787    impl DiscoverGrpcClient<tonic::transport::Channel> {
4788        /// Attempt to create a new client by connecting to a given endpoint.
4789        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4790        where
4791            D: TryInto<tonic::transport::Endpoint>,
4792            D::Error: Into<StdError>,
4793        {
4794            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4795            Ok(Self::new(conn))
4796        }
4797    }
4798    impl<T> DiscoverGrpcClient<T>
4799    where
4800        T: tonic::client::GrpcService<tonic::body::Body>,
4801        T::Error: Into<StdError>,
4802        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4803        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4804    {
4805        pub fn new(inner: T) -> Self {
4806            let inner = tonic::client::Grpc::new(inner);
4807            Self { inner }
4808        }
4809        pub fn with_origin(inner: T, origin: Uri) -> Self {
4810            let inner = tonic::client::Grpc::with_origin(inner, origin);
4811            Self { inner }
4812        }
4813        pub fn with_interceptor<F>(
4814            inner: T,
4815            interceptor: F,
4816        ) -> DiscoverGrpcClient<InterceptedService<T, F>>
4817        where
4818            F: tonic::service::Interceptor,
4819            T::ResponseBody: Default,
4820            T: tonic::codegen::Service<
4821                http::Request<tonic::body::Body>,
4822                Response = http::Response<
4823                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4824                >,
4825            >,
4826            <T as tonic::codegen::Service<
4827                http::Request<tonic::body::Body>,
4828            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4829        {
4830            DiscoverGrpcClient::new(InterceptedService::new(inner, interceptor))
4831        }
4832        /// Compress requests with the given encoding.
4833        ///
4834        /// This requires the server to support it otherwise it might respond with an
4835        /// error.
4836        #[must_use]
4837        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4838            self.inner = self.inner.send_compressed(encoding);
4839            self
4840        }
4841        /// Enable decompressing responses.
4842        #[must_use]
4843        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4844            self.inner = self.inner.accept_compressed(encoding);
4845            self
4846        }
4847        /// Limits the maximum size of a decoded message.
4848        ///
4849        /// Default: `4MB`
4850        #[must_use]
4851        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4852            self.inner = self.inner.max_decoding_message_size(limit);
4853            self
4854        }
4855        /// Limits the maximum size of an encoded message.
4856        ///
4857        /// Default: `usize::MAX`
4858        #[must_use]
4859        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4860            self.inner = self.inner.max_encoding_message_size(limit);
4861            self
4862        }
4863        /// 客户端上报
4864        pub async fn report_client(
4865            &mut self,
4866            request: impl tonic::IntoRequest<super::Client>,
4867        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
4868            self.inner
4869                .ready()
4870                .await
4871                .map_err(|e| {
4872                    tonic::Status::unknown(
4873                        format!("Service was not ready: {}", e.into()),
4874                    )
4875                })?;
4876            let codec = tonic_prost::ProstCodec::default();
4877            let path = http::uri::PathAndQuery::from_static(
4878                "/v1.DiscoverGRPC/ReportClient",
4879            );
4880            let mut req = request.into_request();
4881            req.extensions_mut()
4882                .insert(GrpcMethod::new("v1.DiscoverGRPC", "ReportClient"));
4883            self.inner.unary(req, path, codec).await
4884        }
4885        /// 被调方注册服务实例
4886        pub async fn register_instance(
4887            &mut self,
4888            request: impl tonic::IntoRequest<super::Instance>,
4889        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
4890            self.inner
4891                .ready()
4892                .await
4893                .map_err(|e| {
4894                    tonic::Status::unknown(
4895                        format!("Service was not ready: {}", e.into()),
4896                    )
4897                })?;
4898            let codec = tonic_prost::ProstCodec::default();
4899            let path = http::uri::PathAndQuery::from_static(
4900                "/v1.DiscoverGRPC/RegisterInstance",
4901            );
4902            let mut req = request.into_request();
4903            req.extensions_mut()
4904                .insert(GrpcMethod::new("v1.DiscoverGRPC", "RegisterInstance"));
4905            self.inner.unary(req, path, codec).await
4906        }
4907        /// 被调方反注册服务实例
4908        pub async fn deregister_instance(
4909            &mut self,
4910            request: impl tonic::IntoRequest<super::Instance>,
4911        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
4912            self.inner
4913                .ready()
4914                .await
4915                .map_err(|e| {
4916                    tonic::Status::unknown(
4917                        format!("Service was not ready: {}", e.into()),
4918                    )
4919                })?;
4920            let codec = tonic_prost::ProstCodec::default();
4921            let path = http::uri::PathAndQuery::from_static(
4922                "/v1.DiscoverGRPC/DeregisterInstance",
4923            );
4924            let mut req = request.into_request();
4925            req.extensions_mut()
4926                .insert(GrpcMethod::new("v1.DiscoverGRPC", "DeregisterInstance"));
4927            self.inner.unary(req, path, codec).await
4928        }
4929        /// 统一发现接口
4930        pub async fn discover(
4931            &mut self,
4932            request: impl tonic::IntoStreamingRequest<Message = super::DiscoverRequest>,
4933        ) -> std::result::Result<
4934            tonic::Response<tonic::codec::Streaming<super::DiscoverResponse>>,
4935            tonic::Status,
4936        > {
4937            self.inner
4938                .ready()
4939                .await
4940                .map_err(|e| {
4941                    tonic::Status::unknown(
4942                        format!("Service was not ready: {}", e.into()),
4943                    )
4944                })?;
4945            let codec = tonic_prost::ProstCodec::default();
4946            let path = http::uri::PathAndQuery::from_static("/v1.DiscoverGRPC/Discover");
4947            let mut req = request.into_streaming_request();
4948            req.extensions_mut().insert(GrpcMethod::new("v1.DiscoverGRPC", "Discover"));
4949            self.inner.streaming(req, path, codec).await
4950        }
4951        /// 被调方批量上报心跳
4952        pub async fn heartbeat(
4953            &mut self,
4954            request: impl tonic::IntoStreamingRequest<Message = super::HeartbeatsRequest>,
4955        ) -> std::result::Result<
4956            tonic::Response<tonic::codec::Streaming<super::HeartbeatsResponse>>,
4957            tonic::Status,
4958        > {
4959            self.inner
4960                .ready()
4961                .await
4962                .map_err(|e| {
4963                    tonic::Status::unknown(
4964                        format!("Service was not ready: {}", e.into()),
4965                    )
4966                })?;
4967            let codec = tonic_prost::ProstCodec::default();
4968            let path = http::uri::PathAndQuery::from_static(
4969                "/v1.DiscoverGRPC/Heartbeat",
4970            );
4971            let mut req = request.into_streaming_request();
4972            req.extensions_mut().insert(GrpcMethod::new("v1.DiscoverGRPC", "Heartbeat"));
4973            self.inner.streaming(req, path, codec).await
4974        }
4975        /// 上报服务契约
4976        pub async fn report_service_contract(
4977            &mut self,
4978            request: impl tonic::IntoRequest<super::ServiceContract>,
4979        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
4980            self.inner
4981                .ready()
4982                .await
4983                .map_err(|e| {
4984                    tonic::Status::unknown(
4985                        format!("Service was not ready: {}", e.into()),
4986                    )
4987                })?;
4988            let codec = tonic_prost::ProstCodec::default();
4989            let path = http::uri::PathAndQuery::from_static(
4990                "/v1.DiscoverGRPC/ReportServiceContract",
4991            );
4992            let mut req = request.into_request();
4993            req.extensions_mut()
4994                .insert(GrpcMethod::new("v1.DiscoverGRPC", "ReportServiceContract"));
4995            self.inner.unary(req, path, codec).await
4996        }
4997    }
4998}
4999/// Generated server implementations.
5000pub mod discover_grpc_server {
5001    #![allow(
5002        unused_variables,
5003        dead_code,
5004        missing_docs,
5005        clippy::wildcard_imports,
5006        clippy::let_unit_value,
5007    )]
5008    use tonic::codegen::*;
5009    /// Generated trait containing gRPC methods that should be implemented for use with DiscoverGrpcServer.
5010    #[async_trait]
5011    pub trait DiscoverGrpc: std::marker::Send + std::marker::Sync + 'static {
5012        /// 客户端上报
5013        async fn report_client(
5014            &self,
5015            request: tonic::Request<super::Client>,
5016        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
5017        /// 被调方注册服务实例
5018        async fn register_instance(
5019            &self,
5020            request: tonic::Request<super::Instance>,
5021        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
5022        /// 被调方反注册服务实例
5023        async fn deregister_instance(
5024            &self,
5025            request: tonic::Request<super::Instance>,
5026        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
5027        /// Server streaming response type for the Discover method.
5028        type DiscoverStream: tonic::codegen::tokio_stream::Stream<
5029                Item = std::result::Result<super::DiscoverResponse, tonic::Status>,
5030            >
5031            + std::marker::Send
5032            + 'static;
5033        /// 统一发现接口
5034        async fn discover(
5035            &self,
5036            request: tonic::Request<tonic::Streaming<super::DiscoverRequest>>,
5037        ) -> std::result::Result<tonic::Response<Self::DiscoverStream>, tonic::Status>;
5038        /// Server streaming response type for the Heartbeat method.
5039        type HeartbeatStream: tonic::codegen::tokio_stream::Stream<
5040                Item = std::result::Result<super::HeartbeatsResponse, tonic::Status>,
5041            >
5042            + std::marker::Send
5043            + 'static;
5044        /// 被调方批量上报心跳
5045        async fn heartbeat(
5046            &self,
5047            request: tonic::Request<tonic::Streaming<super::HeartbeatsRequest>>,
5048        ) -> std::result::Result<tonic::Response<Self::HeartbeatStream>, tonic::Status>;
5049        /// 上报服务契约
5050        async fn report_service_contract(
5051            &self,
5052            request: tonic::Request<super::ServiceContract>,
5053        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
5054    }
5055    #[derive(Debug)]
5056    pub struct DiscoverGrpcServer<T> {
5057        inner: Arc<T>,
5058        accept_compression_encodings: EnabledCompressionEncodings,
5059        send_compression_encodings: EnabledCompressionEncodings,
5060        max_decoding_message_size: Option<usize>,
5061        max_encoding_message_size: Option<usize>,
5062    }
5063    impl<T> DiscoverGrpcServer<T> {
5064        pub fn new(inner: T) -> Self {
5065            Self::from_arc(Arc::new(inner))
5066        }
5067        pub fn from_arc(inner: Arc<T>) -> Self {
5068            Self {
5069                inner,
5070                accept_compression_encodings: Default::default(),
5071                send_compression_encodings: Default::default(),
5072                max_decoding_message_size: None,
5073                max_encoding_message_size: None,
5074            }
5075        }
5076        pub fn with_interceptor<F>(
5077            inner: T,
5078            interceptor: F,
5079        ) -> InterceptedService<Self, F>
5080        where
5081            F: tonic::service::Interceptor,
5082        {
5083            InterceptedService::new(Self::new(inner), interceptor)
5084        }
5085        /// Enable decompressing requests with the given encoding.
5086        #[must_use]
5087        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5088            self.accept_compression_encodings.enable(encoding);
5089            self
5090        }
5091        /// Compress responses with the given encoding, if the client supports it.
5092        #[must_use]
5093        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5094            self.send_compression_encodings.enable(encoding);
5095            self
5096        }
5097        /// Limits the maximum size of a decoded message.
5098        ///
5099        /// Default: `4MB`
5100        #[must_use]
5101        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5102            self.max_decoding_message_size = Some(limit);
5103            self
5104        }
5105        /// Limits the maximum size of an encoded message.
5106        ///
5107        /// Default: `usize::MAX`
5108        #[must_use]
5109        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5110            self.max_encoding_message_size = Some(limit);
5111            self
5112        }
5113    }
5114    impl<T, B> tonic::codegen::Service<http::Request<B>> for DiscoverGrpcServer<T>
5115    where
5116        T: DiscoverGrpc,
5117        B: Body + std::marker::Send + 'static,
5118        B::Error: Into<StdError> + std::marker::Send + 'static,
5119    {
5120        type Response = http::Response<tonic::body::Body>;
5121        type Error = std::convert::Infallible;
5122        type Future = BoxFuture<Self::Response, Self::Error>;
5123        fn poll_ready(
5124            &mut self,
5125            _cx: &mut Context<'_>,
5126        ) -> Poll<std::result::Result<(), Self::Error>> {
5127            Poll::Ready(Ok(()))
5128        }
5129        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5130            match req.uri().path() {
5131                "/v1.DiscoverGRPC/ReportClient" => {
5132                    #[allow(non_camel_case_types)]
5133                    struct ReportClientSvc<T: DiscoverGrpc>(pub Arc<T>);
5134                    impl<T: DiscoverGrpc> tonic::server::UnaryService<super::Client>
5135                    for ReportClientSvc<T> {
5136                        type Response = super::Response;
5137                        type Future = BoxFuture<
5138                            tonic::Response<Self::Response>,
5139                            tonic::Status,
5140                        >;
5141                        fn call(
5142                            &mut self,
5143                            request: tonic::Request<super::Client>,
5144                        ) -> Self::Future {
5145                            let inner = Arc::clone(&self.0);
5146                            let fut = async move {
5147                                <T as DiscoverGrpc>::report_client(&inner, request).await
5148                            };
5149                            Box::pin(fut)
5150                        }
5151                    }
5152                    let accept_compression_encodings = self.accept_compression_encodings;
5153                    let send_compression_encodings = self.send_compression_encodings;
5154                    let max_decoding_message_size = self.max_decoding_message_size;
5155                    let max_encoding_message_size = self.max_encoding_message_size;
5156                    let inner = self.inner.clone();
5157                    let fut = async move {
5158                        let method = ReportClientSvc(inner);
5159                        let codec = tonic_prost::ProstCodec::default();
5160                        let mut grpc = tonic::server::Grpc::new(codec)
5161                            .apply_compression_config(
5162                                accept_compression_encodings,
5163                                send_compression_encodings,
5164                            )
5165                            .apply_max_message_size_config(
5166                                max_decoding_message_size,
5167                                max_encoding_message_size,
5168                            );
5169                        let res = grpc.unary(method, req).await;
5170                        Ok(res)
5171                    };
5172                    Box::pin(fut)
5173                }
5174                "/v1.DiscoverGRPC/RegisterInstance" => {
5175                    #[allow(non_camel_case_types)]
5176                    struct RegisterInstanceSvc<T: DiscoverGrpc>(pub Arc<T>);
5177                    impl<T: DiscoverGrpc> tonic::server::UnaryService<super::Instance>
5178                    for RegisterInstanceSvc<T> {
5179                        type Response = super::Response;
5180                        type Future = BoxFuture<
5181                            tonic::Response<Self::Response>,
5182                            tonic::Status,
5183                        >;
5184                        fn call(
5185                            &mut self,
5186                            request: tonic::Request<super::Instance>,
5187                        ) -> Self::Future {
5188                            let inner = Arc::clone(&self.0);
5189                            let fut = async move {
5190                                <T as DiscoverGrpc>::register_instance(&inner, request)
5191                                    .await
5192                            };
5193                            Box::pin(fut)
5194                        }
5195                    }
5196                    let accept_compression_encodings = self.accept_compression_encodings;
5197                    let send_compression_encodings = self.send_compression_encodings;
5198                    let max_decoding_message_size = self.max_decoding_message_size;
5199                    let max_encoding_message_size = self.max_encoding_message_size;
5200                    let inner = self.inner.clone();
5201                    let fut = async move {
5202                        let method = RegisterInstanceSvc(inner);
5203                        let codec = tonic_prost::ProstCodec::default();
5204                        let mut grpc = tonic::server::Grpc::new(codec)
5205                            .apply_compression_config(
5206                                accept_compression_encodings,
5207                                send_compression_encodings,
5208                            )
5209                            .apply_max_message_size_config(
5210                                max_decoding_message_size,
5211                                max_encoding_message_size,
5212                            );
5213                        let res = grpc.unary(method, req).await;
5214                        Ok(res)
5215                    };
5216                    Box::pin(fut)
5217                }
5218                "/v1.DiscoverGRPC/DeregisterInstance" => {
5219                    #[allow(non_camel_case_types)]
5220                    struct DeregisterInstanceSvc<T: DiscoverGrpc>(pub Arc<T>);
5221                    impl<T: DiscoverGrpc> tonic::server::UnaryService<super::Instance>
5222                    for DeregisterInstanceSvc<T> {
5223                        type Response = super::Response;
5224                        type Future = BoxFuture<
5225                            tonic::Response<Self::Response>,
5226                            tonic::Status,
5227                        >;
5228                        fn call(
5229                            &mut self,
5230                            request: tonic::Request<super::Instance>,
5231                        ) -> Self::Future {
5232                            let inner = Arc::clone(&self.0);
5233                            let fut = async move {
5234                                <T as DiscoverGrpc>::deregister_instance(&inner, request)
5235                                    .await
5236                            };
5237                            Box::pin(fut)
5238                        }
5239                    }
5240                    let accept_compression_encodings = self.accept_compression_encodings;
5241                    let send_compression_encodings = self.send_compression_encodings;
5242                    let max_decoding_message_size = self.max_decoding_message_size;
5243                    let max_encoding_message_size = self.max_encoding_message_size;
5244                    let inner = self.inner.clone();
5245                    let fut = async move {
5246                        let method = DeregisterInstanceSvc(inner);
5247                        let codec = tonic_prost::ProstCodec::default();
5248                        let mut grpc = tonic::server::Grpc::new(codec)
5249                            .apply_compression_config(
5250                                accept_compression_encodings,
5251                                send_compression_encodings,
5252                            )
5253                            .apply_max_message_size_config(
5254                                max_decoding_message_size,
5255                                max_encoding_message_size,
5256                            );
5257                        let res = grpc.unary(method, req).await;
5258                        Ok(res)
5259                    };
5260                    Box::pin(fut)
5261                }
5262                "/v1.DiscoverGRPC/Discover" => {
5263                    #[allow(non_camel_case_types)]
5264                    struct DiscoverSvc<T: DiscoverGrpc>(pub Arc<T>);
5265                    impl<
5266                        T: DiscoverGrpc,
5267                    > tonic::server::StreamingService<super::DiscoverRequest>
5268                    for DiscoverSvc<T> {
5269                        type Response = super::DiscoverResponse;
5270                        type ResponseStream = T::DiscoverStream;
5271                        type Future = BoxFuture<
5272                            tonic::Response<Self::ResponseStream>,
5273                            tonic::Status,
5274                        >;
5275                        fn call(
5276                            &mut self,
5277                            request: tonic::Request<
5278                                tonic::Streaming<super::DiscoverRequest>,
5279                            >,
5280                        ) -> Self::Future {
5281                            let inner = Arc::clone(&self.0);
5282                            let fut = async move {
5283                                <T as DiscoverGrpc>::discover(&inner, request).await
5284                            };
5285                            Box::pin(fut)
5286                        }
5287                    }
5288                    let accept_compression_encodings = self.accept_compression_encodings;
5289                    let send_compression_encodings = self.send_compression_encodings;
5290                    let max_decoding_message_size = self.max_decoding_message_size;
5291                    let max_encoding_message_size = self.max_encoding_message_size;
5292                    let inner = self.inner.clone();
5293                    let fut = async move {
5294                        let method = DiscoverSvc(inner);
5295                        let codec = tonic_prost::ProstCodec::default();
5296                        let mut grpc = tonic::server::Grpc::new(codec)
5297                            .apply_compression_config(
5298                                accept_compression_encodings,
5299                                send_compression_encodings,
5300                            )
5301                            .apply_max_message_size_config(
5302                                max_decoding_message_size,
5303                                max_encoding_message_size,
5304                            );
5305                        let res = grpc.streaming(method, req).await;
5306                        Ok(res)
5307                    };
5308                    Box::pin(fut)
5309                }
5310                "/v1.DiscoverGRPC/Heartbeat" => {
5311                    #[allow(non_camel_case_types)]
5312                    struct HeartbeatSvc<T: DiscoverGrpc>(pub Arc<T>);
5313                    impl<
5314                        T: DiscoverGrpc,
5315                    > tonic::server::StreamingService<super::HeartbeatsRequest>
5316                    for HeartbeatSvc<T> {
5317                        type Response = super::HeartbeatsResponse;
5318                        type ResponseStream = T::HeartbeatStream;
5319                        type Future = BoxFuture<
5320                            tonic::Response<Self::ResponseStream>,
5321                            tonic::Status,
5322                        >;
5323                        fn call(
5324                            &mut self,
5325                            request: tonic::Request<
5326                                tonic::Streaming<super::HeartbeatsRequest>,
5327                            >,
5328                        ) -> Self::Future {
5329                            let inner = Arc::clone(&self.0);
5330                            let fut = async move {
5331                                <T as DiscoverGrpc>::heartbeat(&inner, request).await
5332                            };
5333                            Box::pin(fut)
5334                        }
5335                    }
5336                    let accept_compression_encodings = self.accept_compression_encodings;
5337                    let send_compression_encodings = self.send_compression_encodings;
5338                    let max_decoding_message_size = self.max_decoding_message_size;
5339                    let max_encoding_message_size = self.max_encoding_message_size;
5340                    let inner = self.inner.clone();
5341                    let fut = async move {
5342                        let method = HeartbeatSvc(inner);
5343                        let codec = tonic_prost::ProstCodec::default();
5344                        let mut grpc = tonic::server::Grpc::new(codec)
5345                            .apply_compression_config(
5346                                accept_compression_encodings,
5347                                send_compression_encodings,
5348                            )
5349                            .apply_max_message_size_config(
5350                                max_decoding_message_size,
5351                                max_encoding_message_size,
5352                            );
5353                        let res = grpc.streaming(method, req).await;
5354                        Ok(res)
5355                    };
5356                    Box::pin(fut)
5357                }
5358                "/v1.DiscoverGRPC/ReportServiceContract" => {
5359                    #[allow(non_camel_case_types)]
5360                    struct ReportServiceContractSvc<T: DiscoverGrpc>(pub Arc<T>);
5361                    impl<
5362                        T: DiscoverGrpc,
5363                    > tonic::server::UnaryService<super::ServiceContract>
5364                    for ReportServiceContractSvc<T> {
5365                        type Response = super::Response;
5366                        type Future = BoxFuture<
5367                            tonic::Response<Self::Response>,
5368                            tonic::Status,
5369                        >;
5370                        fn call(
5371                            &mut self,
5372                            request: tonic::Request<super::ServiceContract>,
5373                        ) -> Self::Future {
5374                            let inner = Arc::clone(&self.0);
5375                            let fut = async move {
5376                                <T as DiscoverGrpc>::report_service_contract(
5377                                        &inner,
5378                                        request,
5379                                    )
5380                                    .await
5381                            };
5382                            Box::pin(fut)
5383                        }
5384                    }
5385                    let accept_compression_encodings = self.accept_compression_encodings;
5386                    let send_compression_encodings = self.send_compression_encodings;
5387                    let max_decoding_message_size = self.max_decoding_message_size;
5388                    let max_encoding_message_size = self.max_encoding_message_size;
5389                    let inner = self.inner.clone();
5390                    let fut = async move {
5391                        let method = ReportServiceContractSvc(inner);
5392                        let codec = tonic_prost::ProstCodec::default();
5393                        let mut grpc = tonic::server::Grpc::new(codec)
5394                            .apply_compression_config(
5395                                accept_compression_encodings,
5396                                send_compression_encodings,
5397                            )
5398                            .apply_max_message_size_config(
5399                                max_decoding_message_size,
5400                                max_encoding_message_size,
5401                            );
5402                        let res = grpc.unary(method, req).await;
5403                        Ok(res)
5404                    };
5405                    Box::pin(fut)
5406                }
5407                _ => {
5408                    Box::pin(async move {
5409                        let mut response = http::Response::new(
5410                            tonic::body::Body::default(),
5411                        );
5412                        let headers = response.headers_mut();
5413                        headers
5414                            .insert(
5415                                tonic::Status::GRPC_STATUS,
5416                                (tonic::Code::Unimplemented as i32).into(),
5417                            );
5418                        headers
5419                            .insert(
5420                                http::header::CONTENT_TYPE,
5421                                tonic::metadata::GRPC_CONTENT_TYPE,
5422                            );
5423                        Ok(response)
5424                    })
5425                }
5426            }
5427        }
5428    }
5429    impl<T> Clone for DiscoverGrpcServer<T> {
5430        fn clone(&self) -> Self {
5431            let inner = self.inner.clone();
5432            Self {
5433                inner,
5434                accept_compression_encodings: self.accept_compression_encodings,
5435                send_compression_encodings: self.send_compression_encodings,
5436                max_decoding_message_size: self.max_decoding_message_size,
5437                max_encoding_message_size: self.max_encoding_message_size,
5438            }
5439        }
5440    }
5441    /// Generated gRPC service name
5442    pub const SERVICE_NAME: &str = "v1.DiscoverGRPC";
5443    impl<T> tonic::server::NamedService for DiscoverGrpcServer<T> {
5444        const NAME: &'static str = SERVICE_NAME;
5445    }
5446}
5447/// Generated client implementations.
5448pub mod pole_heartbeat_grpc_client {
5449    #![allow(
5450        unused_variables,
5451        dead_code,
5452        missing_docs,
5453        clippy::wildcard_imports,
5454        clippy::let_unit_value,
5455    )]
5456    use tonic::codegen::*;
5457    use tonic::codegen::http::Uri;
5458    #[derive(Debug, Clone)]
5459    pub struct PoleHeartbeatGrpcClient<T> {
5460        inner: tonic::client::Grpc<T>,
5461    }
5462    impl PoleHeartbeatGrpcClient<tonic::transport::Channel> {
5463        /// Attempt to create a new client by connecting to a given endpoint.
5464        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5465        where
5466            D: TryInto<tonic::transport::Endpoint>,
5467            D::Error: Into<StdError>,
5468        {
5469            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5470            Ok(Self::new(conn))
5471        }
5472    }
5473    impl<T> PoleHeartbeatGrpcClient<T>
5474    where
5475        T: tonic::client::GrpcService<tonic::body::Body>,
5476        T::Error: Into<StdError>,
5477        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5478        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5479    {
5480        pub fn new(inner: T) -> Self {
5481            let inner = tonic::client::Grpc::new(inner);
5482            Self { inner }
5483        }
5484        pub fn with_origin(inner: T, origin: Uri) -> Self {
5485            let inner = tonic::client::Grpc::with_origin(inner, origin);
5486            Self { inner }
5487        }
5488        pub fn with_interceptor<F>(
5489            inner: T,
5490            interceptor: F,
5491        ) -> PoleHeartbeatGrpcClient<InterceptedService<T, F>>
5492        where
5493            F: tonic::service::Interceptor,
5494            T::ResponseBody: Default,
5495            T: tonic::codegen::Service<
5496                http::Request<tonic::body::Body>,
5497                Response = http::Response<
5498                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5499                >,
5500            >,
5501            <T as tonic::codegen::Service<
5502                http::Request<tonic::body::Body>,
5503            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5504        {
5505            PoleHeartbeatGrpcClient::new(InterceptedService::new(inner, interceptor))
5506        }
5507        /// Compress requests with the given encoding.
5508        ///
5509        /// This requires the server to support it otherwise it might respond with an
5510        /// error.
5511        #[must_use]
5512        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5513            self.inner = self.inner.send_compressed(encoding);
5514            self
5515        }
5516        /// Enable decompressing responses.
5517        #[must_use]
5518        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5519            self.inner = self.inner.accept_compressed(encoding);
5520            self
5521        }
5522        /// Limits the maximum size of a decoded message.
5523        ///
5524        /// Default: `4MB`
5525        #[must_use]
5526        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5527            self.inner = self.inner.max_decoding_message_size(limit);
5528            self
5529        }
5530        /// Limits the maximum size of an encoded message.
5531        ///
5532        /// Default: `usize::MAX`
5533        #[must_use]
5534        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5535            self.inner = self.inner.max_encoding_message_size(limit);
5536            self
5537        }
5538        /// 批量获取心跳记录
5539        pub async fn batch_get_heartbeat(
5540            &mut self,
5541            request: impl tonic::IntoRequest<super::GetHeartbeatsRequest>,
5542        ) -> std::result::Result<
5543            tonic::Response<super::GetHeartbeatsResponse>,
5544            tonic::Status,
5545        > {
5546            self.inner
5547                .ready()
5548                .await
5549                .map_err(|e| {
5550                    tonic::Status::unknown(
5551                        format!("Service was not ready: {}", e.into()),
5552                    )
5553                })?;
5554            let codec = tonic_prost::ProstCodec::default();
5555            let path = http::uri::PathAndQuery::from_static(
5556                "/v1.PoleHeartbeatGRPC/BatchGetHeartbeat",
5557            );
5558            let mut req = request.into_request();
5559            req.extensions_mut()
5560                .insert(GrpcMethod::new("v1.PoleHeartbeatGRPC", "BatchGetHeartbeat"));
5561            self.inner.unary(req, path, codec).await
5562        }
5563        /// 批量删除心跳记录
5564        pub async fn batch_del_heartbeat(
5565            &mut self,
5566            request: impl tonic::IntoRequest<super::DelHeartbeatsRequest>,
5567        ) -> std::result::Result<
5568            tonic::Response<super::DelHeartbeatsResponse>,
5569            tonic::Status,
5570        > {
5571            self.inner
5572                .ready()
5573                .await
5574                .map_err(|e| {
5575                    tonic::Status::unknown(
5576                        format!("Service was not ready: {}", e.into()),
5577                    )
5578                })?;
5579            let codec = tonic_prost::ProstCodec::default();
5580            let path = http::uri::PathAndQuery::from_static(
5581                "/v1.PoleHeartbeatGRPC/BatchDelHeartbeat",
5582            );
5583            let mut req = request.into_request();
5584            req.extensions_mut()
5585                .insert(GrpcMethod::new("v1.PoleHeartbeatGRPC", "BatchDelHeartbeat"));
5586            self.inner.unary(req, path, codec).await
5587        }
5588    }
5589}
5590/// Generated server implementations.
5591pub mod pole_heartbeat_grpc_server {
5592    #![allow(
5593        unused_variables,
5594        dead_code,
5595        missing_docs,
5596        clippy::wildcard_imports,
5597        clippy::let_unit_value,
5598    )]
5599    use tonic::codegen::*;
5600    /// Generated trait containing gRPC methods that should be implemented for use with PoleHeartbeatGrpcServer.
5601    #[async_trait]
5602    pub trait PoleHeartbeatGrpc: std::marker::Send + std::marker::Sync + 'static {
5603        /// 批量获取心跳记录
5604        async fn batch_get_heartbeat(
5605            &self,
5606            request: tonic::Request<super::GetHeartbeatsRequest>,
5607        ) -> std::result::Result<
5608            tonic::Response<super::GetHeartbeatsResponse>,
5609            tonic::Status,
5610        >;
5611        /// 批量删除心跳记录
5612        async fn batch_del_heartbeat(
5613            &self,
5614            request: tonic::Request<super::DelHeartbeatsRequest>,
5615        ) -> std::result::Result<
5616            tonic::Response<super::DelHeartbeatsResponse>,
5617            tonic::Status,
5618        >;
5619    }
5620    #[derive(Debug)]
5621    pub struct PoleHeartbeatGrpcServer<T> {
5622        inner: Arc<T>,
5623        accept_compression_encodings: EnabledCompressionEncodings,
5624        send_compression_encodings: EnabledCompressionEncodings,
5625        max_decoding_message_size: Option<usize>,
5626        max_encoding_message_size: Option<usize>,
5627    }
5628    impl<T> PoleHeartbeatGrpcServer<T> {
5629        pub fn new(inner: T) -> Self {
5630            Self::from_arc(Arc::new(inner))
5631        }
5632        pub fn from_arc(inner: Arc<T>) -> Self {
5633            Self {
5634                inner,
5635                accept_compression_encodings: Default::default(),
5636                send_compression_encodings: Default::default(),
5637                max_decoding_message_size: None,
5638                max_encoding_message_size: None,
5639            }
5640        }
5641        pub fn with_interceptor<F>(
5642            inner: T,
5643            interceptor: F,
5644        ) -> InterceptedService<Self, F>
5645        where
5646            F: tonic::service::Interceptor,
5647        {
5648            InterceptedService::new(Self::new(inner), interceptor)
5649        }
5650        /// Enable decompressing requests with the given encoding.
5651        #[must_use]
5652        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5653            self.accept_compression_encodings.enable(encoding);
5654            self
5655        }
5656        /// Compress responses with the given encoding, if the client supports it.
5657        #[must_use]
5658        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5659            self.send_compression_encodings.enable(encoding);
5660            self
5661        }
5662        /// Limits the maximum size of a decoded message.
5663        ///
5664        /// Default: `4MB`
5665        #[must_use]
5666        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5667            self.max_decoding_message_size = Some(limit);
5668            self
5669        }
5670        /// Limits the maximum size of an encoded message.
5671        ///
5672        /// Default: `usize::MAX`
5673        #[must_use]
5674        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5675            self.max_encoding_message_size = Some(limit);
5676            self
5677        }
5678    }
5679    impl<T, B> tonic::codegen::Service<http::Request<B>> for PoleHeartbeatGrpcServer<T>
5680    where
5681        T: PoleHeartbeatGrpc,
5682        B: Body + std::marker::Send + 'static,
5683        B::Error: Into<StdError> + std::marker::Send + 'static,
5684    {
5685        type Response = http::Response<tonic::body::Body>;
5686        type Error = std::convert::Infallible;
5687        type Future = BoxFuture<Self::Response, Self::Error>;
5688        fn poll_ready(
5689            &mut self,
5690            _cx: &mut Context<'_>,
5691        ) -> Poll<std::result::Result<(), Self::Error>> {
5692            Poll::Ready(Ok(()))
5693        }
5694        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5695            match req.uri().path() {
5696                "/v1.PoleHeartbeatGRPC/BatchGetHeartbeat" => {
5697                    #[allow(non_camel_case_types)]
5698                    struct BatchGetHeartbeatSvc<T: PoleHeartbeatGrpc>(pub Arc<T>);
5699                    impl<
5700                        T: PoleHeartbeatGrpc,
5701                    > tonic::server::UnaryService<super::GetHeartbeatsRequest>
5702                    for BatchGetHeartbeatSvc<T> {
5703                        type Response = super::GetHeartbeatsResponse;
5704                        type Future = BoxFuture<
5705                            tonic::Response<Self::Response>,
5706                            tonic::Status,
5707                        >;
5708                        fn call(
5709                            &mut self,
5710                            request: tonic::Request<super::GetHeartbeatsRequest>,
5711                        ) -> Self::Future {
5712                            let inner = Arc::clone(&self.0);
5713                            let fut = async move {
5714                                <T as PoleHeartbeatGrpc>::batch_get_heartbeat(
5715                                        &inner,
5716                                        request,
5717                                    )
5718                                    .await
5719                            };
5720                            Box::pin(fut)
5721                        }
5722                    }
5723                    let accept_compression_encodings = self.accept_compression_encodings;
5724                    let send_compression_encodings = self.send_compression_encodings;
5725                    let max_decoding_message_size = self.max_decoding_message_size;
5726                    let max_encoding_message_size = self.max_encoding_message_size;
5727                    let inner = self.inner.clone();
5728                    let fut = async move {
5729                        let method = BatchGetHeartbeatSvc(inner);
5730                        let codec = tonic_prost::ProstCodec::default();
5731                        let mut grpc = tonic::server::Grpc::new(codec)
5732                            .apply_compression_config(
5733                                accept_compression_encodings,
5734                                send_compression_encodings,
5735                            )
5736                            .apply_max_message_size_config(
5737                                max_decoding_message_size,
5738                                max_encoding_message_size,
5739                            );
5740                        let res = grpc.unary(method, req).await;
5741                        Ok(res)
5742                    };
5743                    Box::pin(fut)
5744                }
5745                "/v1.PoleHeartbeatGRPC/BatchDelHeartbeat" => {
5746                    #[allow(non_camel_case_types)]
5747                    struct BatchDelHeartbeatSvc<T: PoleHeartbeatGrpc>(pub Arc<T>);
5748                    impl<
5749                        T: PoleHeartbeatGrpc,
5750                    > tonic::server::UnaryService<super::DelHeartbeatsRequest>
5751                    for BatchDelHeartbeatSvc<T> {
5752                        type Response = super::DelHeartbeatsResponse;
5753                        type Future = BoxFuture<
5754                            tonic::Response<Self::Response>,
5755                            tonic::Status,
5756                        >;
5757                        fn call(
5758                            &mut self,
5759                            request: tonic::Request<super::DelHeartbeatsRequest>,
5760                        ) -> Self::Future {
5761                            let inner = Arc::clone(&self.0);
5762                            let fut = async move {
5763                                <T as PoleHeartbeatGrpc>::batch_del_heartbeat(
5764                                        &inner,
5765                                        request,
5766                                    )
5767                                    .await
5768                            };
5769                            Box::pin(fut)
5770                        }
5771                    }
5772                    let accept_compression_encodings = self.accept_compression_encodings;
5773                    let send_compression_encodings = self.send_compression_encodings;
5774                    let max_decoding_message_size = self.max_decoding_message_size;
5775                    let max_encoding_message_size = self.max_encoding_message_size;
5776                    let inner = self.inner.clone();
5777                    let fut = async move {
5778                        let method = BatchDelHeartbeatSvc(inner);
5779                        let codec = tonic_prost::ProstCodec::default();
5780                        let mut grpc = tonic::server::Grpc::new(codec)
5781                            .apply_compression_config(
5782                                accept_compression_encodings,
5783                                send_compression_encodings,
5784                            )
5785                            .apply_max_message_size_config(
5786                                max_decoding_message_size,
5787                                max_encoding_message_size,
5788                            );
5789                        let res = grpc.unary(method, req).await;
5790                        Ok(res)
5791                    };
5792                    Box::pin(fut)
5793                }
5794                _ => {
5795                    Box::pin(async move {
5796                        let mut response = http::Response::new(
5797                            tonic::body::Body::default(),
5798                        );
5799                        let headers = response.headers_mut();
5800                        headers
5801                            .insert(
5802                                tonic::Status::GRPC_STATUS,
5803                                (tonic::Code::Unimplemented as i32).into(),
5804                            );
5805                        headers
5806                            .insert(
5807                                http::header::CONTENT_TYPE,
5808                                tonic::metadata::GRPC_CONTENT_TYPE,
5809                            );
5810                        Ok(response)
5811                    })
5812                }
5813            }
5814        }
5815    }
5816    impl<T> Clone for PoleHeartbeatGrpcServer<T> {
5817        fn clone(&self) -> Self {
5818            let inner = self.inner.clone();
5819            Self {
5820                inner,
5821                accept_compression_encodings: self.accept_compression_encodings,
5822                send_compression_encodings: self.send_compression_encodings,
5823                max_decoding_message_size: self.max_decoding_message_size,
5824                max_encoding_message_size: self.max_encoding_message_size,
5825            }
5826        }
5827    }
5828    /// Generated gRPC service name
5829    pub const SERVICE_NAME: &str = "v1.PoleHeartbeatGRPC";
5830    impl<T> tonic::server::NamedService for PoleHeartbeatGrpcServer<T> {
5831        const NAME: &'static str = SERVICE_NAME;
5832    }
5833}
5834#[derive(Clone, PartialEq, ::prost::Message)]
5835pub struct ConfigFileGroup {
5836    #[prost(string, tag = "1")]
5837    pub id: ::prost::alloc::string::String,
5838    #[prost(string, tag = "2")]
5839    pub name: ::prost::alloc::string::String,
5840    #[prost(string, tag = "3")]
5841    pub namespace: ::prost::alloc::string::String,
5842    #[prost(string, tag = "4")]
5843    pub comment: ::prost::alloc::string::String,
5844    #[prost(string, tag = "5")]
5845    pub ctime: ::prost::alloc::string::String,
5846    #[prost(string, tag = "7")]
5847    pub mtime: ::prost::alloc::string::String,
5848    #[prost(string, tag = "8")]
5849    pub business: ::prost::alloc::string::String,
5850    #[prost(string, tag = "9")]
5851    pub department: ::prost::alloc::string::String,
5852    #[prost(map = "string, string", tag = "10")]
5853    pub metadata: ::std::collections::HashMap<
5854        ::prost::alloc::string::String,
5855        ::prost::alloc::string::String,
5856    >,
5857    #[prost(uint64, tag = "11")]
5858    pub file_count: u64,
5859    /// 删除操作标志位
5860    #[prost(bool, tag = "15")]
5861    pub editable: bool,
5862    #[prost(bool, tag = "20")]
5863    pub deleteable: bool,
5864}
5865#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5866pub struct ConfigFilePersistent {
5867    #[prost(string, tag = "1")]
5868    pub encoding: ::prost::alloc::string::String,
5869    #[prost(string, tag = "2")]
5870    pub path: ::prost::alloc::string::String,
5871    #[prost(string, tag = "3")]
5872    pub post_cmd: ::prost::alloc::string::String,
5873}
5874#[derive(Clone, PartialEq, ::prost::Message)]
5875pub struct PlaceholderValue {
5876    /// 占位符名称
5877    #[prost(string, tag = "1")]
5878    pub placeholder: ::prost::alloc::string::String,
5879    /// 占位符对应的值
5880    #[prost(message, repeated, tag = "2")]
5881    pub values: ::prost::alloc::vec::Vec<MatchString>,
5882}
5883/// 配置文件模板绑定。模板模式配置文件必须显式固定一个不可变模板发布版本。
5884#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5885pub struct ConfigTemplateBinding {
5886    #[prost(uint64, tag = "1")]
5887    pub template_id: u64,
5888    #[prost(string, tag = "2")]
5889    pub template_release_id: ::prost::alloc::string::String,
5890    /// 绑定发布 ID 用于参与客户端可见组合 revision 的计算。
5891    #[prost(string, tag = "3")]
5892    pub binding_release_id: ::prost::alloc::string::String,
5893}
5894#[derive(Clone, PartialEq, ::prost::Message)]
5895pub struct ConfigFile {
5896    #[prost(string, tag = "1")]
5897    pub id: ::prost::alloc::string::String,
5898    #[prost(string, tag = "2")]
5899    pub name: ::prost::alloc::string::String,
5900    #[prost(string, tag = "3")]
5901    pub namespace: ::prost::alloc::string::String,
5902    #[prost(string, tag = "4")]
5903    pub group: ::prost::alloc::string::String,
5904    #[prost(string, tag = "5")]
5905    pub content: ::prost::alloc::string::String,
5906    #[prost(string, tag = "6")]
5907    pub format: ::prost::alloc::string::String,
5908    #[prost(string, tag = "7")]
5909    pub comment: ::prost::alloc::string::String,
5910    #[prost(string, tag = "8")]
5911    pub status: ::prost::alloc::string::String,
5912    #[prost(map = "string, string", tag = "9")]
5913    pub labels: ::std::collections::HashMap<
5914        ::prost::alloc::string::String,
5915        ::prost::alloc::string::String,
5916    >,
5917    #[prost(string, tag = "10")]
5918    pub ctime: ::prost::alloc::string::String,
5919    #[prost(string, tag = "12")]
5920    pub mtime: ::prost::alloc::string::String,
5921    #[prost(string, tag = "14")]
5922    pub rtime: ::prost::alloc::string::String,
5923    /// 是否为加密配置文件
5924    #[prost(bool, tag = "16")]
5925    pub encrypted: bool,
5926    /// 加密算法
5927    #[prost(string, tag = "17")]
5928    pub encrypt_algo: ::prost::alloc::string::String,
5929    #[prost(enumeration = "ConfigFileSupportedClient", tag = "18")]
5930    pub supported_client: i32,
5931    #[prost(message, optional, tag = "19")]
5932    pub persistent: ::core::option::Option<ConfigFilePersistent>,
5933    #[prost(enumeration = "config_file::ConfigFileType", tag = "200")]
5934    pub config_type: i32,
5935    /// Deprecated: 新模板 Value 使用 NamespaceTemplateValues 和
5936    /// NamespaceTemplateValueRelease 表达。
5937    #[prost(map = "string, message", tag = "201")]
5938    pub placeholder_value_map: ::std::collections::HashMap<
5939        ::prost::alloc::string::String,
5940        PlaceholderValue,
5941    >,
5942    #[prost(message, optional, tag = "202")]
5943    pub template_binding: ::core::option::Option<ConfigTemplateBinding>,
5944}
5945/// Nested message and enum types in `ConfigFile`.
5946pub mod config_file {
5947    /// 配置内容模式。CONFIG_FILE 表示 content 是可直接使用的普通文本;
5948    /// CONFIG_TEMPLATE 表示客户端必须使用 template_binding 和服务端下发的
5949    /// RenderSnapshot 在本地渲染。
5950    #[derive(
5951        Clone,
5952        Copy,
5953        Debug,
5954        PartialEq,
5955        Eq,
5956        Hash,
5957        PartialOrd,
5958        Ord,
5959        ::prost::Enumeration
5960    )]
5961    #[repr(i32)]
5962    pub enum ConfigFileType {
5963        /// 普通配置文件
5964        ConfigFile = 0,
5965        /// 使用模板渲染的配置文件
5966        ConfigTemplate = 1,
5967    }
5968    impl ConfigFileType {
5969        /// String value of the enum field names used in the ProtoBuf definition.
5970        ///
5971        /// The values are not transformed in any way and thus are considered stable
5972        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5973        pub fn as_str_name(&self) -> &'static str {
5974            match self {
5975                Self::ConfigFile => "CONFIG_FILE",
5976                Self::ConfigTemplate => "CONFIG_TEMPLATE",
5977            }
5978        }
5979        /// Creates an enum from field names used in the ProtoBuf definition.
5980        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5981            match value {
5982                "CONFIG_FILE" => Some(Self::ConfigFile),
5983                "CONFIG_TEMPLATE" => Some(Self::ConfigTemplate),
5984                _ => None,
5985            }
5986        }
5987    }
5988}
5989#[derive(Clone, PartialEq, ::prost::Message)]
5990pub struct ConfigFileRelease {
5991    #[prost(string, tag = "1")]
5992    pub id: ::prost::alloc::string::String,
5993    #[prost(string, tag = "2")]
5994    pub name: ::prost::alloc::string::String,
5995    #[prost(string, tag = "3")]
5996    pub namespace: ::prost::alloc::string::String,
5997    #[prost(string, tag = "4")]
5998    pub group: ::prost::alloc::string::String,
5999    #[prost(string, tag = "5")]
6000    pub file_name: ::prost::alloc::string::String,
6001    #[prost(string, tag = "6")]
6002    pub content: ::prost::alloc::string::String,
6003    #[prost(string, tag = "7")]
6004    pub comment: ::prost::alloc::string::String,
6005    #[prost(string, tag = "8")]
6006    pub md5: ::prost::alloc::string::String,
6007    #[prost(uint64, tag = "9")]
6008    pub version: u64,
6009    #[prost(string, tag = "10")]
6010    pub ctime: ::prost::alloc::string::String,
6011    #[prost(string, tag = "11")]
6012    pub create_by: ::prost::alloc::string::String,
6013    #[prost(string, tag = "12")]
6014    pub mtime: ::prost::alloc::string::String,
6015    #[prost(string, tag = "13")]
6016    pub modify_by: ::prost::alloc::string::String,
6017    #[prost(map = "string, string", tag = "14")]
6018    pub labels: ::std::collections::HashMap<
6019        ::prost::alloc::string::String,
6020        ::prost::alloc::string::String,
6021    >,
6022    /// 当前生效配置
6023    #[prost(bool, tag = "15")]
6024    pub active: bool,
6025    #[prost(string, tag = "16")]
6026    pub format: ::prost::alloc::string::String,
6027    #[prost(string, tag = "17")]
6028    pub release_description: ::prost::alloc::string::String,
6029    #[prost(string, tag = "18")]
6030    pub release_type: ::prost::alloc::string::String,
6031    /// 配置灰度发布时需要匹配的客户端标签信息
6032    #[prost(message, repeated, tag = "19")]
6033    pub beta_labels: ::prost::alloc::vec::Vec<ClientLabel>,
6034    #[prost(enumeration = "ConfigFileSupportedClient", tag = "21")]
6035    pub supported_client: i32,
6036    #[prost(message, optional, tag = "22")]
6037    pub persistent: ::core::option::Option<ConfigFilePersistent>,
6038    /// 是否为加密配置文件
6039    #[prost(bool, tag = "23")]
6040    pub encrypted: bool,
6041    /// 加密算法
6042    #[prost(string, tag = "24")]
6043    pub encrypt_algo: ::prost::alloc::string::String,
6044    #[prost(enumeration = "config_file_release::ConfigFileType", tag = "200")]
6045    pub config_type: i32,
6046    /// Deprecated: 使用 template_binding 和独立 Value Release。
6047    #[prost(map = "string, message", tag = "201")]
6048    pub placeholder_value_map: ::std::collections::HashMap<
6049        ::prost::alloc::string::String,
6050        PlaceholderValue,
6051    >,
6052    #[prost(message, optional, tag = "202")]
6053    pub template_binding: ::core::option::Option<ConfigTemplateBinding>,
6054}
6055/// Nested message and enum types in `ConfigFileRelease`.
6056pub mod config_file_release {
6057    /// 配置内容模式,语义与 ConfigFile.config_type 一致。
6058    #[derive(
6059        Clone,
6060        Copy,
6061        Debug,
6062        PartialEq,
6063        Eq,
6064        Hash,
6065        PartialOrd,
6066        Ord,
6067        ::prost::Enumeration
6068    )]
6069    #[repr(i32)]
6070    pub enum ConfigFileType {
6071        /// 普通配置文件
6072        ConfigFile = 0,
6073        /// 使用模板渲染的配置文件
6074        ConfigTemplate = 1,
6075    }
6076    impl ConfigFileType {
6077        /// String value of the enum field names used in the ProtoBuf definition.
6078        ///
6079        /// The values are not transformed in any way and thus are considered stable
6080        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6081        pub fn as_str_name(&self) -> &'static str {
6082            match self {
6083                Self::ConfigFile => "CONFIG_FILE",
6084                Self::ConfigTemplate => "CONFIG_TEMPLATE",
6085            }
6086        }
6087        /// Creates an enum from field names used in the ProtoBuf definition.
6088        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6089            match value {
6090                "CONFIG_FILE" => Some(Self::ConfigFile),
6091                "CONFIG_TEMPLATE" => Some(Self::ConfigTemplate),
6092                _ => None,
6093            }
6094        }
6095    }
6096}
6097#[derive(Clone, PartialEq, ::prost::Message)]
6098pub struct ConfigFileReleaseHistory {
6099    #[prost(string, tag = "1")]
6100    pub id: ::prost::alloc::string::String,
6101    #[prost(string, tag = "2")]
6102    pub name: ::prost::alloc::string::String,
6103    #[prost(string, tag = "3")]
6104    pub namespace: ::prost::alloc::string::String,
6105    #[prost(string, tag = "4")]
6106    pub group: ::prost::alloc::string::String,
6107    #[prost(string, tag = "5")]
6108    pub file_name: ::prost::alloc::string::String,
6109    #[prost(string, tag = "6")]
6110    pub content: ::prost::alloc::string::String,
6111    #[prost(string, tag = "7")]
6112    pub format: ::prost::alloc::string::String,
6113    #[prost(string, tag = "8")]
6114    pub comment: ::prost::alloc::string::String,
6115    #[prost(string, tag = "9")]
6116    pub md5: ::prost::alloc::string::String,
6117    #[prost(string, tag = "10")]
6118    pub r#type: ::prost::alloc::string::String,
6119    #[prost(string, tag = "11")]
6120    pub status: ::prost::alloc::string::String,
6121    #[prost(map = "string, string", tag = "12")]
6122    pub labels: ::std::collections::HashMap<
6123        ::prost::alloc::string::String,
6124        ::prost::alloc::string::String,
6125    >,
6126    #[prost(string, tag = "13")]
6127    pub ctime: ::prost::alloc::string::String,
6128    #[prost(string, tag = "14")]
6129    pub create_by: ::prost::alloc::string::String,
6130    #[prost(string, tag = "15")]
6131    pub mtime: ::prost::alloc::string::String,
6132    #[prost(string, tag = "16")]
6133    pub modify_by: ::prost::alloc::string::String,
6134    /// 配置发布失败的原因
6135    #[prost(string, tag = "17")]
6136    pub reason: ::prost::alloc::string::String,
6137    #[prost(string, tag = "18")]
6138    pub release_description: ::prost::alloc::string::String,
6139    #[prost(enumeration = "config_file_release_history::ConfigFileType", tag = "200")]
6140    pub config_type: i32,
6141    /// Deprecated: 使用 template_binding 和独立 Value Release。
6142    #[prost(map = "string, message", tag = "201")]
6143    pub placeholder_value_map: ::std::collections::HashMap<
6144        ::prost::alloc::string::String,
6145        PlaceholderValue,
6146    >,
6147    #[prost(message, optional, tag = "202")]
6148    pub template_binding: ::core::option::Option<ConfigTemplateBinding>,
6149}
6150/// Nested message and enum types in `ConfigFileReleaseHistory`.
6151pub mod config_file_release_history {
6152    /// 配置内容模式,语义与 ConfigFile.config_type 一致。
6153    #[derive(
6154        Clone,
6155        Copy,
6156        Debug,
6157        PartialEq,
6158        Eq,
6159        Hash,
6160        PartialOrd,
6161        Ord,
6162        ::prost::Enumeration
6163    )]
6164    #[repr(i32)]
6165    pub enum ConfigFileType {
6166        /// 普通配置文件
6167        ConfigFile = 0,
6168        /// 使用模板渲染的配置文件
6169        ConfigTemplate = 1,
6170    }
6171    impl ConfigFileType {
6172        /// String value of the enum field names used in the ProtoBuf definition.
6173        ///
6174        /// The values are not transformed in any way and thus are considered stable
6175        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6176        pub fn as_str_name(&self) -> &'static str {
6177            match self {
6178                Self::ConfigFile => "CONFIG_FILE",
6179                Self::ConfigTemplate => "CONFIG_TEMPLATE",
6180            }
6181        }
6182        /// Creates an enum from field names used in the ProtoBuf definition.
6183        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6184            match value {
6185                "CONFIG_FILE" => Some(Self::ConfigFile),
6186                "CONFIG_TEMPLATE" => Some(Self::ConfigTemplate),
6187                _ => None,
6188            }
6189        }
6190    }
6191}
6192/// pole-mustache 模板引擎及其语法版本。
6193#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6194pub struct ConfigTemplateEngine {
6195    #[prost(string, tag = "1")]
6196    pub name: ::prost::alloc::string::String,
6197    #[prost(string, tag = "2")]
6198    pub version: ::prost::alloc::string::String,
6199}
6200/// 跨语言确定性渲染支持的标量 Value。
6201#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6202pub struct ConfigTemplateValue {
6203    #[prost(oneof = "config_template_value::Value", tags = "1, 2, 3, 4")]
6204    pub value: ::core::option::Option<config_template_value::Value>,
6205}
6206/// Nested message and enum types in `ConfigTemplateValue`.
6207pub mod config_template_value {
6208    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
6209    pub enum Value {
6210        #[prost(string, tag = "1")]
6211        StringValue(::prost::alloc::string::String),
6212        #[prost(bool, tag = "2")]
6213        BooleanValue(bool),
6214        #[prost(int64, tag = "3")]
6215        IntegerValue(i64),
6216        #[prost(string, tag = "4")]
6217        DecimalValue(::prost::alloc::string::String),
6218    }
6219}
6220#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6221pub struct ConfigTemplateParameterSchema {
6222    /// dotted name,例如 database.host。
6223    #[prost(string, tag = "1")]
6224    pub name: ::prost::alloc::string::String,
6225    #[prost(enumeration = "ConfigTemplateParameterType", tag = "2")]
6226    pub r#type: i32,
6227    #[prost(bool, tag = "3")]
6228    pub required: bool,
6229    #[prost(message, optional, tag = "4")]
6230    pub default_value: ::core::option::Option<ConfigTemplateValue>,
6231    #[prost(bool, tag = "5")]
6232    pub sensitive: bool,
6233    #[prost(string, tag = "6")]
6234    pub comment: ::prost::alloc::string::String,
6235}
6236#[derive(Clone, PartialEq, ::prost::Message)]
6237pub struct ConfigFileTemplate {
6238    #[prost(uint64, tag = "1")]
6239    pub id: u64,
6240    #[prost(string, tag = "2")]
6241    pub name: ::prost::alloc::string::String,
6242    #[prost(string, tag = "3")]
6243    pub content: ::prost::alloc::string::String,
6244    #[prost(string, tag = "4")]
6245    pub format: ::prost::alloc::string::String,
6246    #[prost(string, tag = "5")]
6247    pub comment: ::prost::alloc::string::String,
6248    #[prost(string, tag = "6")]
6249    pub ctime: ::prost::alloc::string::String,
6250    #[prost(string, tag = "8")]
6251    pub mtime: ::prost::alloc::string::String,
6252    #[prost(message, optional, tag = "9")]
6253    pub engine: ::core::option::Option<ConfigTemplateEngine>,
6254    #[prost(message, repeated, tag = "10")]
6255    pub parameter_schema: ::prost::alloc::vec::Vec<ConfigTemplateParameterSchema>,
6256    #[prost(string, tag = "11")]
6257    pub revision: ::prost::alloc::string::String,
6258}
6259/// 全局模板的不可变发布快照。
6260#[derive(Clone, PartialEq, ::prost::Message)]
6261pub struct ConfigTemplateRelease {
6262    #[prost(string, tag = "1")]
6263    pub id: ::prost::alloc::string::String,
6264    #[prost(uint64, tag = "2")]
6265    pub template_id: u64,
6266    #[prost(string, tag = "3")]
6267    pub name: ::prost::alloc::string::String,
6268    #[prost(string, tag = "4")]
6269    pub content: ::prost::alloc::string::String,
6270    #[prost(string, tag = "5")]
6271    pub format: ::prost::alloc::string::String,
6272    #[prost(message, optional, tag = "6")]
6273    pub engine: ::core::option::Option<ConfigTemplateEngine>,
6274    #[prost(message, repeated, tag = "7")]
6275    pub parameter_schema: ::prost::alloc::vec::Vec<ConfigTemplateParameterSchema>,
6276    #[prost(uint64, tag = "8")]
6277    pub version: u64,
6278    #[prost(string, tag = "9")]
6279    pub content_sha256: ::prost::alloc::string::String,
6280    #[prost(string, tag = "10")]
6281    pub comment: ::prost::alloc::string::String,
6282    #[prost(string, tag = "11")]
6283    pub ctime: ::prost::alloc::string::String,
6284    #[prost(string, tag = "12")]
6285    pub create_by: ::prost::alloc::string::String,
6286}
6287/// Namespace + Template 唯一定位的 Value 草稿聚合。
6288#[derive(Clone, PartialEq, ::prost::Message)]
6289pub struct NamespaceTemplateValues {
6290    #[prost(string, tag = "1")]
6291    pub id: ::prost::alloc::string::String,
6292    #[prost(string, tag = "2")]
6293    pub namespace: ::prost::alloc::string::String,
6294    #[prost(uint64, tag = "3")]
6295    pub template_id: u64,
6296    #[prost(map = "string, message", tag = "4")]
6297    pub values: ::std::collections::HashMap<
6298        ::prost::alloc::string::String,
6299        ConfigTemplateValue,
6300    >,
6301    #[prost(string, tag = "5")]
6302    pub revision: ::prost::alloc::string::String,
6303    #[prost(string, tag = "6")]
6304    pub ctime: ::prost::alloc::string::String,
6305    #[prost(string, tag = "7")]
6306    pub mtime: ::prost::alloc::string::String,
6307    #[prost(string, tag = "8")]
6308    pub modify_by: ::prost::alloc::string::String,
6309}
6310/// Value 的不可变发布快照。灰度规则只由服务端解释,SDK 只接收命中的发布。
6311#[derive(Clone, PartialEq, ::prost::Message)]
6312pub struct NamespaceTemplateValueRelease {
6313    #[prost(string, tag = "1")]
6314    pub id: ::prost::alloc::string::String,
6315    #[prost(string, tag = "2")]
6316    pub values_id: ::prost::alloc::string::String,
6317    #[prost(string, tag = "3")]
6318    pub namespace: ::prost::alloc::string::String,
6319    #[prost(uint64, tag = "4")]
6320    pub template_id: u64,
6321    #[prost(string, tag = "5")]
6322    pub template_release_id: ::prost::alloc::string::String,
6323    #[prost(map = "string, message", tag = "6")]
6324    pub values: ::std::collections::HashMap<
6325        ::prost::alloc::string::String,
6326        ConfigTemplateValue,
6327    >,
6328    #[prost(enumeration = "NamespaceTemplateValueReleaseType", tag = "7")]
6329    pub release_type: i32,
6330    #[prost(message, repeated, tag = "8")]
6331    pub beta_labels: ::prost::alloc::vec::Vec<ClientLabel>,
6332    #[prost(uint32, tag = "9")]
6333    pub priority: u32,
6334    #[prost(bool, tag = "10")]
6335    pub active: bool,
6336    #[prost(uint64, tag = "11")]
6337    pub version: u64,
6338    #[prost(string, tag = "12")]
6339    pub revision: ::prost::alloc::string::String,
6340    #[prost(string, tag = "13")]
6341    pub comment: ::prost::alloc::string::String,
6342    #[prost(string, tag = "14")]
6343    pub ctime: ::prost::alloc::string::String,
6344    #[prost(string, tag = "15")]
6345    pub create_by: ::prost::alloc::string::String,
6346}
6347/// 服务端按客户端标签选择 Value Release 后返回的原子渲染快照。
6348/// rendered content 必须由 SDK 本地生成,服务端预览结果不是运行时权威内容。
6349#[derive(Clone, PartialEq, ::prost::Message)]
6350pub struct RenderSnapshot {
6351    #[prost(message, optional, tag = "1")]
6352    pub template_binding: ::core::option::Option<ConfigTemplateBinding>,
6353    #[prost(message, optional, tag = "2")]
6354    pub template_release: ::core::option::Option<ConfigTemplateRelease>,
6355    #[prost(message, optional, tag = "3")]
6356    pub value_release: ::core::option::Option<NamespaceTemplateValueRelease>,
6357    #[prost(string, tag = "4")]
6358    pub revision: ::prost::alloc::string::String,
6359    #[prost(string, tag = "5")]
6360    pub expected_rendered_sha256: ::prost::alloc::string::String,
6361}
6362/// 可直接承载未发布草稿的参考渲染输入。
6363#[derive(Clone, PartialEq, ::prost::Message)]
6364pub struct ConfigTemplateRenderInput {
6365    #[prost(string, tag = "1")]
6366    pub content: ::prost::alloc::string::String,
6367    #[prost(string, tag = "2")]
6368    pub format: ::prost::alloc::string::String,
6369    #[prost(message, optional, tag = "3")]
6370    pub engine: ::core::option::Option<ConfigTemplateEngine>,
6371    #[prost(message, repeated, tag = "4")]
6372    pub parameter_schema: ::prost::alloc::vec::Vec<ConfigTemplateParameterSchema>,
6373    #[prost(map = "string, message", tag = "5")]
6374    pub values: ::std::collections::HashMap<
6375        ::prost::alloc::string::String,
6376        ConfigTemplateValue,
6377    >,
6378}
6379#[derive(Clone, PartialEq, ::prost::Message)]
6380pub struct RenderPreviewRequest {
6381    #[prost(message, optional, tag = "1")]
6382    pub input: ::core::option::Option<ConfigTemplateRenderInput>,
6383    /// 可选,仅用于已发布组合的审计和缓存键;草稿预览时为空。
6384    #[prost(string, tag = "2")]
6385    pub template_release_id: ::prost::alloc::string::String,
6386    #[prost(string, tag = "3")]
6387    pub value_release_id: ::prost::alloc::string::String,
6388}
6389#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6390pub struct RenderDiagnostic {
6391    #[prost(enumeration = "render_diagnostic::Severity", tag = "1")]
6392    pub severity: i32,
6393    #[prost(string, tag = "2")]
6394    pub code: ::prost::alloc::string::String,
6395    #[prost(string, tag = "3")]
6396    pub message: ::prost::alloc::string::String,
6397    #[prost(string, tag = "4")]
6398    pub parameter: ::prost::alloc::string::String,
6399}
6400/// Nested message and enum types in `RenderDiagnostic`.
6401pub mod render_diagnostic {
6402    #[derive(
6403        Clone,
6404        Copy,
6405        Debug,
6406        PartialEq,
6407        Eq,
6408        Hash,
6409        PartialOrd,
6410        Ord,
6411        ::prost::Enumeration
6412    )]
6413    #[repr(i32)]
6414    pub enum Severity {
6415        DiagnosticInfo = 0,
6416        DiagnosticWarning = 1,
6417        DiagnosticError = 2,
6418    }
6419    impl Severity {
6420        /// String value of the enum field names used in the ProtoBuf definition.
6421        ///
6422        /// The values are not transformed in any way and thus are considered stable
6423        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6424        pub fn as_str_name(&self) -> &'static str {
6425            match self {
6426                Self::DiagnosticInfo => "DIAGNOSTIC_INFO",
6427                Self::DiagnosticWarning => "DIAGNOSTIC_WARNING",
6428                Self::DiagnosticError => "DIAGNOSTIC_ERROR",
6429            }
6430        }
6431        /// Creates an enum from field names used in the ProtoBuf definition.
6432        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6433            match value {
6434                "DIAGNOSTIC_INFO" => Some(Self::DiagnosticInfo),
6435                "DIAGNOSTIC_WARNING" => Some(Self::DiagnosticWarning),
6436                "DIAGNOSTIC_ERROR" => Some(Self::DiagnosticError),
6437                _ => None,
6438            }
6439        }
6440    }
6441}
6442/// 服务端参考渲染,仅用于预览、校验和跨语言哈希对照。
6443#[derive(Clone, PartialEq, ::prost::Message)]
6444pub struct RenderPreview {
6445    #[prost(string, tag = "1")]
6446    pub rendered_content: ::prost::alloc::string::String,
6447    #[prost(string, tag = "2")]
6448    pub format: ::prost::alloc::string::String,
6449    #[prost(string, tag = "3")]
6450    pub template_release_id: ::prost::alloc::string::String,
6451    #[prost(string, tag = "4")]
6452    pub value_release_id: ::prost::alloc::string::String,
6453    #[prost(message, optional, tag = "5")]
6454    pub engine: ::core::option::Option<ConfigTemplateEngine>,
6455    #[prost(string, tag = "6")]
6456    pub rendered_sha256: ::prost::alloc::string::String,
6457    #[prost(message, repeated, tag = "7")]
6458    pub diagnostics: ::prost::alloc::vec::Vec<RenderDiagnostic>,
6459    #[prost(bool, tag = "8")]
6460    pub valid: bool,
6461    /// 统一 API 结果码。模板诊断只描述渲染内容,不承载鉴权、参数或系统错误。
6462    #[prost(uint32, tag = "9")]
6463    pub code: u32,
6464    #[prost(string, tag = "10")]
6465    pub info: ::prost::alloc::string::String,
6466}
6467#[derive(Clone, PartialEq, ::prost::Message)]
6468pub struct WatchConfigFileRequest {
6469    #[prost(string, tag = "1")]
6470    pub client_ip: ::prost::alloc::string::String,
6471    #[prost(string, tag = "2")]
6472    pub service_name: ::prost::alloc::string::String,
6473    #[prost(message, repeated, tag = "3")]
6474    pub files: ::prost::alloc::vec::Vec<ConfigFileRelease>,
6475    #[prost(enumeration = "ConfigClientType", tag = "4")]
6476    pub client_type: i32,
6477}
6478#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6479pub struct ConfigFileExportRequest {
6480    #[prost(string, tag = "1")]
6481    pub namespace: ::prost::alloc::string::String,
6482    #[prost(string, repeated, tag = "2")]
6483    pub groups: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6484    #[prost(string, repeated, tag = "3")]
6485    pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6486    #[prost(uint64, repeated, tag = "4")]
6487    pub ids: ::prost::alloc::vec::Vec<u64>,
6488}
6489#[derive(Clone, PartialEq, ::prost::Message)]
6490pub struct ConfigFilePublishInfo {
6491    #[prost(string, tag = "1")]
6492    pub release_name: ::prost::alloc::string::String,
6493    #[prost(string, tag = "2")]
6494    pub namespace: ::prost::alloc::string::String,
6495    #[prost(string, tag = "3")]
6496    pub group: ::prost::alloc::string::String,
6497    #[prost(string, tag = "4")]
6498    pub file_name: ::prost::alloc::string::String,
6499    #[prost(string, tag = "5")]
6500    pub content: ::prost::alloc::string::String,
6501    #[prost(string, tag = "6")]
6502    pub comment: ::prost::alloc::string::String,
6503    #[prost(string, tag = "7")]
6504    pub format: ::prost::alloc::string::String,
6505    #[prost(string, tag = "8")]
6506    pub release_description: ::prost::alloc::string::String,
6507    #[prost(map = "string, string", tag = "14")]
6508    pub labels: ::std::collections::HashMap<
6509        ::prost::alloc::string::String,
6510        ::prost::alloc::string::String,
6511    >,
6512    #[prost(string, tag = "15")]
6513    pub md5: ::prost::alloc::string::String,
6514    /// 是否为加密配置文件
6515    #[prost(bool, tag = "16")]
6516    pub encrypted: bool,
6517    /// 加密算法
6518    #[prost(string, tag = "17")]
6519    pub encrypt_algo: ::prost::alloc::string::String,
6520    #[prost(message, optional, tag = "19")]
6521    pub persistent: ::core::option::Option<ConfigFilePersistent>,
6522    #[prost(enumeration = "config_file_publish_info::ConfigFileType", tag = "200")]
6523    pub config_type: i32,
6524    /// Deprecated: 使用 template_binding 和独立 Value Release。
6525    #[prost(map = "string, message", tag = "201")]
6526    pub placeholder_value_map: ::std::collections::HashMap<
6527        ::prost::alloc::string::String,
6528        PlaceholderValue,
6529    >,
6530    #[prost(message, optional, tag = "202")]
6531    pub template_binding: ::core::option::Option<ConfigTemplateBinding>,
6532}
6533/// Nested message and enum types in `ConfigFilePublishInfo`.
6534pub mod config_file_publish_info {
6535    /// 配置内容模式,语义与 ConfigFile.config_type 一致。
6536    #[derive(
6537        Clone,
6538        Copy,
6539        Debug,
6540        PartialEq,
6541        Eq,
6542        Hash,
6543        PartialOrd,
6544        Ord,
6545        ::prost::Enumeration
6546    )]
6547    #[repr(i32)]
6548    pub enum ConfigFileType {
6549        /// 普通配置文件
6550        ConfigFile = 0,
6551        /// 使用模板渲染的配置文件
6552        ConfigTemplate = 1,
6553    }
6554    impl ConfigFileType {
6555        /// String value of the enum field names used in the ProtoBuf definition.
6556        ///
6557        /// The values are not transformed in any way and thus are considered stable
6558        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6559        pub fn as_str_name(&self) -> &'static str {
6560            match self {
6561                Self::ConfigFile => "CONFIG_FILE",
6562                Self::ConfigTemplate => "CONFIG_TEMPLATE",
6563            }
6564        }
6565        /// Creates an enum from field names used in the ProtoBuf definition.
6566        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6567            match value {
6568                "CONFIG_FILE" => Some(Self::ConfigFile),
6569                "CONFIG_TEMPLATE" => Some(Self::ConfigTemplate),
6570                _ => None,
6571            }
6572        }
6573    }
6574}
6575#[derive(Clone, PartialEq, ::prost::Message)]
6576pub struct ConfigFileGroupRequest {
6577    #[prost(string, tag = "1")]
6578    pub revision: ::prost::alloc::string::String,
6579    #[prost(message, optional, tag = "2")]
6580    pub config_file_group: ::core::option::Option<ConfigFileGroup>,
6581    /// 配置标签
6582    #[prost(map = "string, string", tag = "12")]
6583    pub client_labels: ::std::collections::HashMap<
6584        ::prost::alloc::string::String,
6585        ::prost::alloc::string::String,
6586    >,
6587    #[prost(enumeration = "ConfigClientType", tag = "13")]
6588    pub client_type: i32,
6589}
6590#[derive(Clone, PartialEq, ::prost::Message)]
6591pub struct ConfigDiscoverFilter {
6592    /// pole.io 自定义信息
6593    #[prost(message, optional, tag = "1")]
6594    pub caller: ::core::option::Option<Caller>,
6595    /// 客户端公钥,用于加密返回的配置 encrypted_key 字段
6596    #[prost(string, tag = "2")]
6597    pub public_key: ::prost::alloc::string::String,
6598    /// 客户端声明可执行的模板引擎版本;模板配置不允许静默降级为原始文本。
6599    #[prost(message, repeated, tag = "3")]
6600    pub supported_template_engines: ::prost::alloc::vec::Vec<ConfigTemplateEngine>,
6601}
6602#[derive(Clone, PartialEq, ::prost::Message)]
6603pub struct ConfigDiscoverRequest {
6604    #[prost(
6605        enumeration = "config_discover_request::ConfigDiscoverRequestType",
6606        tag = "1"
6607    )]
6608    pub r#type: i32,
6609    #[prost(message, optional, tag = "2")]
6610    pub file: ::core::option::Option<ConfigFile>,
6611    #[prost(string, tag = "3")]
6612    pub revision: ::prost::alloc::string::String,
6613    /// pole.io 自定义信息
6614    #[prost(message, optional, tag = "500")]
6615    pub filter: ::core::option::Option<ConfigDiscoverFilter>,
6616}
6617/// Nested message and enum types in `ConfigDiscoverRequest`.
6618pub mod config_discover_request {
6619    #[derive(
6620        Clone,
6621        Copy,
6622        Debug,
6623        PartialEq,
6624        Eq,
6625        Hash,
6626        PartialOrd,
6627        Ord,
6628        ::prost::Enumeration
6629    )]
6630    #[repr(i32)]
6631    pub enum ConfigDiscoverRequestType {
6632        Unknown = 0,
6633        ConfigFile = 1,
6634        ConfigFileNames = 2,
6635        ConfigFileGroups = 3,
6636    }
6637    impl ConfigDiscoverRequestType {
6638        /// String value of the enum field names used in the ProtoBuf definition.
6639        ///
6640        /// The values are not transformed in any way and thus are considered stable
6641        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6642        pub fn as_str_name(&self) -> &'static str {
6643            match self {
6644                Self::Unknown => "UNKNOWN",
6645                Self::ConfigFile => "CONFIG_FILE",
6646                Self::ConfigFileNames => "CONFIG_FILE_NAMES",
6647                Self::ConfigFileGroups => "CONFIG_FILE_GROUPS",
6648            }
6649        }
6650        /// Creates an enum from field names used in the ProtoBuf definition.
6651        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6652            match value {
6653                "UNKNOWN" => Some(Self::Unknown),
6654                "CONFIG_FILE" => Some(Self::ConfigFile),
6655                "CONFIG_FILE_NAMES" => Some(Self::ConfigFileNames),
6656                "CONFIG_FILE_GROUPS" => Some(Self::ConfigFileGroups),
6657                _ => None,
6658            }
6659        }
6660    }
6661}
6662#[derive(Clone, PartialEq, ::prost::Message)]
6663pub struct ConfigDiscoverResponse {
6664    #[prost(uint32, tag = "1")]
6665    pub code: u32,
6666    #[prost(string, tag = "2")]
6667    pub info: ::prost::alloc::string::String,
6668    #[prost(string, tag = "3")]
6669    pub revision: ::prost::alloc::string::String,
6670    #[prost(
6671        enumeration = "config_discover_response::ConfigDiscoverResponseType",
6672        tag = "4"
6673    )]
6674    pub r#type: i32,
6675    #[prost(message, optional, tag = "5")]
6676    pub file: ::core::option::Option<ConfigFileRelease>,
6677    #[prost(message, repeated, tag = "6")]
6678    pub file_names: ::prost::alloc::vec::Vec<ConfigFileRelease>,
6679    #[prost(message, repeated, tag = "7")]
6680    pub file_groups: ::prost::alloc::vec::Vec<ConfigFileGroup>,
6681    /// 仅模板模式返回。服务端已按 filter.caller 的客户端标签匹配唯一 Value Release。
6682    #[prost(message, optional, tag = "8")]
6683    pub render_snapshot: ::core::option::Option<RenderSnapshot>,
6684}
6685/// Nested message and enum types in `ConfigDiscoverResponse`.
6686pub mod config_discover_response {
6687    #[derive(
6688        Clone,
6689        Copy,
6690        Debug,
6691        PartialEq,
6692        Eq,
6693        Hash,
6694        PartialOrd,
6695        Ord,
6696        ::prost::Enumeration
6697    )]
6698    #[repr(i32)]
6699    pub enum ConfigDiscoverResponseType {
6700        Unknown = 0,
6701        ConfigFile = 1,
6702        ConfigFileNames = 2,
6703        ConfigFileGroups = 3,
6704    }
6705    impl ConfigDiscoverResponseType {
6706        /// String value of the enum field names used in the ProtoBuf definition.
6707        ///
6708        /// The values are not transformed in any way and thus are considered stable
6709        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6710        pub fn as_str_name(&self) -> &'static str {
6711            match self {
6712                Self::Unknown => "UNKNOWN",
6713                Self::ConfigFile => "CONFIG_FILE",
6714                Self::ConfigFileNames => "CONFIG_FILE_NAMES",
6715                Self::ConfigFileGroups => "CONFIG_FILE_GROUPS",
6716            }
6717        }
6718        /// Creates an enum from field names used in the ProtoBuf definition.
6719        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6720            match value {
6721                "UNKNOWN" => Some(Self::Unknown),
6722                "CONFIG_FILE" => Some(Self::ConfigFile),
6723                "CONFIG_FILE_NAMES" => Some(Self::ConfigFileNames),
6724                "CONFIG_FILE_GROUPS" => Some(Self::ConfigFileGroups),
6725                _ => None,
6726            }
6727        }
6728    }
6729}
6730#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
6731#[repr(i32)]
6732pub enum ConfigFileSupportedClient {
6733    /// 配置文件仅能被SDK拉取
6734    ClientSdk = 0,
6735    /// 配置文件仅能被Agent拉取
6736    ClientAgent = 1,
6737    /// 配置文件可以被SDK及Agent同时拉取
6738    ClientAll = 2,
6739}
6740impl ConfigFileSupportedClient {
6741    /// String value of the enum field names used in the ProtoBuf definition.
6742    ///
6743    /// The values are not transformed in any way and thus are considered stable
6744    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6745    pub fn as_str_name(&self) -> &'static str {
6746        match self {
6747            Self::ClientSdk => "CLIENT_SDK",
6748            Self::ClientAgent => "CLIENT_AGENT",
6749            Self::ClientAll => "CLIENT_ALL",
6750        }
6751    }
6752    /// Creates an enum from field names used in the ProtoBuf definition.
6753    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6754        match value {
6755            "CLIENT_SDK" => Some(Self::ClientSdk),
6756            "CLIENT_AGENT" => Some(Self::ClientAgent),
6757            "CLIENT_ALL" => Some(Self::ClientAll),
6758            _ => None,
6759        }
6760    }
6761}
6762#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
6763#[repr(i32)]
6764pub enum ConfigTemplateParameterType {
6765    TemplateParameterTypeUnspecified = 0,
6766    TemplateParameterString = 1,
6767    TemplateParameterBoolean = 2,
6768    TemplateParameterInteger = 3,
6769    /// decimal 通过规范化十进制字符串传输,禁止科学计数法。
6770    TemplateParameterDecimal = 4,
6771}
6772impl ConfigTemplateParameterType {
6773    /// String value of the enum field names used in the ProtoBuf definition.
6774    ///
6775    /// The values are not transformed in any way and thus are considered stable
6776    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6777    pub fn as_str_name(&self) -> &'static str {
6778        match self {
6779            Self::TemplateParameterTypeUnspecified => {
6780                "TEMPLATE_PARAMETER_TYPE_UNSPECIFIED"
6781            }
6782            Self::TemplateParameterString => "TEMPLATE_PARAMETER_STRING",
6783            Self::TemplateParameterBoolean => "TEMPLATE_PARAMETER_BOOLEAN",
6784            Self::TemplateParameterInteger => "TEMPLATE_PARAMETER_INTEGER",
6785            Self::TemplateParameterDecimal => "TEMPLATE_PARAMETER_DECIMAL",
6786        }
6787    }
6788    /// Creates an enum from field names used in the ProtoBuf definition.
6789    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6790        match value {
6791            "TEMPLATE_PARAMETER_TYPE_UNSPECIFIED" => {
6792                Some(Self::TemplateParameterTypeUnspecified)
6793            }
6794            "TEMPLATE_PARAMETER_STRING" => Some(Self::TemplateParameterString),
6795            "TEMPLATE_PARAMETER_BOOLEAN" => Some(Self::TemplateParameterBoolean),
6796            "TEMPLATE_PARAMETER_INTEGER" => Some(Self::TemplateParameterInteger),
6797            "TEMPLATE_PARAMETER_DECIMAL" => Some(Self::TemplateParameterDecimal),
6798            _ => None,
6799        }
6800    }
6801}
6802#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
6803#[repr(i32)]
6804pub enum NamespaceTemplateValueReleaseType {
6805    TemplateValueReleaseNormal = 0,
6806    TemplateValueReleaseGray = 1,
6807}
6808impl NamespaceTemplateValueReleaseType {
6809    /// String value of the enum field names used in the ProtoBuf definition.
6810    ///
6811    /// The values are not transformed in any way and thus are considered stable
6812    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6813    pub fn as_str_name(&self) -> &'static str {
6814        match self {
6815            Self::TemplateValueReleaseNormal => "TEMPLATE_VALUE_RELEASE_NORMAL",
6816            Self::TemplateValueReleaseGray => "TEMPLATE_VALUE_RELEASE_GRAY",
6817        }
6818    }
6819    /// Creates an enum from field names used in the ProtoBuf definition.
6820    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6821        match value {
6822            "TEMPLATE_VALUE_RELEASE_NORMAL" => Some(Self::TemplateValueReleaseNormal),
6823            "TEMPLATE_VALUE_RELEASE_GRAY" => Some(Self::TemplateValueReleaseGray),
6824            _ => None,
6825        }
6826    }
6827}
6828#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
6829#[repr(i32)]
6830pub enum ConfigClientType {
6831    Sdk = 0,
6832    Agent = 1,
6833}
6834impl ConfigClientType {
6835    /// String value of the enum field names used in the ProtoBuf definition.
6836    ///
6837    /// The values are not transformed in any way and thus are considered stable
6838    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6839    pub fn as_str_name(&self) -> &'static str {
6840        match self {
6841            Self::Sdk => "SDK",
6842            Self::Agent => "Agent",
6843        }
6844    }
6845    /// Creates an enum from field names used in the ProtoBuf definition.
6846    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6847        match value {
6848            "SDK" => Some(Self::Sdk),
6849            "Agent" => Some(Self::Agent),
6850            _ => None,
6851        }
6852    }
6853}
6854/// Generated client implementations.
6855pub mod config_grpc_client {
6856    #![allow(
6857        unused_variables,
6858        dead_code,
6859        missing_docs,
6860        clippy::wildcard_imports,
6861        clippy::let_unit_value,
6862    )]
6863    use tonic::codegen::*;
6864    use tonic::codegen::http::Uri;
6865    #[derive(Debug, Clone)]
6866    pub struct ConfigGrpcClient<T> {
6867        inner: tonic::client::Grpc<T>,
6868    }
6869    impl ConfigGrpcClient<tonic::transport::Channel> {
6870        /// Attempt to create a new client by connecting to a given endpoint.
6871        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6872        where
6873            D: TryInto<tonic::transport::Endpoint>,
6874            D::Error: Into<StdError>,
6875        {
6876            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6877            Ok(Self::new(conn))
6878        }
6879    }
6880    impl<T> ConfigGrpcClient<T>
6881    where
6882        T: tonic::client::GrpcService<tonic::body::Body>,
6883        T::Error: Into<StdError>,
6884        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6885        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6886    {
6887        pub fn new(inner: T) -> Self {
6888            let inner = tonic::client::Grpc::new(inner);
6889            Self { inner }
6890        }
6891        pub fn with_origin(inner: T, origin: Uri) -> Self {
6892            let inner = tonic::client::Grpc::with_origin(inner, origin);
6893            Self { inner }
6894        }
6895        pub fn with_interceptor<F>(
6896            inner: T,
6897            interceptor: F,
6898        ) -> ConfigGrpcClient<InterceptedService<T, F>>
6899        where
6900            F: tonic::service::Interceptor,
6901            T::ResponseBody: Default,
6902            T: tonic::codegen::Service<
6903                http::Request<tonic::body::Body>,
6904                Response = http::Response<
6905                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6906                >,
6907            >,
6908            <T as tonic::codegen::Service<
6909                http::Request<tonic::body::Body>,
6910            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6911        {
6912            ConfigGrpcClient::new(InterceptedService::new(inner, interceptor))
6913        }
6914        /// Compress requests with the given encoding.
6915        ///
6916        /// This requires the server to support it otherwise it might respond with an
6917        /// error.
6918        #[must_use]
6919        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6920            self.inner = self.inner.send_compressed(encoding);
6921            self
6922        }
6923        /// Enable decompressing responses.
6924        #[must_use]
6925        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6926            self.inner = self.inner.accept_compressed(encoding);
6927            self
6928        }
6929        /// Limits the maximum size of a decoded message.
6930        ///
6931        /// Default: `4MB`
6932        #[must_use]
6933        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6934            self.inner = self.inner.max_decoding_message_size(limit);
6935            self
6936        }
6937        /// Limits the maximum size of an encoded message.
6938        ///
6939        /// Default: `usize::MAX`
6940        #[must_use]
6941        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6942            self.inner = self.inner.max_encoding_message_size(limit);
6943            self
6944        }
6945        /// 创建配置
6946        pub async fn create_config_file(
6947            &mut self,
6948            request: impl tonic::IntoRequest<super::ConfigFile>,
6949        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
6950            self.inner
6951                .ready()
6952                .await
6953                .map_err(|e| {
6954                    tonic::Status::unknown(
6955                        format!("Service was not ready: {}", e.into()),
6956                    )
6957                })?;
6958            let codec = tonic_prost::ProstCodec::default();
6959            let path = http::uri::PathAndQuery::from_static(
6960                "/v1.ConfigGRPC/CreateConfigFile",
6961            );
6962            let mut req = request.into_request();
6963            req.extensions_mut()
6964                .insert(GrpcMethod::new("v1.ConfigGRPC", "CreateConfigFile"));
6965            self.inner.unary(req, path, codec).await
6966        }
6967        /// 更新配置
6968        pub async fn update_config_file(
6969            &mut self,
6970            request: impl tonic::IntoRequest<super::ConfigFile>,
6971        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
6972            self.inner
6973                .ready()
6974                .await
6975                .map_err(|e| {
6976                    tonic::Status::unknown(
6977                        format!("Service was not ready: {}", e.into()),
6978                    )
6979                })?;
6980            let codec = tonic_prost::ProstCodec::default();
6981            let path = http::uri::PathAndQuery::from_static(
6982                "/v1.ConfigGRPC/UpdateConfigFile",
6983            );
6984            let mut req = request.into_request();
6985            req.extensions_mut()
6986                .insert(GrpcMethod::new("v1.ConfigGRPC", "UpdateConfigFile"));
6987            self.inner.unary(req, path, codec).await
6988        }
6989        /// 发布配置
6990        pub async fn publish_config_file(
6991            &mut self,
6992            request: impl tonic::IntoRequest<super::ConfigFileRelease>,
6993        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
6994            self.inner
6995                .ready()
6996                .await
6997                .map_err(|e| {
6998                    tonic::Status::unknown(
6999                        format!("Service was not ready: {}", e.into()),
7000                    )
7001                })?;
7002            let codec = tonic_prost::ProstCodec::default();
7003            let path = http::uri::PathAndQuery::from_static(
7004                "/v1.ConfigGRPC/PublishConfigFile",
7005            );
7006            let mut req = request.into_request();
7007            req.extensions_mut()
7008                .insert(GrpcMethod::new("v1.ConfigGRPC", "PublishConfigFile"));
7009            self.inner.unary(req, path, codec).await
7010        }
7011        /// 服务端参考渲染,只用于发布前预览、校验和跨语言哈希对照。
7012        pub async fn preview_config_template(
7013            &mut self,
7014            request: impl tonic::IntoRequest<super::RenderPreviewRequest>,
7015        ) -> std::result::Result<tonic::Response<super::RenderPreview>, tonic::Status> {
7016            self.inner
7017                .ready()
7018                .await
7019                .map_err(|e| {
7020                    tonic::Status::unknown(
7021                        format!("Service was not ready: {}", e.into()),
7022                    )
7023                })?;
7024            let codec = tonic_prost::ProstCodec::default();
7025            let path = http::uri::PathAndQuery::from_static(
7026                "/v1.ConfigGRPC/PreviewConfigTemplate",
7027            );
7028            let mut req = request.into_request();
7029            req.extensions_mut()
7030                .insert(GrpcMethod::new("v1.ConfigGRPC", "PreviewConfigTemplate"));
7031            self.inner.unary(req, path, codec).await
7032        }
7033        /// 统一发现接口
7034        pub async fn discover(
7035            &mut self,
7036            request: impl tonic::IntoStreamingRequest<
7037                Message = super::ConfigDiscoverRequest,
7038            >,
7039        ) -> std::result::Result<
7040            tonic::Response<tonic::codec::Streaming<super::ConfigDiscoverResponse>>,
7041            tonic::Status,
7042        > {
7043            self.inner
7044                .ready()
7045                .await
7046                .map_err(|e| {
7047                    tonic::Status::unknown(
7048                        format!("Service was not ready: {}", e.into()),
7049                    )
7050                })?;
7051            let codec = tonic_prost::ProstCodec::default();
7052            let path = http::uri::PathAndQuery::from_static("/v1.ConfigGRPC/Discover");
7053            let mut req = request.into_streaming_request();
7054            req.extensions_mut().insert(GrpcMethod::new("v1.ConfigGRPC", "Discover"));
7055            self.inner.streaming(req, path, codec).await
7056        }
7057    }
7058}
7059/// Generated server implementations.
7060pub mod config_grpc_server {
7061    #![allow(
7062        unused_variables,
7063        dead_code,
7064        missing_docs,
7065        clippy::wildcard_imports,
7066        clippy::let_unit_value,
7067    )]
7068    use tonic::codegen::*;
7069    /// Generated trait containing gRPC methods that should be implemented for use with ConfigGrpcServer.
7070    #[async_trait]
7071    pub trait ConfigGrpc: std::marker::Send + std::marker::Sync + 'static {
7072        /// 创建配置
7073        async fn create_config_file(
7074            &self,
7075            request: tonic::Request<super::ConfigFile>,
7076        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
7077        /// 更新配置
7078        async fn update_config_file(
7079            &self,
7080            request: tonic::Request<super::ConfigFile>,
7081        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
7082        /// 发布配置
7083        async fn publish_config_file(
7084            &self,
7085            request: tonic::Request<super::ConfigFileRelease>,
7086        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
7087        /// 服务端参考渲染,只用于发布前预览、校验和跨语言哈希对照。
7088        async fn preview_config_template(
7089            &self,
7090            request: tonic::Request<super::RenderPreviewRequest>,
7091        ) -> std::result::Result<tonic::Response<super::RenderPreview>, tonic::Status>;
7092        /// Server streaming response type for the Discover method.
7093        type DiscoverStream: tonic::codegen::tokio_stream::Stream<
7094                Item = std::result::Result<super::ConfigDiscoverResponse, tonic::Status>,
7095            >
7096            + std::marker::Send
7097            + 'static;
7098        /// 统一发现接口
7099        async fn discover(
7100            &self,
7101            request: tonic::Request<tonic::Streaming<super::ConfigDiscoverRequest>>,
7102        ) -> std::result::Result<tonic::Response<Self::DiscoverStream>, tonic::Status>;
7103    }
7104    #[derive(Debug)]
7105    pub struct ConfigGrpcServer<T> {
7106        inner: Arc<T>,
7107        accept_compression_encodings: EnabledCompressionEncodings,
7108        send_compression_encodings: EnabledCompressionEncodings,
7109        max_decoding_message_size: Option<usize>,
7110        max_encoding_message_size: Option<usize>,
7111    }
7112    impl<T> ConfigGrpcServer<T> {
7113        pub fn new(inner: T) -> Self {
7114            Self::from_arc(Arc::new(inner))
7115        }
7116        pub fn from_arc(inner: Arc<T>) -> Self {
7117            Self {
7118                inner,
7119                accept_compression_encodings: Default::default(),
7120                send_compression_encodings: Default::default(),
7121                max_decoding_message_size: None,
7122                max_encoding_message_size: None,
7123            }
7124        }
7125        pub fn with_interceptor<F>(
7126            inner: T,
7127            interceptor: F,
7128        ) -> InterceptedService<Self, F>
7129        where
7130            F: tonic::service::Interceptor,
7131        {
7132            InterceptedService::new(Self::new(inner), interceptor)
7133        }
7134        /// Enable decompressing requests with the given encoding.
7135        #[must_use]
7136        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7137            self.accept_compression_encodings.enable(encoding);
7138            self
7139        }
7140        /// Compress responses with the given encoding, if the client supports it.
7141        #[must_use]
7142        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7143            self.send_compression_encodings.enable(encoding);
7144            self
7145        }
7146        /// Limits the maximum size of a decoded message.
7147        ///
7148        /// Default: `4MB`
7149        #[must_use]
7150        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7151            self.max_decoding_message_size = Some(limit);
7152            self
7153        }
7154        /// Limits the maximum size of an encoded message.
7155        ///
7156        /// Default: `usize::MAX`
7157        #[must_use]
7158        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7159            self.max_encoding_message_size = Some(limit);
7160            self
7161        }
7162    }
7163    impl<T, B> tonic::codegen::Service<http::Request<B>> for ConfigGrpcServer<T>
7164    where
7165        T: ConfigGrpc,
7166        B: Body + std::marker::Send + 'static,
7167        B::Error: Into<StdError> + std::marker::Send + 'static,
7168    {
7169        type Response = http::Response<tonic::body::Body>;
7170        type Error = std::convert::Infallible;
7171        type Future = BoxFuture<Self::Response, Self::Error>;
7172        fn poll_ready(
7173            &mut self,
7174            _cx: &mut Context<'_>,
7175        ) -> Poll<std::result::Result<(), Self::Error>> {
7176            Poll::Ready(Ok(()))
7177        }
7178        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7179            match req.uri().path() {
7180                "/v1.ConfigGRPC/CreateConfigFile" => {
7181                    #[allow(non_camel_case_types)]
7182                    struct CreateConfigFileSvc<T: ConfigGrpc>(pub Arc<T>);
7183                    impl<T: ConfigGrpc> tonic::server::UnaryService<super::ConfigFile>
7184                    for CreateConfigFileSvc<T> {
7185                        type Response = super::Response;
7186                        type Future = BoxFuture<
7187                            tonic::Response<Self::Response>,
7188                            tonic::Status,
7189                        >;
7190                        fn call(
7191                            &mut self,
7192                            request: tonic::Request<super::ConfigFile>,
7193                        ) -> Self::Future {
7194                            let inner = Arc::clone(&self.0);
7195                            let fut = async move {
7196                                <T as ConfigGrpc>::create_config_file(&inner, request).await
7197                            };
7198                            Box::pin(fut)
7199                        }
7200                    }
7201                    let accept_compression_encodings = self.accept_compression_encodings;
7202                    let send_compression_encodings = self.send_compression_encodings;
7203                    let max_decoding_message_size = self.max_decoding_message_size;
7204                    let max_encoding_message_size = self.max_encoding_message_size;
7205                    let inner = self.inner.clone();
7206                    let fut = async move {
7207                        let method = CreateConfigFileSvc(inner);
7208                        let codec = tonic_prost::ProstCodec::default();
7209                        let mut grpc = tonic::server::Grpc::new(codec)
7210                            .apply_compression_config(
7211                                accept_compression_encodings,
7212                                send_compression_encodings,
7213                            )
7214                            .apply_max_message_size_config(
7215                                max_decoding_message_size,
7216                                max_encoding_message_size,
7217                            );
7218                        let res = grpc.unary(method, req).await;
7219                        Ok(res)
7220                    };
7221                    Box::pin(fut)
7222                }
7223                "/v1.ConfigGRPC/UpdateConfigFile" => {
7224                    #[allow(non_camel_case_types)]
7225                    struct UpdateConfigFileSvc<T: ConfigGrpc>(pub Arc<T>);
7226                    impl<T: ConfigGrpc> tonic::server::UnaryService<super::ConfigFile>
7227                    for UpdateConfigFileSvc<T> {
7228                        type Response = super::Response;
7229                        type Future = BoxFuture<
7230                            tonic::Response<Self::Response>,
7231                            tonic::Status,
7232                        >;
7233                        fn call(
7234                            &mut self,
7235                            request: tonic::Request<super::ConfigFile>,
7236                        ) -> Self::Future {
7237                            let inner = Arc::clone(&self.0);
7238                            let fut = async move {
7239                                <T as ConfigGrpc>::update_config_file(&inner, request).await
7240                            };
7241                            Box::pin(fut)
7242                        }
7243                    }
7244                    let accept_compression_encodings = self.accept_compression_encodings;
7245                    let send_compression_encodings = self.send_compression_encodings;
7246                    let max_decoding_message_size = self.max_decoding_message_size;
7247                    let max_encoding_message_size = self.max_encoding_message_size;
7248                    let inner = self.inner.clone();
7249                    let fut = async move {
7250                        let method = UpdateConfigFileSvc(inner);
7251                        let codec = tonic_prost::ProstCodec::default();
7252                        let mut grpc = tonic::server::Grpc::new(codec)
7253                            .apply_compression_config(
7254                                accept_compression_encodings,
7255                                send_compression_encodings,
7256                            )
7257                            .apply_max_message_size_config(
7258                                max_decoding_message_size,
7259                                max_encoding_message_size,
7260                            );
7261                        let res = grpc.unary(method, req).await;
7262                        Ok(res)
7263                    };
7264                    Box::pin(fut)
7265                }
7266                "/v1.ConfigGRPC/PublishConfigFile" => {
7267                    #[allow(non_camel_case_types)]
7268                    struct PublishConfigFileSvc<T: ConfigGrpc>(pub Arc<T>);
7269                    impl<
7270                        T: ConfigGrpc,
7271                    > tonic::server::UnaryService<super::ConfigFileRelease>
7272                    for PublishConfigFileSvc<T> {
7273                        type Response = super::Response;
7274                        type Future = BoxFuture<
7275                            tonic::Response<Self::Response>,
7276                            tonic::Status,
7277                        >;
7278                        fn call(
7279                            &mut self,
7280                            request: tonic::Request<super::ConfigFileRelease>,
7281                        ) -> Self::Future {
7282                            let inner = Arc::clone(&self.0);
7283                            let fut = async move {
7284                                <T as ConfigGrpc>::publish_config_file(&inner, request)
7285                                    .await
7286                            };
7287                            Box::pin(fut)
7288                        }
7289                    }
7290                    let accept_compression_encodings = self.accept_compression_encodings;
7291                    let send_compression_encodings = self.send_compression_encodings;
7292                    let max_decoding_message_size = self.max_decoding_message_size;
7293                    let max_encoding_message_size = self.max_encoding_message_size;
7294                    let inner = self.inner.clone();
7295                    let fut = async move {
7296                        let method = PublishConfigFileSvc(inner);
7297                        let codec = tonic_prost::ProstCodec::default();
7298                        let mut grpc = tonic::server::Grpc::new(codec)
7299                            .apply_compression_config(
7300                                accept_compression_encodings,
7301                                send_compression_encodings,
7302                            )
7303                            .apply_max_message_size_config(
7304                                max_decoding_message_size,
7305                                max_encoding_message_size,
7306                            );
7307                        let res = grpc.unary(method, req).await;
7308                        Ok(res)
7309                    };
7310                    Box::pin(fut)
7311                }
7312                "/v1.ConfigGRPC/PreviewConfigTemplate" => {
7313                    #[allow(non_camel_case_types)]
7314                    struct PreviewConfigTemplateSvc<T: ConfigGrpc>(pub Arc<T>);
7315                    impl<
7316                        T: ConfigGrpc,
7317                    > tonic::server::UnaryService<super::RenderPreviewRequest>
7318                    for PreviewConfigTemplateSvc<T> {
7319                        type Response = super::RenderPreview;
7320                        type Future = BoxFuture<
7321                            tonic::Response<Self::Response>,
7322                            tonic::Status,
7323                        >;
7324                        fn call(
7325                            &mut self,
7326                            request: tonic::Request<super::RenderPreviewRequest>,
7327                        ) -> Self::Future {
7328                            let inner = Arc::clone(&self.0);
7329                            let fut = async move {
7330                                <T as ConfigGrpc>::preview_config_template(&inner, request)
7331                                    .await
7332                            };
7333                            Box::pin(fut)
7334                        }
7335                    }
7336                    let accept_compression_encodings = self.accept_compression_encodings;
7337                    let send_compression_encodings = self.send_compression_encodings;
7338                    let max_decoding_message_size = self.max_decoding_message_size;
7339                    let max_encoding_message_size = self.max_encoding_message_size;
7340                    let inner = self.inner.clone();
7341                    let fut = async move {
7342                        let method = PreviewConfigTemplateSvc(inner);
7343                        let codec = tonic_prost::ProstCodec::default();
7344                        let mut grpc = tonic::server::Grpc::new(codec)
7345                            .apply_compression_config(
7346                                accept_compression_encodings,
7347                                send_compression_encodings,
7348                            )
7349                            .apply_max_message_size_config(
7350                                max_decoding_message_size,
7351                                max_encoding_message_size,
7352                            );
7353                        let res = grpc.unary(method, req).await;
7354                        Ok(res)
7355                    };
7356                    Box::pin(fut)
7357                }
7358                "/v1.ConfigGRPC/Discover" => {
7359                    #[allow(non_camel_case_types)]
7360                    struct DiscoverSvc<T: ConfigGrpc>(pub Arc<T>);
7361                    impl<
7362                        T: ConfigGrpc,
7363                    > tonic::server::StreamingService<super::ConfigDiscoverRequest>
7364                    for DiscoverSvc<T> {
7365                        type Response = super::ConfigDiscoverResponse;
7366                        type ResponseStream = T::DiscoverStream;
7367                        type Future = BoxFuture<
7368                            tonic::Response<Self::ResponseStream>,
7369                            tonic::Status,
7370                        >;
7371                        fn call(
7372                            &mut self,
7373                            request: tonic::Request<
7374                                tonic::Streaming<super::ConfigDiscoverRequest>,
7375                            >,
7376                        ) -> Self::Future {
7377                            let inner = Arc::clone(&self.0);
7378                            let fut = async move {
7379                                <T as ConfigGrpc>::discover(&inner, request).await
7380                            };
7381                            Box::pin(fut)
7382                        }
7383                    }
7384                    let accept_compression_encodings = self.accept_compression_encodings;
7385                    let send_compression_encodings = self.send_compression_encodings;
7386                    let max_decoding_message_size = self.max_decoding_message_size;
7387                    let max_encoding_message_size = self.max_encoding_message_size;
7388                    let inner = self.inner.clone();
7389                    let fut = async move {
7390                        let method = DiscoverSvc(inner);
7391                        let codec = tonic_prost::ProstCodec::default();
7392                        let mut grpc = tonic::server::Grpc::new(codec)
7393                            .apply_compression_config(
7394                                accept_compression_encodings,
7395                                send_compression_encodings,
7396                            )
7397                            .apply_max_message_size_config(
7398                                max_decoding_message_size,
7399                                max_encoding_message_size,
7400                            );
7401                        let res = grpc.streaming(method, req).await;
7402                        Ok(res)
7403                    };
7404                    Box::pin(fut)
7405                }
7406                _ => {
7407                    Box::pin(async move {
7408                        let mut response = http::Response::new(
7409                            tonic::body::Body::default(),
7410                        );
7411                        let headers = response.headers_mut();
7412                        headers
7413                            .insert(
7414                                tonic::Status::GRPC_STATUS,
7415                                (tonic::Code::Unimplemented as i32).into(),
7416                            );
7417                        headers
7418                            .insert(
7419                                http::header::CONTENT_TYPE,
7420                                tonic::metadata::GRPC_CONTENT_TYPE,
7421                            );
7422                        Ok(response)
7423                    })
7424                }
7425            }
7426        }
7427    }
7428    impl<T> Clone for ConfigGrpcServer<T> {
7429        fn clone(&self) -> Self {
7430            let inner = self.inner.clone();
7431            Self {
7432                inner,
7433                accept_compression_encodings: self.accept_compression_encodings,
7434                send_compression_encodings: self.send_compression_encodings,
7435                max_decoding_message_size: self.max_decoding_message_size,
7436                max_encoding_message_size: self.max_encoding_message_size,
7437            }
7438        }
7439    }
7440    /// Generated gRPC service name
7441    pub const SERVICE_NAME: &str = "v1.ConfigGRPC";
7442    impl<T> tonic::server::NamedService for ConfigGrpcServer<T> {
7443        const NAME: &'static str = SERVICE_NAME;
7444    }
7445}