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