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