1#[derive(serde::Serialize, serde::Deserialize)]
6#[serde(rename_all = "snake_case")]
7#[derive(Clone, PartialEq, ::prost::Message)]
8pub struct InRuleGroup {
9 #[prost(string, tag = "1")]
11 pub name: ::prost::alloc::string::String,
12 #[prost(uint32, optional, tag = "2")]
16 pub interval: ::core::option::Option<u32>,
17 #[prost(uint64, optional, tag = "3")]
21 pub limit: ::core::option::Option<u64>,
22 #[prost(message, repeated, tag = "4")]
24 pub rules: ::prost::alloc::vec::Vec<InRule>,
25}
26#[derive(serde::Serialize, serde::Deserialize)]
27#[serde(rename_all = "snake_case")]
28#[derive(Clone, PartialEq, ::prost::Message)]
29pub struct InRule {
30 #[prost(string, tag = "1")]
32 pub record: ::prost::alloc::string::String,
33 #[prost(string, tag = "2")]
38 pub expr: ::prost::alloc::string::String,
39 #[prost(map = "string, string", tag = "3")]
41 pub labels: ::std::collections::HashMap<
42 ::prost::alloc::string::String,
43 ::prost::alloc::string::String,
44 >,
45}
46#[derive(serde::Serialize, serde::Deserialize)]
47#[serde(rename_all = "snake_case")]
48#[derive(Clone, PartialEq, ::prost::Message)]
49pub struct OutRuleGroup {
50 #[prost(string, tag = "1")]
51 pub name: ::prost::alloc::string::String,
52 #[prost(uint32, optional, tag = "2")]
53 pub interval: ::core::option::Option<u32>,
54 #[prost(uint64, optional, tag = "3")]
55 pub limit: ::core::option::Option<u64>,
56 #[prost(message, repeated, tag = "4")]
57 pub rules: ::prost::alloc::vec::Vec<OutRule>,
58 #[prost(uint64, optional, tag = "5")]
59 pub last_eval_at: ::core::option::Option<u64>,
60}
61#[derive(serde::Serialize, serde::Deserialize)]
62#[serde(rename_all = "snake_case")]
63#[derive(Clone, PartialEq, ::prost::Message)]
64pub struct OutRule {
65 #[prost(string, tag = "1")]
66 pub record: ::prost::alloc::string::String,
67 #[prost(string, tag = "2")]
68 pub expr: ::prost::alloc::string::String,
69 #[prost(map = "string, string", tag = "3")]
70 pub labels: ::std::collections::HashMap<
71 ::prost::alloc::string::String,
72 ::prost::alloc::string::String,
73 >,
74 #[prost(uint64, optional, tag = "4")]
75 pub last_eval_duration_ms: ::core::option::Option<u64>,
76}
77#[derive(serde::Serialize, serde::Deserialize)]
79#[serde(rename_all = "snake_case")]
80#[derive(Clone, PartialEq, ::prost::Message)]
81pub struct DeleteRuleGroup {
82 #[prost(string, tag = "1")]
84 pub name: ::prost::alloc::string::String,
85}
86#[derive(serde::Serialize, serde::Deserialize)]
88#[serde(rename_all = "snake_case")]
89#[derive(Clone, PartialEq, ::prost::Message)]
90pub struct RuleGroupListing {
91 #[prost(message, repeated, tag = "1")]
93 pub rule_groups: ::prost::alloc::vec::Vec<OutRuleGroup>,
94}
95#[derive(serde::Serialize, serde::Deserialize)]
97#[serde(rename_all = "snake_case")]
98#[derive(Clone, PartialEq, ::prost::Message)]
99pub struct FetchRuleGroup {
100 #[prost(string, tag = "1")]
102 pub name: ::prost::alloc::string::String,
103}
104#[derive(serde::Serialize, serde::Deserialize)]
106#[serde(rename_all = "snake_case")]
107#[derive(Clone, PartialEq, ::prost::Message)]
108pub struct FetchRuleGroupResult {
109 #[prost(message, optional, tag = "1")]
113 pub rule_group: ::core::option::Option<OutRuleGroup>,
114}
115#[derive(serde::Serialize, serde::Deserialize)]
116#[serde(rename_all = "snake_case")]
117#[derive(Clone, PartialEq, ::prost::Message)]
118pub struct CreateRuleGroupSet {
119 #[prost(message, repeated, tag = "1")]
120 pub groups: ::prost::alloc::vec::Vec<InRuleGroup>,
121 #[prost(string, optional, tag = "2")]
122 pub name: ::core::option::Option<::prost::alloc::string::String>,
123}
124#[derive(serde::Serialize, serde::Deserialize)]
125#[serde(rename_all = "snake_case")]
126#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct CreateRuleGroupSetResult {
128 #[prost(string, tag = "1")]
129 pub id: ::prost::alloc::string::String,
130}
131#[derive(serde::Serialize, serde::Deserialize)]
132#[serde(rename_all = "snake_case")]
133#[derive(Clone, PartialEq, ::prost::Message)]
134pub struct UpdateRuleGroupSet {
135 #[prost(string, tag = "1")]
136 pub id: ::prost::alloc::string::String,
137 #[prost(message, repeated, tag = "2")]
138 pub groups: ::prost::alloc::vec::Vec<InRuleGroup>,
139}
140#[derive(serde::Serialize, serde::Deserialize)]
141#[serde(rename_all = "snake_case")]
142#[derive(Clone, PartialEq, ::prost::Message)]
143pub struct RuleGroupSetListing {
144 #[prost(message, repeated, tag = "1")]
145 pub sets: ::prost::alloc::vec::Vec<OutRuleGroupSet>,
146}
147#[derive(serde::Serialize, serde::Deserialize)]
148#[serde(rename_all = "snake_case")]
149#[derive(Clone, PartialEq, ::prost::Message)]
150pub struct FetchRuleGroupSet {
151 #[prost(string, tag = "1")]
152 pub id: ::prost::alloc::string::String,
153}
154#[derive(serde::Serialize, serde::Deserialize)]
155#[serde(rename_all = "snake_case")]
156#[derive(Clone, PartialEq, ::prost::Message)]
157pub struct DeleteRuleGroupSet {
158 #[prost(string, tag = "1")]
159 pub id: ::prost::alloc::string::String,
160}
161#[derive(serde::Serialize, serde::Deserialize)]
162#[serde(rename_all = "snake_case")]
163#[derive(Clone, PartialEq, ::prost::Message)]
164pub struct OutRuleGroupSet {
165 #[prost(string, tag = "1")]
166 pub id: ::prost::alloc::string::String,
167 #[prost(message, repeated, tag = "2")]
168 pub groups: ::prost::alloc::vec::Vec<OutRuleGroup>,
169 #[prost(string, optional, tag = "3")]
170 pub name: ::core::option::Option<::prost::alloc::string::String>,
171}
172pub mod rule_groups_client {
174 #![allow(
175 unused_variables,
176 dead_code,
177 missing_docs,
178 clippy::wildcard_imports,
179 clippy::let_unit_value,
180 )]
181 use tonic::codegen::*;
182 use tonic::codegen::http::Uri;
183 #[derive(Debug, Clone)]
186 pub struct RuleGroupsClient<T> {
187 inner: tonic::client::Grpc<T>,
188 }
189 impl RuleGroupsClient<tonic::transport::Channel> {
190 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
192 where
193 D: TryInto<tonic::transport::Endpoint>,
194 D::Error: Into<StdError>,
195 {
196 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
197 Ok(Self::new(conn))
198 }
199 }
200 impl<T> RuleGroupsClient<T>
201 where
202 T: tonic::client::GrpcService<tonic::body::BoxBody>,
203 T::Error: Into<StdError>,
204 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
205 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
206 {
207 pub fn new(inner: T) -> Self {
208 let inner = tonic::client::Grpc::new(inner);
209 Self { inner }
210 }
211 pub fn with_origin(inner: T, origin: Uri) -> Self {
212 let inner = tonic::client::Grpc::with_origin(inner, origin);
213 Self { inner }
214 }
215 pub fn with_interceptor<F>(
216 inner: T,
217 interceptor: F,
218 ) -> RuleGroupsClient<InterceptedService<T, F>>
219 where
220 F: tonic::service::Interceptor,
221 T::ResponseBody: Default,
222 T: tonic::codegen::Service<
223 http::Request<tonic::body::BoxBody>,
224 Response = http::Response<
225 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
226 >,
227 >,
228 <T as tonic::codegen::Service<
229 http::Request<tonic::body::BoxBody>,
230 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
231 {
232 RuleGroupsClient::new(InterceptedService::new(inner, interceptor))
233 }
234 #[must_use]
239 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
240 self.inner = self.inner.send_compressed(encoding);
241 self
242 }
243 #[must_use]
245 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
246 self.inner = self.inner.accept_compressed(encoding);
247 self
248 }
249 #[must_use]
253 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
254 self.inner = self.inner.max_decoding_message_size(limit);
255 self
256 }
257 #[must_use]
261 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
262 self.inner = self.inner.max_encoding_message_size(limit);
263 self
264 }
265 pub async fn save(
267 &mut self,
268 request: impl tonic::IntoRequest<super::InRuleGroup>,
269 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
270 self.inner
271 .ready()
272 .await
273 .map_err(|e| {
274 tonic::Status::unknown(
275 format!("Service was not ready: {}", e.into()),
276 )
277 })?;
278 let codec = tonic::codec::ProstCodec::default();
279 let path = http::uri::PathAndQuery::from_static(
280 "/rule_manager.groups.RuleGroups/Save",
281 );
282 let mut req = request.into_request();
283 req.extensions_mut()
284 .insert(GrpcMethod::new("rule_manager.groups.RuleGroups", "Save"));
285 self.inner.unary(req, path, codec).await
286 }
287 pub async fn delete(
289 &mut self,
290 request: impl tonic::IntoRequest<super::DeleteRuleGroup>,
291 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
292 self.inner
293 .ready()
294 .await
295 .map_err(|e| {
296 tonic::Status::unknown(
297 format!("Service was not ready: {}", e.into()),
298 )
299 })?;
300 let codec = tonic::codec::ProstCodec::default();
301 let path = http::uri::PathAndQuery::from_static(
302 "/rule_manager.groups.RuleGroups/Delete",
303 );
304 let mut req = request.into_request();
305 req.extensions_mut()
306 .insert(GrpcMethod::new("rule_manager.groups.RuleGroups", "Delete"));
307 self.inner.unary(req, path, codec).await
308 }
309 pub async fn list(
311 &mut self,
312 request: impl tonic::IntoRequest<()>,
313 ) -> std::result::Result<
314 tonic::Response<super::RuleGroupListing>,
315 tonic::Status,
316 > {
317 self.inner
318 .ready()
319 .await
320 .map_err(|e| {
321 tonic::Status::unknown(
322 format!("Service was not ready: {}", e.into()),
323 )
324 })?;
325 let codec = tonic::codec::ProstCodec::default();
326 let path = http::uri::PathAndQuery::from_static(
327 "/rule_manager.groups.RuleGroups/List",
328 );
329 let mut req = request.into_request();
330 req.extensions_mut()
331 .insert(GrpcMethod::new("rule_manager.groups.RuleGroups", "List"));
332 self.inner.unary(req, path, codec).await
333 }
334 pub async fn fetch(
336 &mut self,
337 request: impl tonic::IntoRequest<super::FetchRuleGroup>,
338 ) -> std::result::Result<
339 tonic::Response<super::FetchRuleGroupResult>,
340 tonic::Status,
341 > {
342 self.inner
343 .ready()
344 .await
345 .map_err(|e| {
346 tonic::Status::unknown(
347 format!("Service was not ready: {}", e.into()),
348 )
349 })?;
350 let codec = tonic::codec::ProstCodec::default();
351 let path = http::uri::PathAndQuery::from_static(
352 "/rule_manager.groups.RuleGroups/Fetch",
353 );
354 let mut req = request.into_request();
355 req.extensions_mut()
356 .insert(GrpcMethod::new("rule_manager.groups.RuleGroups", "Fetch"));
357 self.inner.unary(req, path, codec).await
358 }
359 }
360}
361pub mod rule_group_sets_client {
363 #![allow(
364 unused_variables,
365 dead_code,
366 missing_docs,
367 clippy::wildcard_imports,
368 clippy::let_unit_value,
369 )]
370 use tonic::codegen::*;
371 use tonic::codegen::http::Uri;
372 #[derive(Debug, Clone)]
373 pub struct RuleGroupSetsClient<T> {
374 inner: tonic::client::Grpc<T>,
375 }
376 impl RuleGroupSetsClient<tonic::transport::Channel> {
377 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
379 where
380 D: TryInto<tonic::transport::Endpoint>,
381 D::Error: Into<StdError>,
382 {
383 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
384 Ok(Self::new(conn))
385 }
386 }
387 impl<T> RuleGroupSetsClient<T>
388 where
389 T: tonic::client::GrpcService<tonic::body::BoxBody>,
390 T::Error: Into<StdError>,
391 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
392 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
393 {
394 pub fn new(inner: T) -> Self {
395 let inner = tonic::client::Grpc::new(inner);
396 Self { inner }
397 }
398 pub fn with_origin(inner: T, origin: Uri) -> Self {
399 let inner = tonic::client::Grpc::with_origin(inner, origin);
400 Self { inner }
401 }
402 pub fn with_interceptor<F>(
403 inner: T,
404 interceptor: F,
405 ) -> RuleGroupSetsClient<InterceptedService<T, F>>
406 where
407 F: tonic::service::Interceptor,
408 T::ResponseBody: Default,
409 T: tonic::codegen::Service<
410 http::Request<tonic::body::BoxBody>,
411 Response = http::Response<
412 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
413 >,
414 >,
415 <T as tonic::codegen::Service<
416 http::Request<tonic::body::BoxBody>,
417 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
418 {
419 RuleGroupSetsClient::new(InterceptedService::new(inner, interceptor))
420 }
421 #[must_use]
426 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
427 self.inner = self.inner.send_compressed(encoding);
428 self
429 }
430 #[must_use]
432 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
433 self.inner = self.inner.accept_compressed(encoding);
434 self
435 }
436 #[must_use]
440 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
441 self.inner = self.inner.max_decoding_message_size(limit);
442 self
443 }
444 #[must_use]
448 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
449 self.inner = self.inner.max_encoding_message_size(limit);
450 self
451 }
452 pub async fn create(
453 &mut self,
454 request: impl tonic::IntoRequest<super::CreateRuleGroupSet>,
455 ) -> std::result::Result<
456 tonic::Response<super::CreateRuleGroupSetResult>,
457 tonic::Status,
458 > {
459 self.inner
460 .ready()
461 .await
462 .map_err(|e| {
463 tonic::Status::unknown(
464 format!("Service was not ready: {}", e.into()),
465 )
466 })?;
467 let codec = tonic::codec::ProstCodec::default();
468 let path = http::uri::PathAndQuery::from_static(
469 "/rule_manager.groups.RuleGroupSets/Create",
470 );
471 let mut req = request.into_request();
472 req.extensions_mut()
473 .insert(GrpcMethod::new("rule_manager.groups.RuleGroupSets", "Create"));
474 self.inner.unary(req, path, codec).await
475 }
476 pub async fn update(
477 &mut self,
478 request: impl tonic::IntoRequest<super::UpdateRuleGroupSet>,
479 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
480 self.inner
481 .ready()
482 .await
483 .map_err(|e| {
484 tonic::Status::unknown(
485 format!("Service was not ready: {}", e.into()),
486 )
487 })?;
488 let codec = tonic::codec::ProstCodec::default();
489 let path = http::uri::PathAndQuery::from_static(
490 "/rule_manager.groups.RuleGroupSets/Update",
491 );
492 let mut req = request.into_request();
493 req.extensions_mut()
494 .insert(GrpcMethod::new("rule_manager.groups.RuleGroupSets", "Update"));
495 self.inner.unary(req, path, codec).await
496 }
497 pub async fn list(
498 &mut self,
499 request: impl tonic::IntoRequest<()>,
500 ) -> std::result::Result<
501 tonic::Response<super::RuleGroupSetListing>,
502 tonic::Status,
503 > {
504 self.inner
505 .ready()
506 .await
507 .map_err(|e| {
508 tonic::Status::unknown(
509 format!("Service was not ready: {}", e.into()),
510 )
511 })?;
512 let codec = tonic::codec::ProstCodec::default();
513 let path = http::uri::PathAndQuery::from_static(
514 "/rule_manager.groups.RuleGroupSets/List",
515 );
516 let mut req = request.into_request();
517 req.extensions_mut()
518 .insert(GrpcMethod::new("rule_manager.groups.RuleGroupSets", "List"));
519 self.inner.unary(req, path, codec).await
520 }
521 pub async fn fetch(
522 &mut self,
523 request: impl tonic::IntoRequest<super::FetchRuleGroupSet>,
524 ) -> std::result::Result<
525 tonic::Response<super::OutRuleGroupSet>,
526 tonic::Status,
527 > {
528 self.inner
529 .ready()
530 .await
531 .map_err(|e| {
532 tonic::Status::unknown(
533 format!("Service was not ready: {}", e.into()),
534 )
535 })?;
536 let codec = tonic::codec::ProstCodec::default();
537 let path = http::uri::PathAndQuery::from_static(
538 "/rule_manager.groups.RuleGroupSets/Fetch",
539 );
540 let mut req = request.into_request();
541 req.extensions_mut()
542 .insert(GrpcMethod::new("rule_manager.groups.RuleGroupSets", "Fetch"));
543 self.inner.unary(req, path, codec).await
544 }
545 pub async fn delete(
546 &mut self,
547 request: impl tonic::IntoRequest<super::DeleteRuleGroupSet>,
548 ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
549 self.inner
550 .ready()
551 .await
552 .map_err(|e| {
553 tonic::Status::unknown(
554 format!("Service was not ready: {}", e.into()),
555 )
556 })?;
557 let codec = tonic::codec::ProstCodec::default();
558 let path = http::uri::PathAndQuery::from_static(
559 "/rule_manager.groups.RuleGroupSets/Delete",
560 );
561 let mut req = request.into_request();
562 req.extensions_mut()
563 .insert(GrpcMethod::new("rule_manager.groups.RuleGroupSets", "Delete"));
564 self.inner.unary(req, path, codec).await
565 }
566 }
567}