cx_api/generated/
com.coralogixapis.notification_center.notifications.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 TestResult {
6    #[prost(oneof = "test_result::Result", tags = "1, 2")]
7    pub result: ::core::option::Option<test_result::Result>,
8}
9/// Nested message and enum types in `TestResult`.
10pub mod test_result {
11    #[derive(serde::Serialize, serde::Deserialize)]
12    #[serde(rename_all = "snake_case")]
13    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
14    pub struct Success {}
15    #[derive(serde::Serialize, serde::Deserialize)]
16    #[serde(rename_all = "snake_case")]
17    #[derive(Clone, PartialEq, ::prost::Message)]
18    pub struct Failure {
19        #[prost(string, tag = "1")]
20        pub message: ::prost::alloc::string::String,
21        #[prost(uint32, optional, tag = "2")]
22        pub status_code: ::core::option::Option<u32>,
23    }
24    #[derive(serde::Serialize, serde::Deserialize)]
25    #[serde(rename_all = "snake_case")]
26    #[derive(Clone, PartialEq, ::prost::Oneof)]
27    pub enum Result {
28        #[prost(message, tag = "1")]
29        Success(Success),
30        #[prost(message, tag = "2")]
31        Failure(Failure),
32    }
33}
34#[derive(serde::Serialize, serde::Deserialize)]
35#[serde(rename_all = "snake_case")]
36#[derive(Clone, PartialEq, ::prost::Message)]
37pub struct TestConnectorConfigRequest {
38    #[prost(enumeration = "super::super::ConnectorType", tag = "1")]
39    pub r#type: i32,
40    #[prost(string, tag = "2")]
41    pub payload_type: ::prost::alloc::string::String,
42    #[prost(message, repeated, tag = "3")]
43    pub fields: ::prost::alloc::vec::Vec<super::super::ConnectorConfigField>,
44    #[prost(enumeration = "super::super::EntityType", optional, tag = "5")]
45    pub entity_type: ::core::option::Option<i32>,
46}
47#[derive(serde::Serialize, serde::Deserialize)]
48#[serde(rename_all = "snake_case")]
49#[derive(Clone, PartialEq, ::prost::Message)]
50pub struct TestConnectorConfigResponse {
51    #[prost(message, optional, tag = "1")]
52    pub result: ::core::option::Option<TestResult>,
53}
54#[derive(serde::Serialize, serde::Deserialize)]
55#[serde(rename_all = "snake_case")]
56#[derive(Clone, PartialEq, ::prost::Message)]
57pub struct TestExistingConnectorRequest {
58    #[prost(string, tag = "2")]
59    pub payload_type: ::prost::alloc::string::String,
60    #[prost(string, tag = "4")]
61    pub connector_id: ::prost::alloc::string::String,
62}
63#[derive(serde::Serialize, serde::Deserialize)]
64#[serde(rename_all = "snake_case")]
65#[derive(Clone, PartialEq, ::prost::Message)]
66pub struct TestExistingConnectorResponse {
67    #[prost(message, optional, tag = "1")]
68    pub result: ::core::option::Option<TestResult>,
69}
70#[derive(serde::Serialize, serde::Deserialize)]
71#[serde(rename_all = "snake_case")]
72#[derive(Clone, PartialEq, ::prost::Message)]
73pub struct TestPresetConfigRequest {
74    #[prost(string, optional, tag = "2")]
75    pub entity_sub_type: ::core::option::Option<::prost::alloc::string::String>,
76    #[prost(message, repeated, tag = "7")]
77    pub config_overrides: ::prost::alloc::vec::Vec<super::super::ConfigOverrides>,
78    #[prost(enumeration = "super::super::EntityType", tag = "10")]
79    pub entity_type: i32,
80    #[prost(string, tag = "11")]
81    pub connector_id: ::prost::alloc::string::String,
82    #[prost(string, tag = "12")]
83    pub parent_preset_id: ::prost::alloc::string::String,
84}
85#[derive(serde::Serialize, serde::Deserialize)]
86#[serde(rename_all = "snake_case")]
87#[derive(Clone, PartialEq, ::prost::Message)]
88pub struct TestPresetConfigResponse {
89    #[prost(message, optional, tag = "1")]
90    pub result: ::core::option::Option<TestResult>,
91}
92#[derive(serde::Serialize, serde::Deserialize)]
93#[serde(rename_all = "snake_case")]
94#[derive(Clone, PartialEq, ::prost::Message)]
95pub struct TestExistingPresetRequest {
96    #[prost(string, optional, tag = "2")]
97    pub entity_sub_type: ::core::option::Option<::prost::alloc::string::String>,
98    #[prost(enumeration = "super::super::EntityType", tag = "7")]
99    pub entity_type: i32,
100    #[prost(string, tag = "8")]
101    pub connector_id: ::prost::alloc::string::String,
102    #[prost(string, tag = "9")]
103    pub preset_id: ::prost::alloc::string::String,
104}
105#[derive(serde::Serialize, serde::Deserialize)]
106#[serde(rename_all = "snake_case")]
107#[derive(Clone, PartialEq, ::prost::Message)]
108pub struct TestExistingPresetResponse {
109    #[prost(message, optional, tag = "1")]
110    pub result: ::core::option::Option<TestResult>,
111}
112#[derive(serde::Serialize, serde::Deserialize)]
113#[serde(rename_all = "snake_case")]
114#[derive(Clone, PartialEq, ::prost::Message)]
115pub struct TestDestinationRequest {
116    #[prost(string, optional, tag = "2")]
117    pub entity_sub_type: ::core::option::Option<::prost::alloc::string::String>,
118    #[prost(string, tag = "5")]
119    pub payload_type: ::prost::alloc::string::String,
120    #[prost(message, repeated, tag = "7")]
121    pub message_config_fields: ::prost::alloc::vec::Vec<
122        super::super::MessageConfigField,
123    >,
124    #[prost(enumeration = "super::super::EntityType", tag = "10")]
125    pub entity_type: i32,
126    #[prost(message, repeated, tag = "11")]
127    pub connector_config_fields: ::prost::alloc::vec::Vec<
128        super::super::TemplatedConnectorConfigField,
129    >,
130    #[prost(string, tag = "12")]
131    pub connector_id: ::prost::alloc::string::String,
132    #[prost(string, tag = "13")]
133    pub preset_id: ::prost::alloc::string::String,
134}
135#[derive(serde::Serialize, serde::Deserialize)]
136#[serde(rename_all = "snake_case")]
137#[derive(Clone, PartialEq, ::prost::Message)]
138pub struct TestDestinationResponse {
139    #[prost(message, optional, tag = "1")]
140    pub result: ::core::option::Option<TestResult>,
141}
142#[derive(serde::Serialize, serde::Deserialize)]
143#[serde(rename_all = "snake_case")]
144#[derive(Clone, PartialEq, ::prost::Message)]
145pub struct TestTemplateRenderRequest {
146    #[prost(string, optional, tag = "2")]
147    pub entity_sub_type: ::core::option::Option<::prost::alloc::string::String>,
148    #[prost(string, tag = "3")]
149    pub template: ::prost::alloc::string::String,
150    #[prost(enumeration = "super::super::EntityType", tag = "4")]
151    pub entity_type: i32,
152}
153#[derive(serde::Serialize, serde::Deserialize)]
154#[serde(rename_all = "snake_case")]
155#[derive(Clone, PartialEq, ::prost::Message)]
156pub struct TestTemplateRenderResult {
157    #[prost(oneof = "test_template_render_result::Result", tags = "1, 2")]
158    pub result: ::core::option::Option<test_template_render_result::Result>,
159}
160/// Nested message and enum types in `TestTemplateRenderResult`.
161pub mod test_template_render_result {
162    #[derive(serde::Serialize, serde::Deserialize)]
163    #[serde(rename_all = "snake_case")]
164    #[derive(Clone, PartialEq, ::prost::Message)]
165    pub struct Success {
166        #[prost(string, tag = "1")]
167        pub rendered_value: ::prost::alloc::string::String,
168    }
169    #[derive(serde::Serialize, serde::Deserialize)]
170    #[serde(rename_all = "snake_case")]
171    #[derive(Clone, PartialEq, ::prost::Message)]
172    pub struct Failure {
173        #[prost(string, tag = "1")]
174        pub message: ::prost::alloc::string::String,
175        #[prost(enumeration = "FailureReason", tag = "2")]
176        pub reason: i32,
177    }
178    #[derive(serde::Serialize, serde::Deserialize)]
179    #[serde(rename_all = "snake_case")]
180    #[derive(
181        Clone,
182        Copy,
183        Debug,
184        PartialEq,
185        Eq,
186        Hash,
187        PartialOrd,
188        Ord,
189        ::prost::Enumeration
190    )]
191    #[repr(i32)]
192    pub enum FailureReason {
193        Unspecified = 0,
194        InvalidTemplate = 1,
195        FieldNotFound = 2,
196        TemplateExceedsMaxLength = 3,
197        RenderedValueExceedsMaxLength = 4,
198    }
199    impl FailureReason {
200        /// String value of the enum field names used in the ProtoBuf definition.
201        ///
202        /// The values are not transformed in any way and thus are considered stable
203        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
204        pub fn as_str_name(&self) -> &'static str {
205            match self {
206                Self::Unspecified => "FAILURE_REASON_UNSPECIFIED",
207                Self::InvalidTemplate => "INVALID_TEMPLATE",
208                Self::FieldNotFound => "FIELD_NOT_FOUND",
209                Self::TemplateExceedsMaxLength => "TEMPLATE_EXCEEDS_MAX_LENGTH",
210                Self::RenderedValueExceedsMaxLength => {
211                    "RENDERED_VALUE_EXCEEDS_MAX_LENGTH"
212                }
213            }
214        }
215        /// Creates an enum from field names used in the ProtoBuf definition.
216        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
217            match value {
218                "FAILURE_REASON_UNSPECIFIED" => Some(Self::Unspecified),
219                "INVALID_TEMPLATE" => Some(Self::InvalidTemplate),
220                "FIELD_NOT_FOUND" => Some(Self::FieldNotFound),
221                "TEMPLATE_EXCEEDS_MAX_LENGTH" => Some(Self::TemplateExceedsMaxLength),
222                "RENDERED_VALUE_EXCEEDS_MAX_LENGTH" => {
223                    Some(Self::RenderedValueExceedsMaxLength)
224                }
225                _ => None,
226            }
227        }
228    }
229    #[derive(serde::Serialize, serde::Deserialize)]
230    #[serde(rename_all = "snake_case")]
231    #[derive(Clone, PartialEq, ::prost::Oneof)]
232    pub enum Result {
233        #[prost(message, tag = "1")]
234        Success(Success),
235        #[prost(message, tag = "2")]
236        Failure(Failure),
237    }
238}
239#[derive(serde::Serialize, serde::Deserialize)]
240#[serde(rename_all = "snake_case")]
241#[derive(Clone, PartialEq, ::prost::Message)]
242pub struct TestTemplateRenderResponse {
243    #[prost(message, optional, tag = "1")]
244    pub result: ::core::option::Option<TestTemplateRenderResult>,
245}
246#[derive(serde::Serialize, serde::Deserialize)]
247#[serde(rename_all = "snake_case")]
248#[derive(Clone, PartialEq, ::prost::Message)]
249pub struct TestRoutingConditionValidRequest {
250    #[prost(string, tag = "2")]
251    pub template: ::prost::alloc::string::String,
252    #[prost(enumeration = "super::super::EntityType", tag = "3")]
253    pub entity_type: i32,
254}
255#[derive(serde::Serialize, serde::Deserialize)]
256#[serde(rename_all = "snake_case")]
257#[derive(Clone, PartialEq, ::prost::Message)]
258pub struct TestRoutingConditionValidResponse {
259    #[prost(oneof = "test_routing_condition_valid_response::Result", tags = "1, 2")]
260    pub result: ::core::option::Option<test_routing_condition_valid_response::Result>,
261}
262/// Nested message and enum types in `TestRoutingConditionValidResponse`.
263pub mod test_routing_condition_valid_response {
264    #[derive(serde::Serialize, serde::Deserialize)]
265    #[serde(rename_all = "snake_case")]
266    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
267    pub struct Success {
268        #[prost(bool, tag = "1")]
269        pub result: bool,
270    }
271    #[derive(serde::Serialize, serde::Deserialize)]
272    #[serde(rename_all = "snake_case")]
273    #[derive(Clone, PartialEq, ::prost::Message)]
274    pub struct Failure {
275        #[prost(string, tag = "1")]
276        pub message: ::prost::alloc::string::String,
277    }
278    #[derive(serde::Serialize, serde::Deserialize)]
279    #[serde(rename_all = "snake_case")]
280    #[derive(Clone, PartialEq, ::prost::Oneof)]
281    pub enum Result {
282        #[prost(message, tag = "1")]
283        Success(Success),
284        #[prost(message, tag = "2")]
285        Failure(Failure),
286    }
287}
288/// Generated client implementations.
289pub mod testing_service_client {
290    #![allow(
291        unused_variables,
292        dead_code,
293        missing_docs,
294        clippy::wildcard_imports,
295        clippy::let_unit_value,
296    )]
297    use tonic::codegen::*;
298    use tonic::codegen::http::Uri;
299    /// Public API for testing Notification Center configurations including connectors, presets, and templates.
300    #[derive(Debug, Clone)]
301    pub struct TestingServiceClient<T> {
302        inner: tonic::client::Grpc<T>,
303    }
304    impl TestingServiceClient<tonic::transport::Channel> {
305        /// Attempt to create a new client by connecting to a given endpoint.
306        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
307        where
308            D: TryInto<tonic::transport::Endpoint>,
309            D::Error: Into<StdError>,
310        {
311            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
312            Ok(Self::new(conn))
313        }
314    }
315    impl<T> TestingServiceClient<T>
316    where
317        T: tonic::client::GrpcService<tonic::body::BoxBody>,
318        T::Error: Into<StdError>,
319        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
320        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
321    {
322        pub fn new(inner: T) -> Self {
323            let inner = tonic::client::Grpc::new(inner);
324            Self { inner }
325        }
326        pub fn with_origin(inner: T, origin: Uri) -> Self {
327            let inner = tonic::client::Grpc::with_origin(inner, origin);
328            Self { inner }
329        }
330        pub fn with_interceptor<F>(
331            inner: T,
332            interceptor: F,
333        ) -> TestingServiceClient<InterceptedService<T, F>>
334        where
335            F: tonic::service::Interceptor,
336            T::ResponseBody: Default,
337            T: tonic::codegen::Service<
338                http::Request<tonic::body::BoxBody>,
339                Response = http::Response<
340                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
341                >,
342            >,
343            <T as tonic::codegen::Service<
344                http::Request<tonic::body::BoxBody>,
345            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
346        {
347            TestingServiceClient::new(InterceptedService::new(inner, interceptor))
348        }
349        /// Compress requests with the given encoding.
350        ///
351        /// This requires the server to support it otherwise it might respond with an
352        /// error.
353        #[must_use]
354        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
355            self.inner = self.inner.send_compressed(encoding);
356            self
357        }
358        /// Enable decompressing responses.
359        #[must_use]
360        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
361            self.inner = self.inner.accept_compressed(encoding);
362            self
363        }
364        /// Limits the maximum size of a decoded message.
365        ///
366        /// Default: `4MB`
367        #[must_use]
368        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
369            self.inner = self.inner.max_decoding_message_size(limit);
370            self
371        }
372        /// Limits the maximum size of an encoded message.
373        ///
374        /// Default: `usize::MAX`
375        #[must_use]
376        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
377            self.inner = self.inner.max_encoding_message_size(limit);
378            self
379        }
380        pub async fn test_connector_config(
381            &mut self,
382            request: impl tonic::IntoRequest<super::TestConnectorConfigRequest>,
383        ) -> std::result::Result<
384            tonic::Response<super::TestConnectorConfigResponse>,
385            tonic::Status,
386        > {
387            self.inner
388                .ready()
389                .await
390                .map_err(|e| {
391                    tonic::Status::unknown(
392                        format!("Service was not ready: {}", e.into()),
393                    )
394                })?;
395            let codec = tonic::codec::ProstCodec::default();
396            let path = http::uri::PathAndQuery::from_static(
397                "/com.coralogixapis.notification_center.notifications.v1.TestingService/TestConnectorConfig",
398            );
399            let mut req = request.into_request();
400            req.extensions_mut()
401                .insert(
402                    GrpcMethod::new(
403                        "com.coralogixapis.notification_center.notifications.v1.TestingService",
404                        "TestConnectorConfig",
405                    ),
406                );
407            self.inner.unary(req, path, codec).await
408        }
409        pub async fn test_existing_connector(
410            &mut self,
411            request: impl tonic::IntoRequest<super::TestExistingConnectorRequest>,
412        ) -> std::result::Result<
413            tonic::Response<super::TestExistingConnectorResponse>,
414            tonic::Status,
415        > {
416            self.inner
417                .ready()
418                .await
419                .map_err(|e| {
420                    tonic::Status::unknown(
421                        format!("Service was not ready: {}", e.into()),
422                    )
423                })?;
424            let codec = tonic::codec::ProstCodec::default();
425            let path = http::uri::PathAndQuery::from_static(
426                "/com.coralogixapis.notification_center.notifications.v1.TestingService/TestExistingConnector",
427            );
428            let mut req = request.into_request();
429            req.extensions_mut()
430                .insert(
431                    GrpcMethod::new(
432                        "com.coralogixapis.notification_center.notifications.v1.TestingService",
433                        "TestExistingConnector",
434                    ),
435                );
436            self.inner.unary(req, path, codec).await
437        }
438        pub async fn test_preset_config(
439            &mut self,
440            request: impl tonic::IntoRequest<super::TestPresetConfigRequest>,
441        ) -> std::result::Result<
442            tonic::Response<super::TestPresetConfigResponse>,
443            tonic::Status,
444        > {
445            self.inner
446                .ready()
447                .await
448                .map_err(|e| {
449                    tonic::Status::unknown(
450                        format!("Service was not ready: {}", e.into()),
451                    )
452                })?;
453            let codec = tonic::codec::ProstCodec::default();
454            let path = http::uri::PathAndQuery::from_static(
455                "/com.coralogixapis.notification_center.notifications.v1.TestingService/TestPresetConfig",
456            );
457            let mut req = request.into_request();
458            req.extensions_mut()
459                .insert(
460                    GrpcMethod::new(
461                        "com.coralogixapis.notification_center.notifications.v1.TestingService",
462                        "TestPresetConfig",
463                    ),
464                );
465            self.inner.unary(req, path, codec).await
466        }
467        pub async fn test_existing_preset(
468            &mut self,
469            request: impl tonic::IntoRequest<super::TestExistingPresetRequest>,
470        ) -> std::result::Result<
471            tonic::Response<super::TestExistingPresetResponse>,
472            tonic::Status,
473        > {
474            self.inner
475                .ready()
476                .await
477                .map_err(|e| {
478                    tonic::Status::unknown(
479                        format!("Service was not ready: {}", e.into()),
480                    )
481                })?;
482            let codec = tonic::codec::ProstCodec::default();
483            let path = http::uri::PathAndQuery::from_static(
484                "/com.coralogixapis.notification_center.notifications.v1.TestingService/TestExistingPreset",
485            );
486            let mut req = request.into_request();
487            req.extensions_mut()
488                .insert(
489                    GrpcMethod::new(
490                        "com.coralogixapis.notification_center.notifications.v1.TestingService",
491                        "TestExistingPreset",
492                    ),
493                );
494            self.inner.unary(req, path, codec).await
495        }
496        pub async fn test_destination(
497            &mut self,
498            request: impl tonic::IntoRequest<super::TestDestinationRequest>,
499        ) -> std::result::Result<
500            tonic::Response<super::TestDestinationResponse>,
501            tonic::Status,
502        > {
503            self.inner
504                .ready()
505                .await
506                .map_err(|e| {
507                    tonic::Status::unknown(
508                        format!("Service was not ready: {}", e.into()),
509                    )
510                })?;
511            let codec = tonic::codec::ProstCodec::default();
512            let path = http::uri::PathAndQuery::from_static(
513                "/com.coralogixapis.notification_center.notifications.v1.TestingService/TestDestination",
514            );
515            let mut req = request.into_request();
516            req.extensions_mut()
517                .insert(
518                    GrpcMethod::new(
519                        "com.coralogixapis.notification_center.notifications.v1.TestingService",
520                        "TestDestination",
521                    ),
522                );
523            self.inner.unary(req, path, codec).await
524        }
525        pub async fn test_template_render(
526            &mut self,
527            request: impl tonic::IntoRequest<super::TestTemplateRenderRequest>,
528        ) -> std::result::Result<
529            tonic::Response<super::TestTemplateRenderResponse>,
530            tonic::Status,
531        > {
532            self.inner
533                .ready()
534                .await
535                .map_err(|e| {
536                    tonic::Status::unknown(
537                        format!("Service was not ready: {}", e.into()),
538                    )
539                })?;
540            let codec = tonic::codec::ProstCodec::default();
541            let path = http::uri::PathAndQuery::from_static(
542                "/com.coralogixapis.notification_center.notifications.v1.TestingService/TestTemplateRender",
543            );
544            let mut req = request.into_request();
545            req.extensions_mut()
546                .insert(
547                    GrpcMethod::new(
548                        "com.coralogixapis.notification_center.notifications.v1.TestingService",
549                        "TestTemplateRender",
550                    ),
551                );
552            self.inner.unary(req, path, codec).await
553        }
554        pub async fn test_routing_condition_valid(
555            &mut self,
556            request: impl tonic::IntoRequest<super::TestRoutingConditionValidRequest>,
557        ) -> std::result::Result<
558            tonic::Response<super::TestRoutingConditionValidResponse>,
559            tonic::Status,
560        > {
561            self.inner
562                .ready()
563                .await
564                .map_err(|e| {
565                    tonic::Status::unknown(
566                        format!("Service was not ready: {}", e.into()),
567                    )
568                })?;
569            let codec = tonic::codec::ProstCodec::default();
570            let path = http::uri::PathAndQuery::from_static(
571                "/com.coralogixapis.notification_center.notifications.v1.TestingService/TestRoutingConditionValid",
572            );
573            let mut req = request.into_request();
574            req.extensions_mut()
575                .insert(
576                    GrpcMethod::new(
577                        "com.coralogixapis.notification_center.notifications.v1.TestingService",
578                        "TestRoutingConditionValid",
579                    ),
580                );
581            self.inner.unary(req, path, codec).await
582        }
583    }
584}