cx_api/generated/
com.coralogixapis.notification_center.entities.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, Copy, PartialEq, ::prost::Message)]
5pub struct ListEntityTypesRequest {}
6#[derive(serde::Serialize, serde::Deserialize)]
7#[serde(rename_all = "snake_case")]
8#[derive(Clone, PartialEq, ::prost::Message)]
9pub struct ListEntityTypesResponse {
10    #[prost(enumeration = "super::super::EntityType", repeated, tag = "2")]
11    pub entity_types: ::prost::alloc::vec::Vec<i32>,
12}
13#[derive(serde::Serialize, serde::Deserialize)]
14#[serde(rename_all = "snake_case")]
15#[derive(Clone, Copy, PartialEq, ::prost::Message)]
16pub struct ListEntitySubTypesRequest {
17    #[prost(enumeration = "super::super::EntityType", tag = "1")]
18    pub entity_type: i32,
19}
20#[derive(serde::Serialize, serde::Deserialize)]
21#[serde(rename_all = "snake_case")]
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct ListEntitySubTypesResponse {
24    #[prost(string, repeated, tag = "2")]
25    pub entity_sub_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
26}
27/// Generated client implementations.
28pub mod entities_service_client {
29    #![allow(
30        unused_variables,
31        dead_code,
32        missing_docs,
33        clippy::wildcard_imports,
34        clippy::let_unit_value,
35    )]
36    use tonic::codegen::*;
37    use tonic::codegen::http::Uri;
38    /// Public API to query information on registered entities in the Notification Center
39    #[derive(Debug, Clone)]
40    pub struct EntitiesServiceClient<T> {
41        inner: tonic::client::Grpc<T>,
42    }
43    impl EntitiesServiceClient<tonic::transport::Channel> {
44        /// Attempt to create a new client by connecting to a given endpoint.
45        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
46        where
47            D: TryInto<tonic::transport::Endpoint>,
48            D::Error: Into<StdError>,
49        {
50            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
51            Ok(Self::new(conn))
52        }
53    }
54    impl<T> EntitiesServiceClient<T>
55    where
56        T: tonic::client::GrpcService<tonic::body::BoxBody>,
57        T::Error: Into<StdError>,
58        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
59        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
60    {
61        pub fn new(inner: T) -> Self {
62            let inner = tonic::client::Grpc::new(inner);
63            Self { inner }
64        }
65        pub fn with_origin(inner: T, origin: Uri) -> Self {
66            let inner = tonic::client::Grpc::with_origin(inner, origin);
67            Self { inner }
68        }
69        pub fn with_interceptor<F>(
70            inner: T,
71            interceptor: F,
72        ) -> EntitiesServiceClient<InterceptedService<T, F>>
73        where
74            F: tonic::service::Interceptor,
75            T::ResponseBody: Default,
76            T: tonic::codegen::Service<
77                http::Request<tonic::body::BoxBody>,
78                Response = http::Response<
79                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
80                >,
81            >,
82            <T as tonic::codegen::Service<
83                http::Request<tonic::body::BoxBody>,
84            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
85        {
86            EntitiesServiceClient::new(InterceptedService::new(inner, interceptor))
87        }
88        /// Compress requests with the given encoding.
89        ///
90        /// This requires the server to support it otherwise it might respond with an
91        /// error.
92        #[must_use]
93        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
94            self.inner = self.inner.send_compressed(encoding);
95            self
96        }
97        /// Enable decompressing responses.
98        #[must_use]
99        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
100            self.inner = self.inner.accept_compressed(encoding);
101            self
102        }
103        /// Limits the maximum size of a decoded message.
104        ///
105        /// Default: `4MB`
106        #[must_use]
107        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
108            self.inner = self.inner.max_decoding_message_size(limit);
109            self
110        }
111        /// Limits the maximum size of an encoded message.
112        ///
113        /// Default: `usize::MAX`
114        #[must_use]
115        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
116            self.inner = self.inner.max_encoding_message_size(limit);
117            self
118        }
119        pub async fn list_entity_types(
120            &mut self,
121            request: impl tonic::IntoRequest<super::ListEntityTypesRequest>,
122        ) -> std::result::Result<
123            tonic::Response<super::ListEntityTypesResponse>,
124            tonic::Status,
125        > {
126            self.inner
127                .ready()
128                .await
129                .map_err(|e| {
130                    tonic::Status::unknown(
131                        format!("Service was not ready: {}", e.into()),
132                    )
133                })?;
134            let codec = tonic::codec::ProstCodec::default();
135            let path = http::uri::PathAndQuery::from_static(
136                "/com.coralogixapis.notification_center.entities.v1.EntitiesService/ListEntityTypes",
137            );
138            let mut req = request.into_request();
139            req.extensions_mut()
140                .insert(
141                    GrpcMethod::new(
142                        "com.coralogixapis.notification_center.entities.v1.EntitiesService",
143                        "ListEntityTypes",
144                    ),
145                );
146            self.inner.unary(req, path, codec).await
147        }
148        pub async fn list_entity_sub_types(
149            &mut self,
150            request: impl tonic::IntoRequest<super::ListEntitySubTypesRequest>,
151        ) -> std::result::Result<
152            tonic::Response<super::ListEntitySubTypesResponse>,
153            tonic::Status,
154        > {
155            self.inner
156                .ready()
157                .await
158                .map_err(|e| {
159                    tonic::Status::unknown(
160                        format!("Service was not ready: {}", e.into()),
161                    )
162                })?;
163            let codec = tonic::codec::ProstCodec::default();
164            let path = http::uri::PathAndQuery::from_static(
165                "/com.coralogixapis.notification_center.entities.v1.EntitiesService/ListEntitySubTypes",
166            );
167            let mut req = request.into_request();
168            req.extensions_mut()
169                .insert(
170                    GrpcMethod::new(
171                        "com.coralogixapis.notification_center.entities.v1.EntitiesService",
172                        "ListEntitySubTypes",
173                    ),
174                );
175            self.inner.unary(req, path, codec).await
176        }
177    }
178}