cx_api/generated/
com.coralogixapis.notification_center.connectors.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 Connector {
6    /// A unique identifier - automatically generated unless provided by the user
7    #[prost(string, optional, tag = "1")]
8    pub id: ::core::option::Option<::prost::alloc::string::String>,
9    #[prost(enumeration = "super::super::ConnectorType", tag = "3")]
10    pub r#type: i32,
11    #[prost(uint32, optional, tag = "4")]
12    pub team_id: ::core::option::Option<u32>,
13    #[prost(string, tag = "5")]
14    pub name: ::prost::alloc::string::String,
15    #[prost(string, tag = "6")]
16    pub description: ::prost::alloc::string::String,
17    /// System-generated timestamp for when the connector was last updated
18    #[prost(message, optional, tag = "7")]
19    pub create_time: ::core::option::Option<::prost_wkt_types::Timestamp>,
20    /// System-generated timestamp for when the connector was last updated
21    #[prost(message, optional, tag = "8")]
22    pub update_time: ::core::option::Option<::prost_wkt_types::Timestamp>,
23    /// Configuration override templates for specific entity types, values from connector_configs will be used if not overridden
24    #[prost(message, repeated, tag = "11")]
25    pub config_overrides: ::prost::alloc::vec::Vec<EntityTypeConfigOverrides>,
26    #[prost(message, optional, tag = "12")]
27    pub connector_config: ::core::option::Option<ConnectorConfig>,
28}
29#[derive(serde::Serialize, serde::Deserialize)]
30#[serde(rename_all = "snake_case")]
31#[derive(Clone, PartialEq, ::prost::Message)]
32pub struct ConnectorInternal {
33    /// automatically generated unless provided by the user
34    #[prost(string, tag = "1")]
35    pub id: ::prost::alloc::string::String,
36    /// system generated uuid
37    #[prost(string, tag = "2")]
38    pub internal_id: ::prost::alloc::string::String,
39    #[prost(enumeration = "super::super::ConnectorType", tag = "3")]
40    pub r#type: i32,
41    #[prost(uint32, tag = "4")]
42    pub team_id: u32,
43    #[prost(string, tag = "5")]
44    pub name: ::prost::alloc::string::String,
45    #[prost(string, tag = "6")]
46    pub description: ::prost::alloc::string::String,
47    /// System-generated timestamp for when the connector was last updated
48    #[prost(message, optional, tag = "7")]
49    pub create_time: ::core::option::Option<::prost_wkt_types::Timestamp>,
50    /// System-generated timestamp for when the connector was last updated
51    #[prost(message, optional, tag = "8")]
52    pub update_time: ::core::option::Option<::prost_wkt_types::Timestamp>,
53    /// Configuration override templates for specific entity types, values from connector_configs will be used if not overridden
54    #[prost(message, repeated, tag = "9")]
55    pub config_overrides: ::prost::alloc::vec::Vec<EntityTypeConfigOverrides>,
56    #[prost(message, optional, tag = "10")]
57    pub connector_config: ::core::option::Option<ConnectorConfig>,
58}
59#[derive(serde::Serialize, serde::Deserialize)]
60#[serde(rename_all = "snake_case")]
61#[derive(Clone, PartialEq, ::prost::Message)]
62pub struct EntityTypeConfigOverrides {
63    #[prost(enumeration = "super::super::EntityType", tag = "3")]
64    pub entity_type: i32,
65    #[prost(message, repeated, tag = "4")]
66    pub fields: ::prost::alloc::vec::Vec<super::super::TemplatedConnectorConfigField>,
67}
68#[derive(serde::Serialize, serde::Deserialize)]
69#[serde(rename_all = "snake_case")]
70#[derive(Clone, PartialEq, ::prost::Message)]
71pub struct ConnectorSummary {
72    #[prost(string, optional, tag = "1")]
73    pub id: ::core::option::Option<::prost::alloc::string::String>,
74    #[prost(enumeration = "super::super::ConnectorType", tag = "3")]
75    pub r#type: i32,
76    #[prost(uint32, optional, tag = "4")]
77    pub team_id: ::core::option::Option<u32>,
78    #[prost(string, tag = "5")]
79    pub name: ::prost::alloc::string::String,
80    #[prost(string, tag = "6")]
81    pub description: ::prost::alloc::string::String,
82    #[prost(message, optional, tag = "7")]
83    pub create_time: ::core::option::Option<::prost_wkt_types::Timestamp>,
84    #[prost(message, optional, tag = "8")]
85    pub update_time: ::core::option::Option<::prost_wkt_types::Timestamp>,
86}
87#[derive(serde::Serialize, serde::Deserialize)]
88#[serde(rename_all = "snake_case")]
89#[derive(Clone, PartialEq, ::prost::Message)]
90pub struct ConnectorConfig {
91    #[prost(message, repeated, tag = "2")]
92    pub fields: ::prost::alloc::vec::Vec<super::super::ConnectorConfigField>,
93}
94#[derive(serde::Serialize, serde::Deserialize)]
95#[serde(rename_all = "snake_case")]
96#[derive(Clone, Copy, PartialEq, ::prost::Message)]
97pub struct ConnectorTypeSummary {
98    #[prost(enumeration = "super::super::ConnectorType", tag = "1")]
99    pub r#type: i32,
100    #[prost(uint32, tag = "2")]
101    pub count: u32,
102}
103#[derive(serde::Serialize, serde::Deserialize)]
104#[serde(rename_all = "snake_case")]
105#[derive(Clone, PartialEq, ::prost::Message)]
106pub struct CreateConnectorRequest {
107    #[prost(message, optional, tag = "1")]
108    pub connector: ::core::option::Option<Connector>,
109}
110#[derive(serde::Serialize, serde::Deserialize)]
111#[serde(rename_all = "snake_case")]
112#[derive(Clone, PartialEq, ::prost::Message)]
113pub struct CreateConnectorResponse {
114    #[prost(message, optional, tag = "1")]
115    pub connector: ::core::option::Option<Connector>,
116}
117#[derive(serde::Serialize, serde::Deserialize)]
118#[serde(rename_all = "snake_case")]
119#[derive(Clone, PartialEq, ::prost::Message)]
120pub struct ReplaceConnectorRequest {
121    #[prost(message, optional, tag = "1")]
122    pub connector: ::core::option::Option<Connector>,
123}
124#[derive(serde::Serialize, serde::Deserialize)]
125#[serde(rename_all = "snake_case")]
126#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct ReplaceConnectorResponse {
128    #[prost(message, optional, tag = "1")]
129    pub connector: ::core::option::Option<Connector>,
130}
131#[derive(serde::Serialize, serde::Deserialize)]
132#[serde(rename_all = "snake_case")]
133#[derive(Clone, PartialEq, ::prost::Message)]
134pub struct DeleteConnectorRequest {
135    #[prost(string, tag = "3")]
136    pub id: ::prost::alloc::string::String,
137}
138#[derive(serde::Serialize, serde::Deserialize)]
139#[serde(rename_all = "snake_case")]
140#[derive(Clone, Copy, PartialEq, ::prost::Message)]
141pub struct DeleteConnectorResponse {}
142#[derive(serde::Serialize, serde::Deserialize)]
143#[serde(rename_all = "snake_case")]
144#[derive(Clone, PartialEq, ::prost::Message)]
145pub struct GetConnectorRequest {
146    #[prost(string, tag = "3")]
147    pub id: ::prost::alloc::string::String,
148}
149#[derive(serde::Serialize, serde::Deserialize)]
150#[serde(rename_all = "snake_case")]
151#[derive(Clone, PartialEq, ::prost::Message)]
152pub struct GetConnectorResponse {
153    #[prost(message, optional, tag = "1")]
154    pub connector: ::core::option::Option<Connector>,
155}
156#[derive(serde::Serialize, serde::Deserialize)]
157#[serde(rename_all = "snake_case")]
158#[derive(Clone, Copy, PartialEq, ::prost::Message)]
159pub struct ListConnectorsRequest {
160    #[prost(enumeration = "super::super::ConnectorType", optional, tag = "1")]
161    pub connector_type: ::core::option::Option<i32>,
162    #[prost(enumeration = "super::super::EntityType", optional, tag = "4")]
163    pub supported_by_entity_type: ::core::option::Option<i32>,
164}
165#[derive(serde::Serialize, serde::Deserialize)]
166#[serde(rename_all = "snake_case")]
167#[derive(Clone, PartialEq, ::prost::Message)]
168pub struct ListConnectorsResponse {
169    #[prost(message, repeated, tag = "1")]
170    pub connectors: ::prost::alloc::vec::Vec<Connector>,
171}
172#[derive(serde::Serialize, serde::Deserialize)]
173#[serde(rename_all = "snake_case")]
174#[derive(Clone, PartialEq, ::prost::Message)]
175pub struct BatchGetConnectorsRequest {
176    #[prost(string, repeated, tag = "3")]
177    pub connector_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
178}
179#[derive(serde::Serialize, serde::Deserialize)]
180#[serde(rename_all = "snake_case")]
181#[derive(Clone, PartialEq, ::prost::Message)]
182pub struct BatchGetConnectorsResponse {
183    #[prost(map = "string, message", tag = "1")]
184    pub connectors: ::std::collections::HashMap<
185        ::prost::alloc::string::String,
186        Connector,
187    >,
188    #[prost(string, repeated, tag = "2")]
189    pub not_found_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
190}
191#[derive(serde::Serialize, serde::Deserialize)]
192#[serde(rename_all = "snake_case")]
193#[derive(Clone, PartialEq, ::prost::Message)]
194pub struct BatchGetConnectorSummariesRequest {
195    #[prost(string, repeated, tag = "3")]
196    pub connector_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
197}
198#[derive(serde::Serialize, serde::Deserialize)]
199#[serde(rename_all = "snake_case")]
200#[derive(Clone, PartialEq, ::prost::Message)]
201pub struct BatchGetConnectorSummariesResponse {
202    #[prost(map = "string, message", tag = "1")]
203    pub connector_summaries: ::std::collections::HashMap<
204        ::prost::alloc::string::String,
205        ConnectorSummary,
206    >,
207    #[prost(string, repeated, tag = "2")]
208    pub not_found_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
209}
210#[derive(serde::Serialize, serde::Deserialize)]
211#[serde(rename_all = "snake_case")]
212#[derive(Clone, Copy, PartialEq, ::prost::Message)]
213pub struct ListConnectorSummariesRequest {
214    #[prost(enumeration = "super::super::ConnectorType", optional, tag = "1")]
215    pub connector_type: ::core::option::Option<i32>,
216    #[prost(enumeration = "super::super::EntityType", optional, tag = "4")]
217    pub supported_by_entity_type: ::core::option::Option<i32>,
218}
219#[derive(serde::Serialize, serde::Deserialize)]
220#[serde(rename_all = "snake_case")]
221#[derive(Clone, PartialEq, ::prost::Message)]
222pub struct ListConnectorSummariesResponse {
223    #[prost(message, repeated, tag = "1")]
224    pub connectors: ::prost::alloc::vec::Vec<ConnectorSummary>,
225}
226#[derive(serde::Serialize, serde::Deserialize)]
227#[serde(rename_all = "snake_case")]
228#[derive(Clone, Copy, PartialEq, ::prost::Message)]
229pub struct GetConnectorTypeSummariesRequest {
230    #[prost(enumeration = "super::super::EntityType", optional, tag = "1")]
231    pub supported_by_entity_type: ::core::option::Option<i32>,
232}
233#[derive(serde::Serialize, serde::Deserialize)]
234#[serde(rename_all = "snake_case")]
235#[derive(Clone, PartialEq, ::prost::Message)]
236pub struct GetConnectorTypeSummariesResponse {
237    #[prost(message, repeated, tag = "1")]
238    pub connector_type_summaries: ::prost::alloc::vec::Vec<ConnectorTypeSummary>,
239}
240/// Generated client implementations.
241pub mod connectors_service_client {
242    #![allow(
243        unused_variables,
244        dead_code,
245        missing_docs,
246        clippy::wildcard_imports,
247        clippy::let_unit_value,
248    )]
249    use tonic::codegen::*;
250    use tonic::codegen::http::Uri;
251    /// Public API that allows managing connectors.
252    #[derive(Debug, Clone)]
253    pub struct ConnectorsServiceClient<T> {
254        inner: tonic::client::Grpc<T>,
255    }
256    impl ConnectorsServiceClient<tonic::transport::Channel> {
257        /// Attempt to create a new client by connecting to a given endpoint.
258        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
259        where
260            D: TryInto<tonic::transport::Endpoint>,
261            D::Error: Into<StdError>,
262        {
263            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
264            Ok(Self::new(conn))
265        }
266    }
267    impl<T> ConnectorsServiceClient<T>
268    where
269        T: tonic::client::GrpcService<tonic::body::BoxBody>,
270        T::Error: Into<StdError>,
271        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
272        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
273    {
274        pub fn new(inner: T) -> Self {
275            let inner = tonic::client::Grpc::new(inner);
276            Self { inner }
277        }
278        pub fn with_origin(inner: T, origin: Uri) -> Self {
279            let inner = tonic::client::Grpc::with_origin(inner, origin);
280            Self { inner }
281        }
282        pub fn with_interceptor<F>(
283            inner: T,
284            interceptor: F,
285        ) -> ConnectorsServiceClient<InterceptedService<T, F>>
286        where
287            F: tonic::service::Interceptor,
288            T::ResponseBody: Default,
289            T: tonic::codegen::Service<
290                http::Request<tonic::body::BoxBody>,
291                Response = http::Response<
292                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
293                >,
294            >,
295            <T as tonic::codegen::Service<
296                http::Request<tonic::body::BoxBody>,
297            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
298        {
299            ConnectorsServiceClient::new(InterceptedService::new(inner, interceptor))
300        }
301        /// Compress requests with the given encoding.
302        ///
303        /// This requires the server to support it otherwise it might respond with an
304        /// error.
305        #[must_use]
306        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
307            self.inner = self.inner.send_compressed(encoding);
308            self
309        }
310        /// Enable decompressing responses.
311        #[must_use]
312        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
313            self.inner = self.inner.accept_compressed(encoding);
314            self
315        }
316        /// Limits the maximum size of a decoded message.
317        ///
318        /// Default: `4MB`
319        #[must_use]
320        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
321            self.inner = self.inner.max_decoding_message_size(limit);
322            self
323        }
324        /// Limits the maximum size of an encoded message.
325        ///
326        /// Default: `usize::MAX`
327        #[must_use]
328        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
329            self.inner = self.inner.max_encoding_message_size(limit);
330            self
331        }
332        pub async fn create_connector(
333            &mut self,
334            request: impl tonic::IntoRequest<super::CreateConnectorRequest>,
335        ) -> std::result::Result<
336            tonic::Response<super::CreateConnectorResponse>,
337            tonic::Status,
338        > {
339            self.inner
340                .ready()
341                .await
342                .map_err(|e| {
343                    tonic::Status::unknown(
344                        format!("Service was not ready: {}", e.into()),
345                    )
346                })?;
347            let codec = tonic::codec::ProstCodec::default();
348            let path = http::uri::PathAndQuery::from_static(
349                "/com.coralogixapis.notification_center.connectors.v1.ConnectorsService/CreateConnector",
350            );
351            let mut req = request.into_request();
352            req.extensions_mut()
353                .insert(
354                    GrpcMethod::new(
355                        "com.coralogixapis.notification_center.connectors.v1.ConnectorsService",
356                        "CreateConnector",
357                    ),
358                );
359            self.inner.unary(req, path, codec).await
360        }
361        pub async fn replace_connector(
362            &mut self,
363            request: impl tonic::IntoRequest<super::ReplaceConnectorRequest>,
364        ) -> std::result::Result<
365            tonic::Response<super::ReplaceConnectorResponse>,
366            tonic::Status,
367        > {
368            self.inner
369                .ready()
370                .await
371                .map_err(|e| {
372                    tonic::Status::unknown(
373                        format!("Service was not ready: {}", e.into()),
374                    )
375                })?;
376            let codec = tonic::codec::ProstCodec::default();
377            let path = http::uri::PathAndQuery::from_static(
378                "/com.coralogixapis.notification_center.connectors.v1.ConnectorsService/ReplaceConnector",
379            );
380            let mut req = request.into_request();
381            req.extensions_mut()
382                .insert(
383                    GrpcMethod::new(
384                        "com.coralogixapis.notification_center.connectors.v1.ConnectorsService",
385                        "ReplaceConnector",
386                    ),
387                );
388            self.inner.unary(req, path, codec).await
389        }
390        pub async fn delete_connector(
391            &mut self,
392            request: impl tonic::IntoRequest<super::DeleteConnectorRequest>,
393        ) -> std::result::Result<
394            tonic::Response<super::DeleteConnectorResponse>,
395            tonic::Status,
396        > {
397            self.inner
398                .ready()
399                .await
400                .map_err(|e| {
401                    tonic::Status::unknown(
402                        format!("Service was not ready: {}", e.into()),
403                    )
404                })?;
405            let codec = tonic::codec::ProstCodec::default();
406            let path = http::uri::PathAndQuery::from_static(
407                "/com.coralogixapis.notification_center.connectors.v1.ConnectorsService/DeleteConnector",
408            );
409            let mut req = request.into_request();
410            req.extensions_mut()
411                .insert(
412                    GrpcMethod::new(
413                        "com.coralogixapis.notification_center.connectors.v1.ConnectorsService",
414                        "DeleteConnector",
415                    ),
416                );
417            self.inner.unary(req, path, codec).await
418        }
419        pub async fn get_connector(
420            &mut self,
421            request: impl tonic::IntoRequest<super::GetConnectorRequest>,
422        ) -> std::result::Result<
423            tonic::Response<super::GetConnectorResponse>,
424            tonic::Status,
425        > {
426            self.inner
427                .ready()
428                .await
429                .map_err(|e| {
430                    tonic::Status::unknown(
431                        format!("Service was not ready: {}", e.into()),
432                    )
433                })?;
434            let codec = tonic::codec::ProstCodec::default();
435            let path = http::uri::PathAndQuery::from_static(
436                "/com.coralogixapis.notification_center.connectors.v1.ConnectorsService/GetConnector",
437            );
438            let mut req = request.into_request();
439            req.extensions_mut()
440                .insert(
441                    GrpcMethod::new(
442                        "com.coralogixapis.notification_center.connectors.v1.ConnectorsService",
443                        "GetConnector",
444                    ),
445                );
446            self.inner.unary(req, path, codec).await
447        }
448        pub async fn list_connectors(
449            &mut self,
450            request: impl tonic::IntoRequest<super::ListConnectorsRequest>,
451        ) -> std::result::Result<
452            tonic::Response<super::ListConnectorsResponse>,
453            tonic::Status,
454        > {
455            self.inner
456                .ready()
457                .await
458                .map_err(|e| {
459                    tonic::Status::unknown(
460                        format!("Service was not ready: {}", e.into()),
461                    )
462                })?;
463            let codec = tonic::codec::ProstCodec::default();
464            let path = http::uri::PathAndQuery::from_static(
465                "/com.coralogixapis.notification_center.connectors.v1.ConnectorsService/ListConnectors",
466            );
467            let mut req = request.into_request();
468            req.extensions_mut()
469                .insert(
470                    GrpcMethod::new(
471                        "com.coralogixapis.notification_center.connectors.v1.ConnectorsService",
472                        "ListConnectors",
473                    ),
474                );
475            self.inner.unary(req, path, codec).await
476        }
477        pub async fn batch_get_connectors(
478            &mut self,
479            request: impl tonic::IntoRequest<super::BatchGetConnectorsRequest>,
480        ) -> std::result::Result<
481            tonic::Response<super::BatchGetConnectorsResponse>,
482            tonic::Status,
483        > {
484            self.inner
485                .ready()
486                .await
487                .map_err(|e| {
488                    tonic::Status::unknown(
489                        format!("Service was not ready: {}", e.into()),
490                    )
491                })?;
492            let codec = tonic::codec::ProstCodec::default();
493            let path = http::uri::PathAndQuery::from_static(
494                "/com.coralogixapis.notification_center.connectors.v1.ConnectorsService/BatchGetConnectors",
495            );
496            let mut req = request.into_request();
497            req.extensions_mut()
498                .insert(
499                    GrpcMethod::new(
500                        "com.coralogixapis.notification_center.connectors.v1.ConnectorsService",
501                        "BatchGetConnectors",
502                    ),
503                );
504            self.inner.unary(req, path, codec).await
505        }
506        pub async fn batch_get_connector_summaries(
507            &mut self,
508            request: impl tonic::IntoRequest<super::BatchGetConnectorSummariesRequest>,
509        ) -> std::result::Result<
510            tonic::Response<super::BatchGetConnectorSummariesResponse>,
511            tonic::Status,
512        > {
513            self.inner
514                .ready()
515                .await
516                .map_err(|e| {
517                    tonic::Status::unknown(
518                        format!("Service was not ready: {}", e.into()),
519                    )
520                })?;
521            let codec = tonic::codec::ProstCodec::default();
522            let path = http::uri::PathAndQuery::from_static(
523                "/com.coralogixapis.notification_center.connectors.v1.ConnectorsService/BatchGetConnectorSummaries",
524            );
525            let mut req = request.into_request();
526            req.extensions_mut()
527                .insert(
528                    GrpcMethod::new(
529                        "com.coralogixapis.notification_center.connectors.v1.ConnectorsService",
530                        "BatchGetConnectorSummaries",
531                    ),
532                );
533            self.inner.unary(req, path, codec).await
534        }
535        pub async fn list_connector_summaries(
536            &mut self,
537            request: impl tonic::IntoRequest<super::ListConnectorSummariesRequest>,
538        ) -> std::result::Result<
539            tonic::Response<super::ListConnectorSummariesResponse>,
540            tonic::Status,
541        > {
542            self.inner
543                .ready()
544                .await
545                .map_err(|e| {
546                    tonic::Status::unknown(
547                        format!("Service was not ready: {}", e.into()),
548                    )
549                })?;
550            let codec = tonic::codec::ProstCodec::default();
551            let path = http::uri::PathAndQuery::from_static(
552                "/com.coralogixapis.notification_center.connectors.v1.ConnectorsService/ListConnectorSummaries",
553            );
554            let mut req = request.into_request();
555            req.extensions_mut()
556                .insert(
557                    GrpcMethod::new(
558                        "com.coralogixapis.notification_center.connectors.v1.ConnectorsService",
559                        "ListConnectorSummaries",
560                    ),
561                );
562            self.inner.unary(req, path, codec).await
563        }
564        pub async fn get_connector_type_summaries(
565            &mut self,
566            request: impl tonic::IntoRequest<super::GetConnectorTypeSummariesRequest>,
567        ) -> std::result::Result<
568            tonic::Response<super::GetConnectorTypeSummariesResponse>,
569            tonic::Status,
570        > {
571            self.inner
572                .ready()
573                .await
574                .map_err(|e| {
575                    tonic::Status::unknown(
576                        format!("Service was not ready: {}", e.into()),
577                    )
578                })?;
579            let codec = tonic::codec::ProstCodec::default();
580            let path = http::uri::PathAndQuery::from_static(
581                "/com.coralogixapis.notification_center.connectors.v1.ConnectorsService/GetConnectorTypeSummaries",
582            );
583            let mut req = request.into_request();
584            req.extensions_mut()
585                .insert(
586                    GrpcMethod::new(
587                        "com.coralogixapis.notification_center.connectors.v1.ConnectorsService",
588                        "GetConnectorTypeSummaries",
589                    ),
590                );
591            self.inner.unary(req, path, codec).await
592        }
593    }
594}