1#[derive(serde::Serialize, serde::Deserialize)]
3#[serde(rename_all = "snake_case")]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct CxEvent {
6 #[prost(message, optional, tag = "1")]
7 pub cx_event_key: ::core::option::Option<::prost::alloc::string::String>,
8 #[prost(message, optional, tag = "2")]
9 pub cx_event_type: ::core::option::Option<::prost::alloc::string::String>,
10 #[prost(map = "string, string", tag = "3")]
11 pub cx_event_labels: ::std::collections::HashMap<
12 ::prost::alloc::string::String,
13 ::prost::alloc::string::String,
14 >,
15 #[prost(message, optional, tag = "4")]
16 pub company_id: ::core::option::Option<i32>,
17 #[prost(message, optional, tag = "5")]
18 pub cx_event_timestamp: ::core::option::Option<::prost_wkt_types::Timestamp>,
19 #[prost(message, optional, tag = "9")]
20 pub cx_event_payload_type: ::core::option::Option<::prost::alloc::string::String>,
21 #[prost(message, optional, tag = "6")]
22 pub cx_event_payload: ::core::option::Option<::prost_wkt_types::Struct>,
23 #[prost(message, optional, tag = "7")]
24 pub cx_event_dedup_key: ::core::option::Option<::prost::alloc::string::String>,
25 #[prost(map = "string, string", tag = "8")]
26 pub cx_event_metadata: ::std::collections::HashMap<
27 ::prost::alloc::string::String,
28 ::prost::alloc::string::String,
29 >,
30}
31#[derive(serde::Serialize, serde::Deserialize)]
32#[serde(rename_all = "snake_case")]
33#[derive(Clone, Copy, PartialEq, ::prost::Message)]
34pub struct OrderBy {
35 #[prost(enumeration = "OrderByFields", tag = "1")]
36 pub field_name: i32,
37 #[prost(enumeration = "OrderByDirection", tag = "2")]
38 pub direction: i32,
39}
40#[derive(serde::Serialize, serde::Deserialize)]
41#[serde(rename_all = "snake_case")]
42#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
43#[repr(i32)]
44pub enum OrderByFields {
45 Unspecified = 0,
46 Timestamp = 1,
47}
48impl OrderByFields {
49 pub fn as_str_name(&self) -> &'static str {
54 match self {
55 Self::Unspecified => "ORDER_BY_FIELDS_UNSPECIFIED",
56 Self::Timestamp => "ORDER_BY_FIELDS_TIMESTAMP",
57 }
58 }
59 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
61 match value {
62 "ORDER_BY_FIELDS_UNSPECIFIED" => Some(Self::Unspecified),
63 "ORDER_BY_FIELDS_TIMESTAMP" => Some(Self::Timestamp),
64 _ => None,
65 }
66 }
67}
68#[derive(serde::Serialize, serde::Deserialize)]
69#[serde(rename_all = "snake_case")]
70#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
71#[repr(i32)]
72pub enum OrderByDirection {
73 Unspecified = 0,
74 Asc = 1,
75 Desc = 2,
76}
77impl OrderByDirection {
78 pub fn as_str_name(&self) -> &'static str {
83 match self {
84 Self::Unspecified => "ORDER_BY_DIRECTION_UNSPECIFIED",
85 Self::Asc => "ORDER_BY_DIRECTION_ASC",
86 Self::Desc => "ORDER_BY_DIRECTION_DESC",
87 }
88 }
89 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
91 match value {
92 "ORDER_BY_DIRECTION_UNSPECIFIED" => Some(Self::Unspecified),
93 "ORDER_BY_DIRECTION_ASC" => Some(Self::Asc),
94 "ORDER_BY_DIRECTION_DESC" => Some(Self::Desc),
95 _ => None,
96 }
97 }
98}
99#[derive(serde::Serialize, serde::Deserialize)]
100#[serde(rename_all = "snake_case")]
101#[derive(Clone, Copy, PartialEq, ::prost::Message)]
102pub struct EventsQueryFilter {
103 #[prost(message, optional, tag = "1")]
104 pub timestamp: ::core::option::Option<TimestampRange>,
105}
106#[derive(serde::Serialize, serde::Deserialize)]
107#[serde(rename_all = "snake_case")]
108#[derive(Clone, PartialEq, ::prost::Message)]
109pub struct EventsFilter {
110 #[prost(message, optional, tag = "1")]
111 pub timestamp: ::core::option::Option<TimestampRange>,
112 #[prost(message, repeated, tag = "2")]
113 pub cx_event_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
114 #[prost(message, repeated, tag = "4")]
115 pub cx_event_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
116 #[prost(message, optional, tag = "5")]
117 pub cx_event_metadata_filters: ::core::option::Option<Filters>,
118 #[prost(message, optional, tag = "6")]
119 pub cx_event_labels_filters: ::core::option::Option<Filters>,
120}
121#[derive(serde::Serialize, serde::Deserialize)]
122#[serde(rename_all = "snake_case")]
123#[derive(Clone, PartialEq, ::prost::Message)]
124pub struct Filters {
125 #[prost(enumeration = "FilterOperator", tag = "1")]
126 pub operator: i32,
127 #[prost(message, repeated, tag = "2")]
128 pub path_and_values: ::prost::alloc::vec::Vec<FilterPathAndValues>,
129}
130#[derive(serde::Serialize, serde::Deserialize)]
131#[serde(rename_all = "snake_case")]
132#[derive(Clone, PartialEq, ::prost::Message)]
133pub struct FilterPathAndValues {
134 #[prost(message, optional, tag = "1")]
135 pub path: ::core::option::Option<::prost::alloc::string::String>,
136 #[prost(oneof = "filter_path_and_values::Values", tags = "100, 101")]
137 pub values: ::core::option::Option<filter_path_and_values::Values>,
138}
139pub mod filter_path_and_values {
141 #[derive(serde::Serialize, serde::Deserialize)]
142 #[serde(rename_all = "snake_case")]
143 #[derive(Clone, PartialEq, ::prost::Oneof)]
144 pub enum Values {
145 #[prost(message, tag = "100")]
146 MultipleValues(super::MultipleValues),
147 #[prost(message, tag = "101")]
148 Filters(super::Filters),
149 }
150}
151#[derive(serde::Serialize, serde::Deserialize)]
152#[serde(rename_all = "snake_case")]
153#[derive(Clone, PartialEq, ::prost::Message)]
154pub struct MultipleValues {
155 #[prost(message, repeated, tag = "1")]
156 pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
157 #[prost(enumeration = "FilterMatcher", tag = "2")]
158 pub matcher: i32,
159}
160#[derive(serde::Serialize, serde::Deserialize)]
161#[serde(rename_all = "snake_case")]
162#[derive(Clone, Copy, PartialEq, ::prost::Message)]
163pub struct TimestampRange {
164 #[prost(message, optional, tag = "1")]
165 pub from: ::core::option::Option<::prost_wkt_types::Timestamp>,
166 #[prost(message, optional, tag = "2")]
167 pub to: ::core::option::Option<::prost_wkt_types::Timestamp>,
168}
169#[derive(serde::Serialize, serde::Deserialize)]
170#[serde(rename_all = "snake_case")]
171#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
172#[repr(i32)]
173pub enum FilterOperator {
174 AndOrUnspecified = 0,
175 Or = 1,
176}
177impl FilterOperator {
178 pub fn as_str_name(&self) -> &'static str {
183 match self {
184 Self::AndOrUnspecified => "FILTER_OPERATOR_AND_OR_UNSPECIFIED",
185 Self::Or => "FILTER_OPERATOR_OR",
186 }
187 }
188 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
190 match value {
191 "FILTER_OPERATOR_AND_OR_UNSPECIFIED" => Some(Self::AndOrUnspecified),
192 "FILTER_OPERATOR_OR" => Some(Self::Or),
193 _ => None,
194 }
195 }
196}
197#[derive(serde::Serialize, serde::Deserialize)]
198#[serde(rename_all = "snake_case")]
199#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
200#[repr(i32)]
201pub enum FilterMatcher {
202 TextOrUnspecified = 0,
203 Regexp = 1,
204}
205impl FilterMatcher {
206 pub fn as_str_name(&self) -> &'static str {
211 match self {
212 Self::TextOrUnspecified => "FILTER_MATCHER_TEXT_OR_UNSPECIFIED",
213 Self::Regexp => "FILTER_MATCHER_REGEXP",
214 }
215 }
216 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
218 match value {
219 "FILTER_MATCHER_TEXT_OR_UNSPECIFIED" => Some(Self::TextOrUnspecified),
220 "FILTER_MATCHER_REGEXP" => Some(Self::Regexp),
221 _ => None,
222 }
223 }
224}
225#[derive(serde::Serialize, serde::Deserialize)]
226#[serde(rename_all = "snake_case")]
227#[derive(Clone, PartialEq, ::prost::Message)]
228pub struct CxEventArray {
229 #[prost(message, repeated, tag = "1")]
230 pub events: ::prost::alloc::vec::Vec<CxEvent>,
231}
232#[derive(serde::Serialize, serde::Deserialize)]
233#[serde(rename_all = "snake_case")]
234#[derive(Clone, PartialEq, ::prost::Message)]
235pub struct CxEventSingleOrMultiple {
236 #[prost(oneof = "cx_event_single_or_multiple::Event", tags = "1, 2")]
237 pub event: ::core::option::Option<cx_event_single_or_multiple::Event>,
238}
239pub mod cx_event_single_or_multiple {
241 #[derive(serde::Serialize, serde::Deserialize)]
242 #[serde(rename_all = "snake_case")]
243 #[derive(Clone, PartialEq, ::prost::Oneof)]
244 pub enum Event {
245 #[prost(message, tag = "1")]
246 SingleEvent(super::CxEvent),
247 #[prost(message, tag = "2")]
248 MultipleEvents(super::CxEventArray),
249 }
250}
251#[derive(serde::Serialize, serde::Deserialize)]
252#[serde(rename_all = "snake_case")]
253#[derive(Clone, PartialEq, ::prost::Message)]
254pub struct GetEventRequest {
255 #[prost(message, optional, tag = "1")]
256 pub id: ::core::option::Option<::prost::alloc::string::String>,
257 #[prost(message, repeated, tag = "2")]
258 pub order_bys: ::prost::alloc::vec::Vec<OrderBy>,
259 #[prost(message, optional, tag = "3")]
260 pub pagination: ::core::option::Option<PaginationRequest>,
261}
262#[derive(serde::Serialize, serde::Deserialize)]
263#[serde(rename_all = "snake_case")]
264#[derive(Clone, PartialEq, ::prost::Message)]
265pub struct GetEventResponse {
266 #[prost(message, optional, tag = "1")]
267 pub event: ::core::option::Option<CxEventSingleOrMultiple>,
268 #[prost(message, optional, tag = "2")]
269 pub pagination: ::core::option::Option<PaginationResponse>,
270}
271#[derive(serde::Serialize, serde::Deserialize)]
272#[serde(rename_all = "snake_case")]
273#[derive(Clone, PartialEq, ::prost::Message)]
274pub struct BatchGetEventRequest {
275 #[prost(message, repeated, tag = "1")]
276 pub ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
277 #[prost(message, repeated, tag = "2")]
278 pub order_bys: ::prost::alloc::vec::Vec<OrderBy>,
279 #[prost(message, optional, tag = "3")]
280 pub pagination: ::core::option::Option<PaginationRequest>,
281 #[prost(message, optional, tag = "4")]
282 pub filter: ::core::option::Option<EventsQueryFilter>,
283}
284#[derive(serde::Serialize, serde::Deserialize)]
285#[serde(rename_all = "snake_case")]
286#[derive(Clone, PartialEq, ::prost::Message)]
287pub struct BatchGetEventResponse {
288 #[prost(map = "string, message", tag = "1")]
289 pub events: ::std::collections::HashMap<
290 ::prost::alloc::string::String,
291 CxEventSingleOrMultiple,
292 >,
293 #[prost(message, repeated, tag = "2")]
294 pub not_found_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
295 #[prost(message, optional, tag = "3")]
296 pub pagination: ::core::option::Option<PaginationResponse>,
297}
298#[derive(serde::Serialize, serde::Deserialize)]
299#[serde(rename_all = "snake_case")]
300#[derive(Clone, PartialEq, ::prost::Message)]
301pub struct PaginationRequest {
302 #[prost(message, optional, tag = "1")]
303 pub page_size: ::core::option::Option<u32>,
304 #[prost(message, optional, tag = "2")]
305 pub page_token: ::core::option::Option<::prost::alloc::string::String>,
306}
307#[derive(serde::Serialize, serde::Deserialize)]
308#[serde(rename_all = "snake_case")]
309#[derive(Clone, PartialEq, ::prost::Message)]
310pub struct PaginationResponse {
311 #[prost(message, optional, tag = "1")]
312 pub total_size: ::core::option::Option<u32>,
313 #[prost(message, optional, tag = "2")]
314 pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
315}
316#[derive(serde::Serialize, serde::Deserialize)]
317#[serde(rename_all = "snake_case")]
318#[derive(Clone, PartialEq, ::prost::Message)]
319pub struct ListEventsRequest {
320 #[prost(message, optional, tag = "1")]
321 pub filter: ::core::option::Option<EventsFilter>,
322 #[prost(message, repeated, tag = "2")]
323 pub order_bys: ::prost::alloc::vec::Vec<OrderBy>,
324 #[prost(message, optional, tag = "3")]
325 pub pagination: ::core::option::Option<PaginationRequest>,
326}
327#[derive(serde::Serialize, serde::Deserialize)]
328#[serde(rename_all = "snake_case")]
329#[derive(Clone, PartialEq, ::prost::Message)]
330pub struct ListEventsResponse {
331 #[prost(message, repeated, tag = "1")]
332 pub events: ::prost::alloc::vec::Vec<CxEvent>,
333 #[prost(message, optional, tag = "2")]
334 pub pagination: ::core::option::Option<PaginationResponse>,
335}
336#[derive(serde::Serialize, serde::Deserialize)]
337#[serde(rename_all = "snake_case")]
338#[derive(Clone, PartialEq, ::prost::Message)]
339pub struct GetEventsStatisticsRequest {
340 #[prost(message, optional, tag = "1")]
341 pub filter: ::core::option::Option<EventsFilter>,
342}
343#[derive(serde::Serialize, serde::Deserialize)]
344#[serde(rename_all = "snake_case")]
345#[derive(Clone, PartialEq, ::prost::Message)]
346pub struct GetEventsStatisticsResponse {
347 #[prost(map = "string, message", tag = "1")]
348 pub cx_event_metadata_field_statistics: ::std::collections::HashMap<
349 ::prost::alloc::string::String,
350 FieldStatistics,
351 >,
352 #[prost(map = "string, message", tag = "2")]
353 pub cx_event_labels_field_statistics: ::std::collections::HashMap<
354 ::prost::alloc::string::String,
355 FieldStatistics,
356 >,
357}
358#[derive(serde::Serialize, serde::Deserialize)]
359#[serde(rename_all = "snake_case")]
360#[derive(Clone, PartialEq, ::prost::Message)]
361pub struct FieldStatistics {
362 #[prost(map = "string, message", tag = "1")]
363 pub field_statistics: ::std::collections::HashMap<
364 ::prost::alloc::string::String,
365 i64,
366 >,
367}
368#[derive(serde::Serialize, serde::Deserialize)]
369#[serde(rename_all = "snake_case")]
370#[derive(Clone, PartialEq, ::prost::Message)]
371pub struct ListEventsCountRequest {
372 #[prost(message, optional, tag = "1")]
373 pub filter: ::core::option::Option<EventsFilter>,
374}
375#[derive(serde::Serialize, serde::Deserialize)]
376#[serde(rename_all = "snake_case")]
377#[derive(Clone, Copy, PartialEq, ::prost::Message)]
378pub struct ListEventsCountResponse {
379 #[prost(message, optional, tag = "1")]
380 pub count: ::core::option::Option<u64>,
381 #[prost(message, optional, tag = "2")]
382 pub reached_limit: ::core::option::Option<bool>,
383}
384pub mod events_service_client {
386 #![allow(
387 unused_variables,
388 dead_code,
389 missing_docs,
390 clippy::wildcard_imports,
391 clippy::let_unit_value,
392 )]
393 use tonic::codegen::*;
394 use tonic::codegen::http::Uri;
395 #[derive(Debug, Clone)]
396 pub struct EventsServiceClient<T> {
397 inner: tonic::client::Grpc<T>,
398 }
399 impl EventsServiceClient<tonic::transport::Channel> {
400 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
402 where
403 D: TryInto<tonic::transport::Endpoint>,
404 D::Error: Into<StdError>,
405 {
406 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
407 Ok(Self::new(conn))
408 }
409 }
410 impl<T> EventsServiceClient<T>
411 where
412 T: tonic::client::GrpcService<tonic::body::BoxBody>,
413 T::Error: Into<StdError>,
414 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
415 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
416 {
417 pub fn new(inner: T) -> Self {
418 let inner = tonic::client::Grpc::new(inner);
419 Self { inner }
420 }
421 pub fn with_origin(inner: T, origin: Uri) -> Self {
422 let inner = tonic::client::Grpc::with_origin(inner, origin);
423 Self { inner }
424 }
425 pub fn with_interceptor<F>(
426 inner: T,
427 interceptor: F,
428 ) -> EventsServiceClient<InterceptedService<T, F>>
429 where
430 F: tonic::service::Interceptor,
431 T::ResponseBody: Default,
432 T: tonic::codegen::Service<
433 http::Request<tonic::body::BoxBody>,
434 Response = http::Response<
435 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
436 >,
437 >,
438 <T as tonic::codegen::Service<
439 http::Request<tonic::body::BoxBody>,
440 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
441 {
442 EventsServiceClient::new(InterceptedService::new(inner, interceptor))
443 }
444 #[must_use]
449 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
450 self.inner = self.inner.send_compressed(encoding);
451 self
452 }
453 #[must_use]
455 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
456 self.inner = self.inner.accept_compressed(encoding);
457 self
458 }
459 #[must_use]
463 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
464 self.inner = self.inner.max_decoding_message_size(limit);
465 self
466 }
467 #[must_use]
471 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
472 self.inner = self.inner.max_encoding_message_size(limit);
473 self
474 }
475 pub async fn get_event(
476 &mut self,
477 request: impl tonic::IntoRequest<super::GetEventRequest>,
478 ) -> std::result::Result<
479 tonic::Response<super::GetEventResponse>,
480 tonic::Status,
481 > {
482 self.inner
483 .ready()
484 .await
485 .map_err(|e| {
486 tonic::Status::unknown(
487 format!("Service was not ready: {}", e.into()),
488 )
489 })?;
490 let codec = tonic::codec::ProstCodec::default();
491 let path = http::uri::PathAndQuery::from_static(
492 "/com.coralogixapis.events.v3.EventsService/GetEvent",
493 );
494 let mut req = request.into_request();
495 req.extensions_mut()
496 .insert(
497 GrpcMethod::new(
498 "com.coralogixapis.events.v3.EventsService",
499 "GetEvent",
500 ),
501 );
502 self.inner.unary(req, path, codec).await
503 }
504 pub async fn batch_get_event(
505 &mut self,
506 request: impl tonic::IntoRequest<super::BatchGetEventRequest>,
507 ) -> std::result::Result<
508 tonic::Response<super::BatchGetEventResponse>,
509 tonic::Status,
510 > {
511 self.inner
512 .ready()
513 .await
514 .map_err(|e| {
515 tonic::Status::unknown(
516 format!("Service was not ready: {}", e.into()),
517 )
518 })?;
519 let codec = tonic::codec::ProstCodec::default();
520 let path = http::uri::PathAndQuery::from_static(
521 "/com.coralogixapis.events.v3.EventsService/BatchGetEvent",
522 );
523 let mut req = request.into_request();
524 req.extensions_mut()
525 .insert(
526 GrpcMethod::new(
527 "com.coralogixapis.events.v3.EventsService",
528 "BatchGetEvent",
529 ),
530 );
531 self.inner.unary(req, path, codec).await
532 }
533 pub async fn list_events(
534 &mut self,
535 request: impl tonic::IntoRequest<super::ListEventsRequest>,
536 ) -> std::result::Result<
537 tonic::Response<super::ListEventsResponse>,
538 tonic::Status,
539 > {
540 self.inner
541 .ready()
542 .await
543 .map_err(|e| {
544 tonic::Status::unknown(
545 format!("Service was not ready: {}", e.into()),
546 )
547 })?;
548 let codec = tonic::codec::ProstCodec::default();
549 let path = http::uri::PathAndQuery::from_static(
550 "/com.coralogixapis.events.v3.EventsService/ListEvents",
551 );
552 let mut req = request.into_request();
553 req.extensions_mut()
554 .insert(
555 GrpcMethod::new(
556 "com.coralogixapis.events.v3.EventsService",
557 "ListEvents",
558 ),
559 );
560 self.inner.unary(req, path, codec).await
561 }
562 pub async fn list_events_count(
563 &mut self,
564 request: impl tonic::IntoRequest<super::ListEventsCountRequest>,
565 ) -> std::result::Result<
566 tonic::Response<super::ListEventsCountResponse>,
567 tonic::Status,
568 > {
569 self.inner
570 .ready()
571 .await
572 .map_err(|e| {
573 tonic::Status::unknown(
574 format!("Service was not ready: {}", e.into()),
575 )
576 })?;
577 let codec = tonic::codec::ProstCodec::default();
578 let path = http::uri::PathAndQuery::from_static(
579 "/com.coralogixapis.events.v3.EventsService/ListEventsCount",
580 );
581 let mut req = request.into_request();
582 req.extensions_mut()
583 .insert(
584 GrpcMethod::new(
585 "com.coralogixapis.events.v3.EventsService",
586 "ListEventsCount",
587 ),
588 );
589 self.inner.unary(req, path, codec).await
590 }
591 pub async fn get_events_statistics(
592 &mut self,
593 request: impl tonic::IntoRequest<super::GetEventsStatisticsRequest>,
594 ) -> std::result::Result<
595 tonic::Response<super::GetEventsStatisticsResponse>,
596 tonic::Status,
597 > {
598 self.inner
599 .ready()
600 .await
601 .map_err(|e| {
602 tonic::Status::unknown(
603 format!("Service was not ready: {}", e.into()),
604 )
605 })?;
606 let codec = tonic::codec::ProstCodec::default();
607 let path = http::uri::PathAndQuery::from_static(
608 "/com.coralogixapis.events.v3.EventsService/GetEventsStatistics",
609 );
610 let mut req = request.into_request();
611 req.extensions_mut()
612 .insert(
613 GrpcMethod::new(
614 "com.coralogixapis.events.v3.EventsService",
615 "GetEventsStatistics",
616 ),
617 );
618 self.inner.unary(req, path, codec).await
619 }
620 }
621}