cx_api/generated/
com.coralogixapis.aaa.apikeys.v3.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 Owner {
6    #[prost(oneof = "owner::Owner", tags = "1, 2, 3")]
7    pub owner: ::core::option::Option<owner::Owner>,
8}
9/// Nested message and enum types in `Owner`.
10pub mod owner {
11    #[derive(serde::Serialize, serde::Deserialize)]
12    #[serde(rename_all = "snake_case")]
13    #[derive(Clone, PartialEq, ::prost::Oneof)]
14    pub enum Owner {
15        #[prost(string, tag = "1")]
16        UserId(::prost::alloc::string::String),
17        #[prost(uint32, tag = "2")]
18        TeamId(u32),
19        #[prost(string, tag = "3")]
20        OrganisationId(::prost::alloc::string::String),
21    }
22}
23#[derive(serde::Serialize, serde::Deserialize)]
24#[serde(rename_all = "snake_case")]
25#[derive(Clone, PartialEq, ::prost::Message)]
26pub struct KeyInfo {
27    #[prost(string, tag = "1")]
28    pub name: ::prost::alloc::string::String,
29    #[prost(message, optional, tag = "2")]
30    pub owner: ::core::option::Option<Owner>,
31    #[prost(bool, tag = "3")]
32    pub active: bool,
33    #[prost(bool, tag = "4")]
34    pub hashed: bool,
35    #[prost(message, optional, tag = "5")]
36    pub key_permissions: ::core::option::Option<key_info::KeyPermissions>,
37    #[prost(string, optional, tag = "6")]
38    pub value: ::core::option::Option<::prost::alloc::string::String>,
39    #[prost(string, tag = "7")]
40    pub id: ::prost::alloc::string::String,
41}
42/// Nested message and enum types in `KeyInfo`.
43pub mod key_info {
44    #[derive(serde::Serialize, serde::Deserialize)]
45    #[serde(rename_all = "snake_case")]
46    #[derive(Clone, PartialEq, ::prost::Message)]
47    pub struct KeyPermissions {
48        #[prost(message, repeated, tag = "1")]
49        pub presets: ::prost::alloc::vec::Vec<super::PresetInfo>,
50        #[prost(string, repeated, tag = "2")]
51        pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
52    }
53}
54#[derive(serde::Serialize, serde::Deserialize)]
55#[serde(rename_all = "snake_case")]
56#[derive(Clone, PartialEq, ::prost::Message)]
57pub struct PresetInfo {
58    #[prost(string, tag = "1")]
59    pub name: ::prost::alloc::string::String,
60    #[prost(string, repeated, tag = "2")]
61    pub permissions: ::prost::alloc::vec::Vec<::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 UpdateApiKeyRequest {
67    #[prost(string, tag = "1")]
68    pub key_id: ::prost::alloc::string::String,
69    #[prost(string, optional, tag = "2")]
70    pub new_name: ::core::option::Option<::prost::alloc::string::String>,
71    #[prost(bool, optional, tag = "3")]
72    pub is_active: ::core::option::Option<bool>,
73    #[prost(message, optional, tag = "4")]
74    pub presets: ::core::option::Option<update_api_key_request::Presets>,
75    #[prost(message, optional, tag = "5")]
76    pub permissions: ::core::option::Option<update_api_key_request::Permissions>,
77}
78/// Nested message and enum types in `UpdateApiKeyRequest`.
79pub mod update_api_key_request {
80    #[derive(serde::Serialize, serde::Deserialize)]
81    #[serde(rename_all = "snake_case")]
82    #[derive(Clone, PartialEq, ::prost::Message)]
83    pub struct Presets {
84        #[prost(string, repeated, tag = "1")]
85        pub presets: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
86    }
87    #[derive(serde::Serialize, serde::Deserialize)]
88    #[serde(rename_all = "snake_case")]
89    #[derive(Clone, PartialEq, ::prost::Message)]
90    pub struct Permissions {
91        #[prost(string, repeated, tag = "1")]
92        pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
93    }
94}
95#[derive(serde::Serialize, serde::Deserialize)]
96#[serde(rename_all = "snake_case")]
97#[derive(Clone, Copy, PartialEq, ::prost::Message)]
98pub struct UpdateApiKeyResponse {}
99#[derive(serde::Serialize, serde::Deserialize)]
100#[serde(rename_all = "snake_case")]
101#[derive(Clone, PartialEq, ::prost::Message)]
102pub struct DeleteApiKeyRequest {
103    #[prost(string, tag = "1")]
104    pub key_id: ::prost::alloc::string::String,
105}
106#[derive(serde::Serialize, serde::Deserialize)]
107#[serde(rename_all = "snake_case")]
108#[derive(Clone, Copy, PartialEq, ::prost::Message)]
109pub struct DeleteApiKeyResponse {}
110#[derive(serde::Serialize, serde::Deserialize)]
111#[serde(rename_all = "snake_case")]
112#[derive(Clone, PartialEq, ::prost::Message)]
113pub struct CreateApiKeyRequest {
114    #[prost(string, tag = "1")]
115    pub name: ::prost::alloc::string::String,
116    #[prost(message, optional, tag = "2")]
117    pub owner: ::core::option::Option<Owner>,
118    #[prost(message, optional, tag = "3")]
119    pub key_permissions: ::core::option::Option<create_api_key_request::KeyPermissions>,
120    #[prost(bool, tag = "4")]
121    pub hashed: bool,
122}
123/// Nested message and enum types in `CreateApiKeyRequest`.
124pub mod create_api_key_request {
125    #[derive(serde::Serialize, serde::Deserialize)]
126    #[serde(rename_all = "snake_case")]
127    #[derive(Clone, PartialEq, ::prost::Message)]
128    pub struct KeyPermissions {
129        #[prost(string, repeated, tag = "1")]
130        pub presets: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
131        #[prost(string, repeated, tag = "2")]
132        pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
133    }
134}
135#[derive(serde::Serialize, serde::Deserialize)]
136#[serde(rename_all = "snake_case")]
137#[derive(Clone, PartialEq, ::prost::Message)]
138pub struct CreateApiKeyResponse {
139    #[prost(string, tag = "1")]
140    pub key_id: ::prost::alloc::string::String,
141    #[prost(string, tag = "2")]
142    pub name: ::prost::alloc::string::String,
143    #[prost(string, tag = "3")]
144    pub value: ::prost::alloc::string::String,
145}
146#[derive(serde::Serialize, serde::Deserialize)]
147#[serde(rename_all = "snake_case")]
148#[derive(Clone, PartialEq, ::prost::Message)]
149pub struct GetApiKeyRequest {
150    #[prost(string, tag = "1")]
151    pub key_id: ::prost::alloc::string::String,
152}
153#[derive(serde::Serialize, serde::Deserialize)]
154#[serde(rename_all = "snake_case")]
155#[derive(Clone, PartialEq, ::prost::Message)]
156pub struct GetApiKeyResponse {
157    #[prost(message, optional, tag = "1")]
158    pub key_info: ::core::option::Option<KeyInfo>,
159}
160#[derive(serde::Serialize, serde::Deserialize)]
161#[serde(rename_all = "snake_case")]
162#[derive(Clone, Copy, PartialEq, ::prost::Message)]
163pub struct GetSendDataApiKeysRequest {}
164#[derive(serde::Serialize, serde::Deserialize)]
165#[serde(rename_all = "snake_case")]
166#[derive(Clone, PartialEq, ::prost::Message)]
167pub struct GetSendDataApiKeysResponse {
168    #[prost(message, repeated, tag = "1")]
169    pub keys: ::prost::alloc::vec::Vec<KeyInfo>,
170}
171/// Generated client implementations.
172pub mod api_keys_service_client {
173    #![allow(
174        unused_variables,
175        dead_code,
176        missing_docs,
177        clippy::wildcard_imports,
178        clippy::let_unit_value,
179    )]
180    use tonic::codegen::*;
181    use tonic::codegen::http::Uri;
182    #[derive(Debug, Clone)]
183    pub struct ApiKeysServiceClient<T> {
184        inner: tonic::client::Grpc<T>,
185    }
186    impl ApiKeysServiceClient<tonic::transport::Channel> {
187        /// Attempt to create a new client by connecting to a given endpoint.
188        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
189        where
190            D: TryInto<tonic::transport::Endpoint>,
191            D::Error: Into<StdError>,
192        {
193            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
194            Ok(Self::new(conn))
195        }
196    }
197    impl<T> ApiKeysServiceClient<T>
198    where
199        T: tonic::client::GrpcService<tonic::body::BoxBody>,
200        T::Error: Into<StdError>,
201        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
202        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
203    {
204        pub fn new(inner: T) -> Self {
205            let inner = tonic::client::Grpc::new(inner);
206            Self { inner }
207        }
208        pub fn with_origin(inner: T, origin: Uri) -> Self {
209            let inner = tonic::client::Grpc::with_origin(inner, origin);
210            Self { inner }
211        }
212        pub fn with_interceptor<F>(
213            inner: T,
214            interceptor: F,
215        ) -> ApiKeysServiceClient<InterceptedService<T, F>>
216        where
217            F: tonic::service::Interceptor,
218            T::ResponseBody: Default,
219            T: tonic::codegen::Service<
220                http::Request<tonic::body::BoxBody>,
221                Response = http::Response<
222                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
223                >,
224            >,
225            <T as tonic::codegen::Service<
226                http::Request<tonic::body::BoxBody>,
227            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
228        {
229            ApiKeysServiceClient::new(InterceptedService::new(inner, interceptor))
230        }
231        /// Compress requests with the given encoding.
232        ///
233        /// This requires the server to support it otherwise it might respond with an
234        /// error.
235        #[must_use]
236        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
237            self.inner = self.inner.send_compressed(encoding);
238            self
239        }
240        /// Enable decompressing responses.
241        #[must_use]
242        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
243            self.inner = self.inner.accept_compressed(encoding);
244            self
245        }
246        /// Limits the maximum size of a decoded message.
247        ///
248        /// Default: `4MB`
249        #[must_use]
250        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
251            self.inner = self.inner.max_decoding_message_size(limit);
252            self
253        }
254        /// Limits the maximum size of an encoded message.
255        ///
256        /// Default: `usize::MAX`
257        #[must_use]
258        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
259            self.inner = self.inner.max_encoding_message_size(limit);
260            self
261        }
262        pub async fn create_api_key(
263            &mut self,
264            request: impl tonic::IntoRequest<super::CreateApiKeyRequest>,
265        ) -> std::result::Result<
266            tonic::Response<super::CreateApiKeyResponse>,
267            tonic::Status,
268        > {
269            self.inner
270                .ready()
271                .await
272                .map_err(|e| {
273                    tonic::Status::unknown(
274                        format!("Service was not ready: {}", e.into()),
275                    )
276                })?;
277            let codec = tonic::codec::ProstCodec::default();
278            let path = http::uri::PathAndQuery::from_static(
279                "/com.coralogixapis.aaa.apikeys.v3.ApiKeysService/CreateApiKey",
280            );
281            let mut req = request.into_request();
282            req.extensions_mut()
283                .insert(
284                    GrpcMethod::new(
285                        "com.coralogixapis.aaa.apikeys.v3.ApiKeysService",
286                        "CreateApiKey",
287                    ),
288                );
289            self.inner.unary(req, path, codec).await
290        }
291        pub async fn get_api_key(
292            &mut self,
293            request: impl tonic::IntoRequest<super::GetApiKeyRequest>,
294        ) -> std::result::Result<
295            tonic::Response<super::GetApiKeyResponse>,
296            tonic::Status,
297        > {
298            self.inner
299                .ready()
300                .await
301                .map_err(|e| {
302                    tonic::Status::unknown(
303                        format!("Service was not ready: {}", e.into()),
304                    )
305                })?;
306            let codec = tonic::codec::ProstCodec::default();
307            let path = http::uri::PathAndQuery::from_static(
308                "/com.coralogixapis.aaa.apikeys.v3.ApiKeysService/GetApiKey",
309            );
310            let mut req = request.into_request();
311            req.extensions_mut()
312                .insert(
313                    GrpcMethod::new(
314                        "com.coralogixapis.aaa.apikeys.v3.ApiKeysService",
315                        "GetApiKey",
316                    ),
317                );
318            self.inner.unary(req, path, codec).await
319        }
320        pub async fn get_send_data_api_keys(
321            &mut self,
322            request: impl tonic::IntoRequest<super::GetSendDataApiKeysRequest>,
323        ) -> std::result::Result<
324            tonic::Response<super::GetSendDataApiKeysResponse>,
325            tonic::Status,
326        > {
327            self.inner
328                .ready()
329                .await
330                .map_err(|e| {
331                    tonic::Status::unknown(
332                        format!("Service was not ready: {}", e.into()),
333                    )
334                })?;
335            let codec = tonic::codec::ProstCodec::default();
336            let path = http::uri::PathAndQuery::from_static(
337                "/com.coralogixapis.aaa.apikeys.v3.ApiKeysService/GetSendDataApiKeys",
338            );
339            let mut req = request.into_request();
340            req.extensions_mut()
341                .insert(
342                    GrpcMethod::new(
343                        "com.coralogixapis.aaa.apikeys.v3.ApiKeysService",
344                        "GetSendDataApiKeys",
345                    ),
346                );
347            self.inner.unary(req, path, codec).await
348        }
349        pub async fn delete_api_key(
350            &mut self,
351            request: impl tonic::IntoRequest<super::DeleteApiKeyRequest>,
352        ) -> std::result::Result<
353            tonic::Response<super::DeleteApiKeyResponse>,
354            tonic::Status,
355        > {
356            self.inner
357                .ready()
358                .await
359                .map_err(|e| {
360                    tonic::Status::unknown(
361                        format!("Service was not ready: {}", e.into()),
362                    )
363                })?;
364            let codec = tonic::codec::ProstCodec::default();
365            let path = http::uri::PathAndQuery::from_static(
366                "/com.coralogixapis.aaa.apikeys.v3.ApiKeysService/DeleteApiKey",
367            );
368            let mut req = request.into_request();
369            req.extensions_mut()
370                .insert(
371                    GrpcMethod::new(
372                        "com.coralogixapis.aaa.apikeys.v3.ApiKeysService",
373                        "DeleteApiKey",
374                    ),
375                );
376            self.inner.unary(req, path, codec).await
377        }
378        pub async fn update_api_key(
379            &mut self,
380            request: impl tonic::IntoRequest<super::UpdateApiKeyRequest>,
381        ) -> std::result::Result<
382            tonic::Response<super::UpdateApiKeyResponse>,
383            tonic::Status,
384        > {
385            self.inner
386                .ready()
387                .await
388                .map_err(|e| {
389                    tonic::Status::unknown(
390                        format!("Service was not ready: {}", e.into()),
391                    )
392                })?;
393            let codec = tonic::codec::ProstCodec::default();
394            let path = http::uri::PathAndQuery::from_static(
395                "/com.coralogixapis.aaa.apikeys.v3.ApiKeysService/UpdateApiKey",
396            );
397            let mut req = request.into_request();
398            req.extensions_mut()
399                .insert(
400                    GrpcMethod::new(
401                        "com.coralogixapis.aaa.apikeys.v3.ApiKeysService",
402                        "UpdateApiKey",
403                    ),
404                );
405            self.inner.unary(req, path, codec).await
406        }
407    }
408}