#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Owner {
#[prost(oneof = "owner::Owner", tags = "1, 2, 3")]
pub owner: ::core::option::Option<owner::Owner>,
}
pub mod owner {
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Owner {
#[prost(string, tag = "1")]
UserId(::prost::alloc::string::String),
#[prost(uint32, tag = "2")]
TeamId(u32),
#[prost(string, tag = "3")]
OrganisationId(::prost::alloc::string::String),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KeyInfo {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub owner: ::core::option::Option<Owner>,
#[prost(bool, tag = "3")]
pub active: bool,
#[prost(bool, tag = "4")]
pub hashed: bool,
#[prost(message, optional, tag = "5")]
pub key_permissions: ::core::option::Option<key_info::KeyPermissions>,
#[prost(string, optional, tag = "6")]
pub value: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag = "7")]
pub id: ::prost::alloc::string::String,
}
pub mod key_info {
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KeyPermissions {
#[prost(message, repeated, tag = "1")]
pub presets: ::prost::alloc::vec::Vec<super::PresetInfo>,
#[prost(string, repeated, tag = "2")]
pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PresetInfo {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateApiKeyRequest {
#[prost(string, tag = "1")]
pub key_id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub new_name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bool, optional, tag = "3")]
pub is_active: ::core::option::Option<bool>,
#[prost(message, optional, tag = "4")]
pub presets: ::core::option::Option<update_api_key_request::Presets>,
#[prost(message, optional, tag = "5")]
pub permissions: ::core::option::Option<update_api_key_request::Permissions>,
}
pub mod update_api_key_request {
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Presets {
#[prost(string, repeated, tag = "1")]
pub presets: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Permissions {
#[prost(string, repeated, tag = "1")]
pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct UpdateApiKeyResponse {}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteApiKeyRequest {
#[prost(string, tag = "1")]
pub key_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteApiKeyResponse {}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateApiKeyRequest {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub owner: ::core::option::Option<Owner>,
#[prost(message, optional, tag = "3")]
pub key_permissions: ::core::option::Option<create_api_key_request::KeyPermissions>,
#[prost(bool, tag = "4")]
pub hashed: bool,
}
pub mod create_api_key_request {
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KeyPermissions {
#[prost(string, repeated, tag = "1")]
pub presets: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "2")]
pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateApiKeyResponse {
#[prost(string, tag = "1")]
pub key_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub value: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetApiKeyRequest {
#[prost(string, tag = "1")]
pub key_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetApiKeyResponse {
#[prost(message, optional, tag = "1")]
pub key_info: ::core::option::Option<KeyInfo>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetSendDataApiKeysRequest {}
#[derive(serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSendDataApiKeysResponse {
#[prost(message, repeated, tag = "1")]
pub keys: ::prost::alloc::vec::Vec<KeyInfo>,
}
pub mod api_keys_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct ApiKeysServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ApiKeysServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> ApiKeysServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ApiKeysServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
ApiKeysServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn create_api_key(
&mut self,
request: impl tonic::IntoRequest<super::CreateApiKeyRequest>,
) -> std::result::Result<
tonic::Response<super::CreateApiKeyResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/com.coralogixapis.aaa.apikeys.v3.ApiKeysService/CreateApiKey",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.aaa.apikeys.v3.ApiKeysService",
"CreateApiKey",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_api_key(
&mut self,
request: impl tonic::IntoRequest<super::GetApiKeyRequest>,
) -> std::result::Result<
tonic::Response<super::GetApiKeyResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/com.coralogixapis.aaa.apikeys.v3.ApiKeysService/GetApiKey",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.aaa.apikeys.v3.ApiKeysService",
"GetApiKey",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_send_data_api_keys(
&mut self,
request: impl tonic::IntoRequest<super::GetSendDataApiKeysRequest>,
) -> std::result::Result<
tonic::Response<super::GetSendDataApiKeysResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/com.coralogixapis.aaa.apikeys.v3.ApiKeysService/GetSendDataApiKeys",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.aaa.apikeys.v3.ApiKeysService",
"GetSendDataApiKeys",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_api_key(
&mut self,
request: impl tonic::IntoRequest<super::DeleteApiKeyRequest>,
) -> std::result::Result<
tonic::Response<super::DeleteApiKeyResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/com.coralogixapis.aaa.apikeys.v3.ApiKeysService/DeleteApiKey",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.aaa.apikeys.v3.ApiKeysService",
"DeleteApiKey",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn update_api_key(
&mut self,
request: impl tonic::IntoRequest<super::UpdateApiKeyRequest>,
) -> std::result::Result<
tonic::Response<super::UpdateApiKeyResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/com.coralogixapis.aaa.apikeys.v3.ApiKeysService/UpdateApiKey",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"com.coralogixapis.aaa.apikeys.v3.ApiKeysService",
"UpdateApiKey",
),
);
self.inner.unary(req, path, codec).await
}
}
}