#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InRuleGroup {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(uint32, optional, tag = "2")]
pub interval: ::core::option::Option<u32>,
#[prost(uint64, optional, tag = "3")]
pub limit: ::core::option::Option<u64>,
#[prost(message, repeated, tag = "4")]
pub rules: ::prost::alloc::vec::Vec<InRule>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InRule {
#[prost(string, tag = "1")]
pub record: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub expr: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "3")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OutRuleGroup {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(uint32, optional, tag = "2")]
pub interval: ::core::option::Option<u32>,
#[prost(uint64, optional, tag = "3")]
pub limit: ::core::option::Option<u64>,
#[prost(message, repeated, tag = "4")]
pub rules: ::prost::alloc::vec::Vec<OutRule>,
#[prost(uint64, optional, tag = "5")]
pub last_eval_at: ::core::option::Option<u64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OutRule {
#[prost(string, tag = "1")]
pub record: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub expr: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "3")]
pub labels: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(uint64, optional, tag = "4")]
pub last_eval_duration_ms: ::core::option::Option<u64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteRuleGroup {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RuleGroupListing {
#[prost(message, repeated, tag = "1")]
pub rule_groups: ::prost::alloc::vec::Vec<OutRuleGroup>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FetchRuleGroup {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FetchRuleGroupResult {
#[prost(message, optional, tag = "1")]
pub rule_group: ::core::option::Option<OutRuleGroup>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateRuleGroupSet {
#[prost(message, repeated, tag = "1")]
pub groups: ::prost::alloc::vec::Vec<InRuleGroup>,
#[prost(string, optional, tag = "2")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateRuleGroupSetResult {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateRuleGroupSet {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub groups: ::prost::alloc::vec::Vec<InRuleGroup>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RuleGroupSetListing {
#[prost(message, repeated, tag = "1")]
pub sets: ::prost::alloc::vec::Vec<OutRuleGroupSet>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FetchRuleGroupSet {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteRuleGroupSet {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OutRuleGroupSet {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub groups: ::prost::alloc::vec::Vec<OutRuleGroup>,
#[prost(string, optional, tag = "3")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
}
pub mod rule_groups_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct RuleGroupsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl RuleGroupsClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> RuleGroupsClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> RuleGroupsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
RuleGroupsClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn save(
&mut self,
request: impl tonic::IntoRequest<super::InRuleGroup>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/rule_manager.groups.RuleGroups/Save",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("rule_manager.groups.RuleGroups", "Save"));
self.inner.unary(req, path, codec).await
}
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteRuleGroup>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/rule_manager.groups.RuleGroups/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("rule_manager.groups.RuleGroups", "Delete"));
self.inner.unary(req, path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<super::RuleGroupListing>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/rule_manager.groups.RuleGroups/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("rule_manager.groups.RuleGroups", "List"));
self.inner.unary(req, path, codec).await
}
pub async fn fetch(
&mut self,
request: impl tonic::IntoRequest<super::FetchRuleGroup>,
) -> std::result::Result<
tonic::Response<super::FetchRuleGroupResult>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/rule_manager.groups.RuleGroups/Fetch",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("rule_manager.groups.RuleGroups", "Fetch"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod rule_group_sets_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct RuleGroupSetsClient<T> {
inner: tonic::client::Grpc<T>,
}
impl RuleGroupSetsClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> RuleGroupSetsClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> RuleGroupSetsClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
RuleGroupSetsClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn create(
&mut self,
request: impl tonic::IntoRequest<super::CreateRuleGroupSet>,
) -> std::result::Result<
tonic::Response<super::CreateRuleGroupSetResult>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/rule_manager.groups.RuleGroupSets/Create",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("rule_manager.groups.RuleGroupSets", "Create"));
self.inner.unary(req, path, codec).await
}
pub async fn update(
&mut self,
request: impl tonic::IntoRequest<super::UpdateRuleGroupSet>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/rule_manager.groups.RuleGroupSets/Update",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("rule_manager.groups.RuleGroupSets", "Update"));
self.inner.unary(req, path, codec).await
}
pub async fn list(
&mut self,
request: impl tonic::IntoRequest<()>,
) -> std::result::Result<
tonic::Response<super::RuleGroupSetListing>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/rule_manager.groups.RuleGroupSets/List",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("rule_manager.groups.RuleGroupSets", "List"));
self.inner.unary(req, path, codec).await
}
pub async fn fetch(
&mut self,
request: impl tonic::IntoRequest<super::FetchRuleGroupSet>,
) -> std::result::Result<
tonic::Response<super::OutRuleGroupSet>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/rule_manager.groups.RuleGroupSets/Fetch",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("rule_manager.groups.RuleGroupSets", "Fetch"));
self.inner.unary(req, path, codec).await
}
pub async fn delete(
&mut self,
request: impl tonic::IntoRequest<super::DeleteRuleGroupSet>,
) -> std::result::Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/rule_manager.groups.RuleGroupSets/Delete",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("rule_manager.groups.RuleGroupSets", "Delete"));
self.inner.unary(req, path, codec).await
}
}
}