#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Team {
#[prost(message, optional, tag = "2")]
pub id: ::core::option::Option<u64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DateRange {
#[prost(message, optional, tag = "1")]
pub from_date: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub to_date: ::core::option::Option<::prost_wkt_types::Timestamp>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenericDimension {
#[prost(string, tag = "1")]
pub key: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Dimension {
#[prost(oneof = "dimension::Dimension", tags = "1, 2, 3, 4, 5")]
pub dimension: ::core::option::Option<dimension::Dimension>,
}
pub mod dimension {
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Dimension {
#[prost(enumeration = "super::Pillar", tag = "1")]
Pillar(i32),
#[prost(message, tag = "2")]
GenericDimension(super::GenericDimension),
#[prost(enumeration = "super::TcoTier", tag = "3")]
Tier(i32),
#[prost(enumeration = "super::Severity", tag = "4")]
Severity(i32),
#[prost(enumeration = "super::Priority", tag = "5")]
Priority(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 Pillar {
Unspecified = 0,
Metrics = 1,
Logs = 2,
Spans = 3,
Binary = 4,
}
impl Pillar {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "PILLAR_UNSPECIFIED",
Self::Metrics => "PILLAR_METRICS",
Self::Logs => "PILLAR_LOGS",
Self::Spans => "PILLAR_SPANS",
Self::Binary => "PILLAR_BINARY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PILLAR_UNSPECIFIED" => Some(Self::Unspecified),
"PILLAR_METRICS" => Some(Self::Metrics),
"PILLAR_LOGS" => Some(Self::Logs),
"PILLAR_SPANS" => Some(Self::Spans),
"PILLAR_BINARY" => Some(Self::Binary),
_ => None,
}
}
}
#[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 TcoTier {
Unspecified = 0,
Low = 1,
Medium = 2,
High = 3,
Blocked = 4,
}
impl TcoTier {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "TCO_TIER_UNSPECIFIED",
Self::Low => "TCO_TIER_LOW",
Self::Medium => "TCO_TIER_MEDIUM",
Self::High => "TCO_TIER_HIGH",
Self::Blocked => "TCO_TIER_BLOCKED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"TCO_TIER_UNSPECIFIED" => Some(Self::Unspecified),
"TCO_TIER_LOW" => Some(Self::Low),
"TCO_TIER_MEDIUM" => Some(Self::Medium),
"TCO_TIER_HIGH" => Some(Self::High),
"TCO_TIER_BLOCKED" => Some(Self::Blocked),
_ => None,
}
}
}
#[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 Priority {
Unspecified = 0,
Low = 1,
Medium = 2,
High = 3,
Blocked = 4,
}
impl Priority {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "PRIORITY_UNSPECIFIED",
Self::Low => "PRIORITY_LOW",
Self::Medium => "PRIORITY_MEDIUM",
Self::High => "PRIORITY_HIGH",
Self::Blocked => "PRIORITY_BLOCKED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PRIORITY_UNSPECIFIED" => Some(Self::Unspecified),
"PRIORITY_LOW" => Some(Self::Low),
"PRIORITY_MEDIUM" => Some(Self::Medium),
"PRIORITY_HIGH" => Some(Self::High),
"PRIORITY_BLOCKED" => Some(Self::Blocked),
_ => None,
}
}
}
#[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 Severity {
Unspecified = 0,
Debug = 1,
Verbose = 2,
Info = 3,
Warning = 4,
Error = 5,
Critical = 6,
}
impl Severity {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "SEVERITY_UNSPECIFIED",
Self::Debug => "SEVERITY_DEBUG",
Self::Verbose => "SEVERITY_VERBOSE",
Self::Info => "SEVERITY_INFO",
Self::Warning => "SEVERITY_WARNING",
Self::Error => "SEVERITY_ERROR",
Self::Critical => "SEVERITY_CRITICAL",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SEVERITY_UNSPECIFIED" => Some(Self::Unspecified),
"SEVERITY_DEBUG" => Some(Self::Debug),
"SEVERITY_VERBOSE" => Some(Self::Verbose),
"SEVERITY_INFO" => Some(Self::Info),
"SEVERITY_WARNING" => Some(Self::Warning),
"SEVERITY_ERROR" => Some(Self::Error),
"SEVERITY_CRITICAL" => Some(Self::Critical),
_ => None,
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTeamDetailedDataUsageRequest {
#[prost(message, optional, tag = "2")]
pub date_range: ::core::option::Option<DateRange>,
#[prost(message, optional, tag = "3")]
pub resolution: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(enumeration = "AggregateBy", repeated, tag = "4")]
pub aggregate: ::prost::alloc::vec::Vec<i32>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTeamDetailedDataUsageResponse {
#[prost(message, optional, tag = "1")]
pub timestamp: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub size_gb: ::core::option::Option<f32>,
#[prost(message, optional, tag = "3")]
pub units: ::core::option::Option<f32>,
#[prost(message, repeated, tag = "4")]
pub dimensions: ::prost::alloc::vec::Vec<Dimension>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSpansCountRequest {
#[prost(message, optional, tag = "1")]
pub date_range: ::core::option::Option<DateRange>,
#[prost(message, optional, tag = "2")]
pub resolution: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(message, optional, tag = "3")]
pub filters: ::core::option::Option<ScopesFilter>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ScopesFilter {
#[prost(string, repeated, tag = "1")]
pub application: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "2")]
pub subsystem: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SpansCount {
#[prost(message, optional, tag = "1")]
pub timestamp: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(message, optional, tag = "2")]
pub success_span_count: ::core::option::Option<i64>,
#[prost(message, optional, tag = "3")]
pub error_span_count: ::core::option::Option<i64>,
#[prost(message, optional, tag = "4")]
pub low_success_span_count: ::core::option::Option<i64>,
#[prost(message, optional, tag = "5")]
pub low_error_span_count: ::core::option::Option<i64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSpansCountResponse {
#[prost(message, repeated, tag = "1")]
pub spans_count: ::prost::alloc::vec::Vec<SpansCount>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLogsCountRequest {
#[prost(message, optional, tag = "1")]
pub date_range: ::core::option::Option<DateRange>,
#[prost(message, optional, tag = "2")]
pub resolution: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(message, optional, tag = "3")]
pub filters: ::core::option::Option<ScopesFilter>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct LogsCount {
#[prost(message, optional, tag = "1")]
pub timestamp: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(uint64, tag = "2")]
pub logs_count: u64,
#[prost(enumeration = "Severity", tag = "3")]
pub severity: i32,
#[prost(enumeration = "Priority", tag = "4")]
pub priority: i32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLogsCountResponse {
#[prost(message, repeated, tag = "1")]
pub logs_count: ::prost::alloc::vec::Vec<LogsCount>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetDataUsageMetricsExportStatusRequest {}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetDataUsageMetricsExportStatusResponse {
#[prost(bool, tag = "1")]
pub enabled: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct UpdateDataUsageMetricsExportStatusRequest {
#[prost(bool, tag = "3")]
pub enabled: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct UpdateDataUsageMetricsExportStatusResponse {
#[prost(bool, tag = "1")]
pub enabled: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDataUsageRequest {
#[prost(message, optional, tag = "1")]
pub date_range: ::core::option::Option<DateRange>,
#[prost(message, optional, tag = "2")]
pub resolution: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(enumeration = "AggregateBy", repeated, tag = "3")]
pub aggregate: ::prost::alloc::vec::Vec<i32>,
#[prost(message, repeated, tag = "4")]
pub dimension_filters: ::prost::alloc::vec::Vec<Dimension>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DataUsageEntry {
#[prost(message, optional, tag = "1")]
pub timestamp: ::core::option::Option<::prost_wkt_types::Timestamp>,
#[prost(float, tag = "2")]
pub size_gb: f32,
#[prost(float, tag = "3")]
pub units: f32,
#[prost(message, repeated, tag = "4")]
pub dimensions: ::prost::alloc::vec::Vec<Dimension>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDataUsageResponse {
#[prost(message, repeated, tag = "1")]
pub entries: ::prost::alloc::vec::Vec<DataUsageEntry>,
}
#[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 AggregateBy {
Unspecified = 0,
Application = 1,
Subsystem = 2,
Pillar = 3,
Priority = 4,
}
impl AggregateBy {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "AGGREGATE_BY_UNSPECIFIED",
Self::Application => "AGGREGATE_BY_APPLICATION",
Self::Subsystem => "AGGREGATE_BY_SUBSYSTEM",
Self::Pillar => "AGGREGATE_BY_PILLAR",
Self::Priority => "AGGREGATE_BY_PRIORITY",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"AGGREGATE_BY_UNSPECIFIED" => Some(Self::Unspecified),
"AGGREGATE_BY_APPLICATION" => Some(Self::Application),
"AGGREGATE_BY_SUBSYSTEM" => Some(Self::Subsystem),
"AGGREGATE_BY_PILLAR" => Some(Self::Pillar),
"AGGREGATE_BY_PRIORITY" => Some(Self::Priority),
_ => None,
}
}
}
pub mod data_usage_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 DataUsageServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl DataUsageServiceClient<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> DataUsageServiceClient<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,
) -> DataUsageServiceClient<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,
{
DataUsageServiceClient::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
}
#[deprecated]
pub async fn get_team_detailed_data_usage(
&mut self,
request: impl tonic::IntoRequest<super::GetTeamDetailedDataUsageRequest>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<super::GetTeamDetailedDataUsageResponse>,
>,
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.coralogix.datausage.v2.DataUsageService/GetTeamDetailedDataUsage",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogix.datausage.v2.DataUsageService",
"GetTeamDetailedDataUsage",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn get_spans_count(
&mut self,
request: impl tonic::IntoRequest<super::GetSpansCountRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::GetSpansCountResponse>>,
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.coralogix.datausage.v2.DataUsageService/GetSpansCount",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogix.datausage.v2.DataUsageService",
"GetSpansCount",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn get_logs_count(
&mut self,
request: impl tonic::IntoRequest<super::GetLogsCountRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::GetLogsCountResponse>>,
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.coralogix.datausage.v2.DataUsageService/GetLogsCount",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogix.datausage.v2.DataUsageService",
"GetLogsCount",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn get_data_usage_metrics_export_status(
&mut self,
request: impl tonic::IntoRequest<
super::GetDataUsageMetricsExportStatusRequest,
>,
) -> std::result::Result<
tonic::Response<super::GetDataUsageMetricsExportStatusResponse>,
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.coralogix.datausage.v2.DataUsageService/GetDataUsageMetricsExportStatus",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogix.datausage.v2.DataUsageService",
"GetDataUsageMetricsExportStatus",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_data_usage_metrics_export_status(
&mut self,
request: impl tonic::IntoRequest<
super::UpdateDataUsageMetricsExportStatusRequest,
>,
) -> std::result::Result<
tonic::Response<super::UpdateDataUsageMetricsExportStatusResponse>,
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.coralogix.datausage.v2.DataUsageService/UpdateDataUsageMetricsExportStatus",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogix.datausage.v2.DataUsageService",
"UpdateDataUsageMetricsExportStatus",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_data_usage(
&mut self,
request: impl tonic::IntoRequest<super::GetDataUsageRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::GetDataUsageResponse>>,
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.coralogix.datausage.v2.DataUsageService/GetDataUsage",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogix.datausage.v2.DataUsageService",
"GetDataUsage",
),
);
self.inner.server_streaming(req, path, codec).await
}
}
}