cx_api/generated/
com.coralogixapis.notification_center.routers.v1.rs

1// This file is @generated by prost-build.
2#[derive(serde::Serialize, serde::Deserialize)]
3#[serde(rename_all = "snake_case")]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct PrivateRoutingRule {
6    /// Condition template that is rendered to true or false and used to determine if the rule should be applied
7    #[prost(string, tag = "1")]
8    pub condition: ::prost::alloc::string::String,
9    /// List of targets to send the notification to
10    #[prost(message, repeated, tag = "2")]
11    pub targets: ::prost::alloc::vec::Vec<PrivateRoutingTarget>,
12    #[prost(map = "string, string", tag = "3")]
13    pub custom_details: ::std::collections::HashMap<
14        ::prost::alloc::string::String,
15        ::prost::alloc::string::String,
16    >,
17    #[prost(string, optional, tag = "4")]
18    pub name: ::core::option::Option<::prost::alloc::string::String>,
19}
20#[derive(serde::Serialize, serde::Deserialize)]
21#[serde(rename_all = "snake_case")]
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct PrivateRoutingTarget {
24    #[deprecated]
25    #[prost(message, optional, tag = "1")]
26    pub connector_identifier: ::core::option::Option<super::super::ConnectorIdentifier>,
27    #[deprecated]
28    #[prost(message, optional, tag = "2")]
29    pub preset_identifier: ::core::option::Option<super::super::PresetIdentifier>,
30    #[prost(message, optional, tag = "3")]
31    pub config_overrides: ::core::option::Option<super::super::routing::SourceOverrides>,
32    #[prost(map = "string, string", tag = "4")]
33    pub custom_details: ::std::collections::HashMap<
34        ::prost::alloc::string::String,
35        ::prost::alloc::string::String,
36    >,
37    #[prost(string, tag = "5")]
38    pub connector_id: ::prost::alloc::string::String,
39    #[prost(string, optional, tag = "6")]
40    pub preset_id: ::core::option::Option<::prost::alloc::string::String>,
41}
42/// The private router allows notification destinations and routing rules
43/// to be specified as part of the notification request.
44#[derive(serde::Serialize, serde::Deserialize)]
45#[serde(rename_all = "snake_case")]
46#[derive(Clone, PartialEq, ::prost::Message)]
47pub struct PrivateRouter {
48    #[prost(string, tag = "1")]
49    pub router_key: ::prost::alloc::string::String,
50    #[prost(message, repeated, tag = "4")]
51    pub rules: ::prost::alloc::vec::Vec<PrivateRoutingRule>,
52    #[prost(message, repeated, tag = "5")]
53    pub fallback: ::prost::alloc::vec::Vec<PrivateRoutingTarget>,
54}
55/// The global router contains a pre-configured list of routing rules
56/// and can be specified as a part of the notification request.
57#[derive(serde::Serialize, serde::Deserialize)]
58#[serde(rename_all = "snake_case")]
59#[derive(Clone, PartialEq, ::prost::Message)]
60pub struct GlobalRouter {
61    /// A unique identifier - automatically generated unless provided by the user
62    #[prost(string, optional, tag = "1")]
63    pub id: ::core::option::Option<::prost::alloc::string::String>,
64    /// DEPRECATED - A unique identifier provided by the user
65    #[deprecated]
66    #[prost(string, optional, tag = "2")]
67    pub user_defined_id: ::core::option::Option<::prost::alloc::string::String>,
68    /// The source of the notification (e.g., "alerts")
69    #[deprecated]
70    #[prost(string, tag = "3")]
71    pub deprecated_entity_type: ::prost::alloc::string::String,
72    #[prost(string, tag = "4")]
73    pub name: ::prost::alloc::string::String,
74    #[prost(string, tag = "5")]
75    pub description: ::prost::alloc::string::String,
76    /// The routing rules to be applied in order to determine the destinations of the notification, teh first rule that matches will be used
77    #[prost(message, repeated, tag = "6")]
78    pub rules: ::prost::alloc::vec::Vec<super::super::routing::RoutingRule>,
79    /// The fallback destinations to be used if no rule matches
80    #[prost(message, repeated, tag = "7")]
81    pub fallback: ::prost::alloc::vec::Vec<super::super::routing::RoutingTarget>,
82    /// System-generated timestamp for when the router was last updated
83    #[prost(message, optional, tag = "8")]
84    pub create_time: ::core::option::Option<::prost_wkt_types::Timestamp>,
85    /// System-generated timestamp for when the router was last updated
86    #[prost(message, optional, tag = "9")]
87    pub update_time: ::core::option::Option<::prost_wkt_types::Timestamp>,
88    #[prost(map = "string, string", tag = "10")]
89    pub entity_labels: ::std::collections::HashMap<
90        ::prost::alloc::string::String,
91        ::prost::alloc::string::String,
92    >,
93    #[prost(enumeration = "super::super::EntityType", tag = "11")]
94    pub entity_type: i32,
95}
96#[derive(serde::Serialize, serde::Deserialize)]
97#[serde(rename_all = "snake_case")]
98#[derive(Clone, PartialEq, ::prost::Message)]
99pub struct CreateGlobalRouterRequest {
100    #[prost(message, optional, tag = "1")]
101    pub router: ::core::option::Option<GlobalRouter>,
102}
103#[derive(serde::Serialize, serde::Deserialize)]
104#[serde(rename_all = "snake_case")]
105#[derive(Clone, PartialEq, ::prost::Message)]
106pub struct CreateGlobalRouterResponse {
107    #[prost(message, optional, tag = "1")]
108    pub router: ::core::option::Option<GlobalRouter>,
109}
110#[derive(serde::Serialize, serde::Deserialize)]
111#[serde(rename_all = "snake_case")]
112#[derive(Clone, PartialEq, ::prost::Message)]
113pub struct ReplaceGlobalRouterRequest {
114    #[prost(message, optional, tag = "1")]
115    pub router: ::core::option::Option<GlobalRouter>,
116}
117#[derive(serde::Serialize, serde::Deserialize)]
118#[serde(rename_all = "snake_case")]
119#[derive(Clone, PartialEq, ::prost::Message)]
120pub struct ReplaceGlobalRouterResponse {
121    #[prost(message, optional, tag = "1")]
122    pub router: ::core::option::Option<GlobalRouter>,
123}
124#[derive(serde::Serialize, serde::Deserialize)]
125#[serde(rename_all = "snake_case")]
126#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct CreateOrReplaceGlobalRouterRequest {
128    #[prost(message, optional, tag = "1")]
129    pub router: ::core::option::Option<GlobalRouter>,
130}
131#[derive(serde::Serialize, serde::Deserialize)]
132#[serde(rename_all = "snake_case")]
133#[derive(Clone, PartialEq, ::prost::Message)]
134pub struct CreateOrReplaceGlobalRouterResponse {
135    #[prost(message, optional, tag = "1")]
136    pub router: ::core::option::Option<GlobalRouter>,
137}
138#[derive(serde::Serialize, serde::Deserialize)]
139#[serde(rename_all = "snake_case")]
140#[derive(Clone, PartialEq, ::prost::Message)]
141pub struct DeleteGlobalRouterRequest {
142    #[deprecated]
143    #[prost(message, optional, tag = "1")]
144    pub deprecated_identifier: ::core::option::Option<
145        super::super::routing::GlobalRouterIdentifier,
146    >,
147    #[deprecated]
148    #[prost(message, optional, tag = "2")]
149    pub identifier: ::core::option::Option<super::super::GlobalRouterIdentifier>,
150    #[prost(string, tag = "3")]
151    pub id: ::prost::alloc::string::String,
152}
153#[derive(serde::Serialize, serde::Deserialize)]
154#[serde(rename_all = "snake_case")]
155#[derive(Clone, Copy, PartialEq, ::prost::Message)]
156pub struct DeleteGlobalRouterResponse {}
157#[derive(serde::Serialize, serde::Deserialize)]
158#[serde(rename_all = "snake_case")]
159#[derive(Clone, PartialEq, ::prost::Message)]
160pub struct GetGlobalRouterRequest {
161    #[deprecated]
162    #[prost(message, optional, tag = "1")]
163    pub deprecated_identifier: ::core::option::Option<
164        super::super::routing::GlobalRouterIdentifier,
165    >,
166    #[deprecated]
167    #[prost(message, optional, tag = "2")]
168    pub identifier: ::core::option::Option<super::super::GlobalRouterIdentifier>,
169    #[prost(string, tag = "3")]
170    pub id: ::prost::alloc::string::String,
171}
172#[derive(serde::Serialize, serde::Deserialize)]
173#[serde(rename_all = "snake_case")]
174#[derive(Clone, PartialEq, ::prost::Message)]
175pub struct GetGlobalRouterResponse {
176    #[prost(message, optional, tag = "1")]
177    pub router: ::core::option::Option<GlobalRouter>,
178}
179#[derive(serde::Serialize, serde::Deserialize)]
180#[serde(rename_all = "snake_case")]
181#[derive(Clone, PartialEq, ::prost::Message)]
182pub struct ListGlobalRoutersRequest {
183    #[deprecated]
184    #[prost(string, optional, tag = "1")]
185    pub deprecated_entity_type: ::core::option::Option<::prost::alloc::string::String>,
186    #[prost(enumeration = "super::super::EntityType", optional, tag = "2")]
187    pub entity_type: ::core::option::Option<i32>,
188}
189#[derive(serde::Serialize, serde::Deserialize)]
190#[serde(rename_all = "snake_case")]
191#[derive(Clone, PartialEq, ::prost::Message)]
192pub struct ListGlobalRoutersResponse {
193    #[prost(message, repeated, tag = "1")]
194    pub routers: ::prost::alloc::vec::Vec<GlobalRouter>,
195}
196#[derive(serde::Serialize, serde::Deserialize)]
197#[serde(rename_all = "snake_case")]
198#[derive(Clone, PartialEq, ::prost::Message)]
199pub struct BatchGetGlobalRoutersRequest {
200    #[deprecated]
201    #[prost(message, repeated, tag = "1")]
202    pub deprecated_ids: ::prost::alloc::vec::Vec<
203        super::super::routing::GlobalRouterIdentifier,
204    >,
205    #[deprecated]
206    #[prost(message, repeated, tag = "2")]
207    pub ids: ::prost::alloc::vec::Vec<super::super::GlobalRouterIdentifier>,
208    #[prost(string, repeated, tag = "3")]
209    pub global_router_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
210}
211#[derive(serde::Serialize, serde::Deserialize)]
212#[serde(rename_all = "snake_case")]
213#[derive(Clone, PartialEq, ::prost::Message)]
214pub struct BatchGetGlobalRoutersResponse {
215    #[prost(map = "string, message", tag = "1")]
216    pub routers: ::std::collections::HashMap<
217        ::prost::alloc::string::String,
218        GlobalRouter,
219    >,
220    #[prost(string, repeated, tag = "2")]
221    pub not_found_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
222}
223/// Generated client implementations.
224pub mod global_routers_service_client {
225    #![allow(
226        unused_variables,
227        dead_code,
228        missing_docs,
229        clippy::wildcard_imports,
230        clippy::let_unit_value,
231    )]
232    use tonic::codegen::*;
233    use tonic::codegen::http::Uri;
234    /// Public API that allows managing global routers
235    #[derive(Debug, Clone)]
236    pub struct GlobalRoutersServiceClient<T> {
237        inner: tonic::client::Grpc<T>,
238    }
239    impl GlobalRoutersServiceClient<tonic::transport::Channel> {
240        /// Attempt to create a new client by connecting to a given endpoint.
241        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
242        where
243            D: TryInto<tonic::transport::Endpoint>,
244            D::Error: Into<StdError>,
245        {
246            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
247            Ok(Self::new(conn))
248        }
249    }
250    impl<T> GlobalRoutersServiceClient<T>
251    where
252        T: tonic::client::GrpcService<tonic::body::BoxBody>,
253        T::Error: Into<StdError>,
254        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
255        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
256    {
257        pub fn new(inner: T) -> Self {
258            let inner = tonic::client::Grpc::new(inner);
259            Self { inner }
260        }
261        pub fn with_origin(inner: T, origin: Uri) -> Self {
262            let inner = tonic::client::Grpc::with_origin(inner, origin);
263            Self { inner }
264        }
265        pub fn with_interceptor<F>(
266            inner: T,
267            interceptor: F,
268        ) -> GlobalRoutersServiceClient<InterceptedService<T, F>>
269        where
270            F: tonic::service::Interceptor,
271            T::ResponseBody: Default,
272            T: tonic::codegen::Service<
273                http::Request<tonic::body::BoxBody>,
274                Response = http::Response<
275                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
276                >,
277            >,
278            <T as tonic::codegen::Service<
279                http::Request<tonic::body::BoxBody>,
280            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
281        {
282            GlobalRoutersServiceClient::new(InterceptedService::new(inner, interceptor))
283        }
284        /// Compress requests with the given encoding.
285        ///
286        /// This requires the server to support it otherwise it might respond with an
287        /// error.
288        #[must_use]
289        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
290            self.inner = self.inner.send_compressed(encoding);
291            self
292        }
293        /// Enable decompressing responses.
294        #[must_use]
295        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
296            self.inner = self.inner.accept_compressed(encoding);
297            self
298        }
299        /// Limits the maximum size of a decoded message.
300        ///
301        /// Default: `4MB`
302        #[must_use]
303        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
304            self.inner = self.inner.max_decoding_message_size(limit);
305            self
306        }
307        /// Limits the maximum size of an encoded message.
308        ///
309        /// Default: `usize::MAX`
310        #[must_use]
311        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
312            self.inner = self.inner.max_encoding_message_size(limit);
313            self
314        }
315        pub async fn create_global_router(
316            &mut self,
317            request: impl tonic::IntoRequest<super::CreateGlobalRouterRequest>,
318        ) -> std::result::Result<
319            tonic::Response<super::CreateGlobalRouterResponse>,
320            tonic::Status,
321        > {
322            self.inner
323                .ready()
324                .await
325                .map_err(|e| {
326                    tonic::Status::unknown(
327                        format!("Service was not ready: {}", e.into()),
328                    )
329                })?;
330            let codec = tonic::codec::ProstCodec::default();
331            let path = http::uri::PathAndQuery::from_static(
332                "/com.coralogixapis.notification_center.routers.v1.GlobalRoutersService/CreateGlobalRouter",
333            );
334            let mut req = request.into_request();
335            req.extensions_mut()
336                .insert(
337                    GrpcMethod::new(
338                        "com.coralogixapis.notification_center.routers.v1.GlobalRoutersService",
339                        "CreateGlobalRouter",
340                    ),
341                );
342            self.inner.unary(req, path, codec).await
343        }
344        pub async fn replace_global_router(
345            &mut self,
346            request: impl tonic::IntoRequest<super::ReplaceGlobalRouterRequest>,
347        ) -> std::result::Result<
348            tonic::Response<super::ReplaceGlobalRouterResponse>,
349            tonic::Status,
350        > {
351            self.inner
352                .ready()
353                .await
354                .map_err(|e| {
355                    tonic::Status::unknown(
356                        format!("Service was not ready: {}", e.into()),
357                    )
358                })?;
359            let codec = tonic::codec::ProstCodec::default();
360            let path = http::uri::PathAndQuery::from_static(
361                "/com.coralogixapis.notification_center.routers.v1.GlobalRoutersService/ReplaceGlobalRouter",
362            );
363            let mut req = request.into_request();
364            req.extensions_mut()
365                .insert(
366                    GrpcMethod::new(
367                        "com.coralogixapis.notification_center.routers.v1.GlobalRoutersService",
368                        "ReplaceGlobalRouter",
369                    ),
370                );
371            self.inner.unary(req, path, codec).await
372        }
373        pub async fn create_or_replace_global_router(
374            &mut self,
375            request: impl tonic::IntoRequest<super::CreateOrReplaceGlobalRouterRequest>,
376        ) -> std::result::Result<
377            tonic::Response<super::CreateOrReplaceGlobalRouterResponse>,
378            tonic::Status,
379        > {
380            self.inner
381                .ready()
382                .await
383                .map_err(|e| {
384                    tonic::Status::unknown(
385                        format!("Service was not ready: {}", e.into()),
386                    )
387                })?;
388            let codec = tonic::codec::ProstCodec::default();
389            let path = http::uri::PathAndQuery::from_static(
390                "/com.coralogixapis.notification_center.routers.v1.GlobalRoutersService/CreateOrReplaceGlobalRouter",
391            );
392            let mut req = request.into_request();
393            req.extensions_mut()
394                .insert(
395                    GrpcMethod::new(
396                        "com.coralogixapis.notification_center.routers.v1.GlobalRoutersService",
397                        "CreateOrReplaceGlobalRouter",
398                    ),
399                );
400            self.inner.unary(req, path, codec).await
401        }
402        pub async fn delete_global_router(
403            &mut self,
404            request: impl tonic::IntoRequest<super::DeleteGlobalRouterRequest>,
405        ) -> std::result::Result<
406            tonic::Response<super::DeleteGlobalRouterResponse>,
407            tonic::Status,
408        > {
409            self.inner
410                .ready()
411                .await
412                .map_err(|e| {
413                    tonic::Status::unknown(
414                        format!("Service was not ready: {}", e.into()),
415                    )
416                })?;
417            let codec = tonic::codec::ProstCodec::default();
418            let path = http::uri::PathAndQuery::from_static(
419                "/com.coralogixapis.notification_center.routers.v1.GlobalRoutersService/DeleteGlobalRouter",
420            );
421            let mut req = request.into_request();
422            req.extensions_mut()
423                .insert(
424                    GrpcMethod::new(
425                        "com.coralogixapis.notification_center.routers.v1.GlobalRoutersService",
426                        "DeleteGlobalRouter",
427                    ),
428                );
429            self.inner.unary(req, path, codec).await
430        }
431        pub async fn get_global_router(
432            &mut self,
433            request: impl tonic::IntoRequest<super::GetGlobalRouterRequest>,
434        ) -> std::result::Result<
435            tonic::Response<super::GetGlobalRouterResponse>,
436            tonic::Status,
437        > {
438            self.inner
439                .ready()
440                .await
441                .map_err(|e| {
442                    tonic::Status::unknown(
443                        format!("Service was not ready: {}", e.into()),
444                    )
445                })?;
446            let codec = tonic::codec::ProstCodec::default();
447            let path = http::uri::PathAndQuery::from_static(
448                "/com.coralogixapis.notification_center.routers.v1.GlobalRoutersService/GetGlobalRouter",
449            );
450            let mut req = request.into_request();
451            req.extensions_mut()
452                .insert(
453                    GrpcMethod::new(
454                        "com.coralogixapis.notification_center.routers.v1.GlobalRoutersService",
455                        "GetGlobalRouter",
456                    ),
457                );
458            self.inner.unary(req, path, codec).await
459        }
460        pub async fn list_global_routers(
461            &mut self,
462            request: impl tonic::IntoRequest<super::ListGlobalRoutersRequest>,
463        ) -> std::result::Result<
464            tonic::Response<super::ListGlobalRoutersResponse>,
465            tonic::Status,
466        > {
467            self.inner
468                .ready()
469                .await
470                .map_err(|e| {
471                    tonic::Status::unknown(
472                        format!("Service was not ready: {}", e.into()),
473                    )
474                })?;
475            let codec = tonic::codec::ProstCodec::default();
476            let path = http::uri::PathAndQuery::from_static(
477                "/com.coralogixapis.notification_center.routers.v1.GlobalRoutersService/ListGlobalRouters",
478            );
479            let mut req = request.into_request();
480            req.extensions_mut()
481                .insert(
482                    GrpcMethod::new(
483                        "com.coralogixapis.notification_center.routers.v1.GlobalRoutersService",
484                        "ListGlobalRouters",
485                    ),
486                );
487            self.inner.unary(req, path, codec).await
488        }
489        pub async fn batch_get_global_routers(
490            &mut self,
491            request: impl tonic::IntoRequest<super::BatchGetGlobalRoutersRequest>,
492        ) -> std::result::Result<
493            tonic::Response<super::BatchGetGlobalRoutersResponse>,
494            tonic::Status,
495        > {
496            self.inner
497                .ready()
498                .await
499                .map_err(|e| {
500                    tonic::Status::unknown(
501                        format!("Service was not ready: {}", e.into()),
502                    )
503                })?;
504            let codec = tonic::codec::ProstCodec::default();
505            let path = http::uri::PathAndQuery::from_static(
506                "/com.coralogixapis.notification_center.routers.v1.GlobalRoutersService/BatchGetGlobalRouters",
507            );
508            let mut req = request.into_request();
509            req.extensions_mut()
510                .insert(
511                    GrpcMethod::new(
512                        "com.coralogixapis.notification_center.routers.v1.GlobalRoutersService",
513                        "BatchGetGlobalRouters",
514                    ),
515                );
516            self.inner.unary(req, path, codec).await
517        }
518    }
519}