#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Preset {
#[prost(string, optional, tag = "1")]
pub id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub user_facing_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag = "3")]
pub entity_type: ::prost::alloc::string::String,
#[prost(enumeration = "super::super::ConnectorType", tag = "4")]
pub connector_type: i32,
#[prost(message, repeated, tag = "5")]
pub config_overrides: ::prost::alloc::vec::Vec<super::super::ConfigOverrides>,
#[prost(message, optional, boxed, tag = "6")]
pub parent: ::core::option::Option<::prost::alloc::boxed::Box<Preset>>,
#[prost(string, tag = "7")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub description: ::prost::alloc::string::String,
#[prost(message, optional, tag = "9")]
pub create_time: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "10")]
pub update_time: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(enumeration = "PresetType", optional, tag = "11")]
pub preset_type: ::core::option::Option<i32>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PresetSummary {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub user_facing_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub entity_type: ::prost::alloc::string::String,
#[prost(enumeration = "super::super::ConnectorType", tag = "4")]
pub connector_type: i32,
#[prost(string, optional, tag = "5")]
pub parent_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag = "6")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub description: ::prost::alloc::string::String,
#[prost(message, optional, tag = "8")]
pub create_time: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "9")]
pub update_time: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(enumeration = "PresetType", tag = "10")]
pub preset_type: i32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PresetType {
Unspecified = 0,
System = 1,
Custom = 2,
}
impl PresetType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "PRESET_TYPE_UNSPECIFIED",
Self::System => "SYSTEM",
Self::Custom => "CUSTOM",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PRESET_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"SYSTEM" => Some(Self::System),
"CUSTOM" => Some(Self::Custom),
_ => None,
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateCustomPresetRequest {
#[prost(message, optional, tag = "1")]
pub preset: ::core::option::Option<Preset>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateCustomPresetResponse {
#[prost(message, optional, tag = "1")]
pub preset: ::core::option::Option<Preset>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReplaceCustomPresetRequest {
#[prost(message, optional, tag = "1")]
pub preset: ::core::option::Option<Preset>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReplaceCustomPresetResponse {
#[prost(message, optional, tag = "1")]
pub preset: ::core::option::Option<Preset>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteCustomPresetRequest {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteCustomPresetResponse {}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetCustomPresetAsDefaultRequest {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SetCustomPresetAsDefaultResponse {}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPresetRequest {
#[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 GetPresetResponse {
#[prost(message, optional, tag = "1")]
pub preset: ::core::option::Option<Preset>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPresetSummariesRequest {
#[prost(enumeration = "super::super::ConnectorType", tag = "1")]
pub connector_type: i32,
#[prost(string, tag = "2")]
pub entity_type: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub order_bys: ::prost::alloc::vec::Vec<super::super::OrderBy>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPresetSummariesResponse {
#[prost(message, repeated, tag = "1")]
pub preset_summaries: ::prost::alloc::vec::Vec<PresetSummary>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetPresetsRequest {
#[prost(string, repeated, tag = "1")]
pub ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchGetPresetsResponse {
#[prost(map = "string, message", tag = "1")]
pub presets: ::std::collections::HashMap<::prost::alloc::string::String, Preset>,
#[prost(string, repeated, tag = "2")]
pub not_found_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDefaultPresetSummaryRequest {
#[prost(enumeration = "super::super::ConnectorType", tag = "1")]
pub connector_type: i32,
#[prost(string, tag = "2")]
pub entity_type: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDefaultPresetSummaryResponse {
#[prost(message, optional, tag = "1")]
pub preset_summary: ::core::option::Option<PresetSummary>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSystemDefaultPresetSummaryRequest {
#[prost(enumeration = "super::super::ConnectorType", tag = "1")]
pub connector_type: i32,
#[prost(string, tag = "2")]
pub entity_type: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSystemDefaultPresetSummaryResponse {
#[prost(message, optional, tag = "1")]
pub preset_summary: ::core::option::Option<PresetSummary>,
}
pub mod presets_service_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 PresetsServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl PresetsServiceClient<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> PresetsServiceClient<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,
) -> PresetsServiceClient<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,
{
PresetsServiceClient::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_custom_preset(
&mut self,
request: impl tonic::IntoRequest<super::CreateCustomPresetRequest>,
) -> std::result::Result<
tonic::Response<super::CreateCustomPresetResponse>,
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(
"/com.coralogixapis.notification_center.presets.v1.PresetsService/CreateCustomPreset",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.notification_center.presets.v1.PresetsService",
"CreateCustomPreset",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn replace_custom_preset(
&mut self,
request: impl tonic::IntoRequest<super::ReplaceCustomPresetRequest>,
) -> std::result::Result<
tonic::Response<super::ReplaceCustomPresetResponse>,
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(
"/com.coralogixapis.notification_center.presets.v1.PresetsService/ReplaceCustomPreset",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.notification_center.presets.v1.PresetsService",
"ReplaceCustomPreset",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_custom_preset(
&mut self,
request: impl tonic::IntoRequest<super::DeleteCustomPresetRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteCustomPresetResponse>,
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(
"/com.coralogixapis.notification_center.presets.v1.PresetsService/DeleteCustomPreset",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.notification_center.presets.v1.PresetsService",
"DeleteCustomPreset",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn set_custom_preset_as_default(
&mut self,
request: impl tonic::IntoRequest<super::SetCustomPresetAsDefaultRequest>,
) -> std::result::Result<
tonic::Response<super::SetCustomPresetAsDefaultResponse>,
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(
"/com.coralogixapis.notification_center.presets.v1.PresetsService/SetCustomPresetAsDefault",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.notification_center.presets.v1.PresetsService",
"SetCustomPresetAsDefault",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_preset(
&mut self,
request: impl tonic::IntoRequest<super::GetPresetRequest>,
) -> std::result::Result<
tonic::Response<super::GetPresetResponse>,
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(
"/com.coralogixapis.notification_center.presets.v1.PresetsService/GetPreset",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.notification_center.presets.v1.PresetsService",
"GetPreset",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_preset_summaries(
&mut self,
request: impl tonic::IntoRequest<super::ListPresetSummariesRequest>,
) -> std::result::Result<
tonic::Response<super::ListPresetSummariesResponse>,
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(
"/com.coralogixapis.notification_center.presets.v1.PresetsService/ListPresetSummaries",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.notification_center.presets.v1.PresetsService",
"ListPresetSummaries",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn batch_get_presets(
&mut self,
request: impl tonic::IntoRequest<super::BatchGetPresetsRequest>,
) -> std::result::Result<
tonic::Response<super::BatchGetPresetsResponse>,
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(
"/com.coralogixapis.notification_center.presets.v1.PresetsService/BatchGetPresets",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.notification_center.presets.v1.PresetsService",
"BatchGetPresets",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_default_preset_summary(
&mut self,
request: impl tonic::IntoRequest<super::GetDefaultPresetSummaryRequest>,
) -> std::result::Result<
tonic::Response<super::GetDefaultPresetSummaryResponse>,
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(
"/com.coralogixapis.notification_center.presets.v1.PresetsService/GetDefaultPresetSummary",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.notification_center.presets.v1.PresetsService",
"GetDefaultPresetSummary",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_system_default_preset_summary(
&mut self,
request: impl tonic::IntoRequest<super::GetSystemDefaultPresetSummaryRequest>,
) -> std::result::Result<
tonic::Response<super::GetSystemDefaultPresetSummaryResponse>,
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(
"/com.coralogixapis.notification_center.presets.v1.PresetsService/GetSystemDefaultPresetSummary",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.notification_center.presets.v1.PresetsService",
"GetSystemDefaultPresetSummary",
),
);
self.inner.unary(req, path, codec).await
}
}
}