cx_api/generated/
com.coralogixapis.aaa.v1.rs

1// This file is @generated by prost-build.
2/// IpAccess represents a single IP access entry.
3#[derive(serde::Serialize, serde::Deserialize)]
4#[serde(rename_all = "snake_case")]
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct IpAccess {
7    /// The name of the IP access entry.
8    #[prost(string, tag = "1")]
9    pub name: ::prost::alloc::string::String,
10    /// The IP range in CIDR notation.
11    #[prost(string, tag = "2")]
12    pub ip_range: ::prost::alloc::string::String,
13    /// Whether this IP access entry is enabled.
14    #[prost(bool, tag = "3")]
15    pub enabled: bool,
16}
17/// CompanyIpAccessSettings represents the IP access settings for a company.
18#[derive(serde::Serialize, serde::Deserialize)]
19#[serde(rename_all = "snake_case")]
20#[derive(Clone, PartialEq, ::prost::Message)]
21pub struct CompanyIpAccessSettings {
22    /// The unique identifier for the company IP access settings.
23    /// This is typically a company id.
24    #[prost(string, tag = "1")]
25    pub id: ::prost::alloc::string::String,
26    /// The list of IP access entries.
27    #[prost(map = "string, message", tag = "2")]
28    pub ip_access: ::std::collections::HashMap<::prost::alloc::string::String, IpAccess>,
29    /// Coralogix customer support access setting.
30    #[prost(enumeration = "CoralogixCustomerSupportAccess", tag = "3")]
31    pub enable_coralogix_customer_support_access: i32,
32}
33/// CreateCompanyIpAccessSettingsRequest is the request for the
34/// CreateCompanyIpAccessSettings RPC.
35#[derive(serde::Serialize, serde::Deserialize)]
36#[serde(rename_all = "snake_case")]
37#[derive(Clone, PartialEq, ::prost::Message)]
38pub struct CreateCompanyIpAccessSettingsRequest {
39    #[prost(message, repeated, tag = "1")]
40    pub ip_access: ::prost::alloc::vec::Vec<IpAccess>,
41    /// Coralogix customer support access setting.
42    /// Defaults to DISABLED if not provided
43    #[prost(enumeration = "CoralogixCustomerSupportAccess", tag = "2")]
44    pub enable_coralogix_customer_support_access: i32,
45}
46/// CreateCompanyIpAccessSettingsResponse is the response for the
47/// CreateCompanyIpAccessSettings RPC.
48#[derive(serde::Serialize, serde::Deserialize)]
49#[serde(rename_all = "snake_case")]
50#[derive(Clone, PartialEq, ::prost::Message)]
51pub struct CreateCompanyIpAccessSettingsResponse {
52    /// The created company IP access settings.
53    #[prost(message, optional, tag = "1")]
54    pub settings: ::core::option::Option<CompanyIpAccessSettings>,
55}
56/// ReplaceCompanyIpAccessSettingsRequest is the request for the
57/// ReplaceCompanyIpAccessSettings RPC.
58#[derive(serde::Serialize, serde::Deserialize)]
59#[serde(rename_all = "snake_case")]
60#[derive(Clone, PartialEq, ::prost::Message)]
61pub struct ReplaceCompanyIpAccessSettingsRequest {
62    #[prost(string, optional, tag = "1")]
63    pub id: ::core::option::Option<::prost::alloc::string::String>,
64    #[prost(message, repeated, tag = "2")]
65    pub ip_access: ::prost::alloc::vec::Vec<IpAccess>,
66    /// Coralogix customer support access setting.
67    /// Defaults to DISABLED if not provided
68    #[prost(enumeration = "CoralogixCustomerSupportAccess", tag = "3")]
69    pub enable_coralogix_customer_support_access: i32,
70}
71/// ReplaceCompanyIpAccessSettingsResponse is the response for the
72/// ReplaceCompanyIpAccessSettings RPC.
73#[derive(serde::Serialize, serde::Deserialize)]
74#[serde(rename_all = "snake_case")]
75#[derive(Clone, PartialEq, ::prost::Message)]
76pub struct ReplaceCompanyIpAccessSettingsResponse {
77    /// The replaced company IP access settings.
78    #[prost(message, optional, tag = "1")]
79    pub settings: ::core::option::Option<CompanyIpAccessSettings>,
80}
81/// GetCompanyIpAccessSettingsRequest is the request for the
82/// GetCompanyIpAccessSettings RPC.
83#[derive(serde::Serialize, serde::Deserialize)]
84#[serde(rename_all = "snake_case")]
85#[derive(Clone, PartialEq, ::prost::Message)]
86pub struct GetCompanyIpAccessSettingsRequest {
87    /// The id of the company IP access settings to get.
88    /// If it's not provided, the id will be derived from the authorization header
89    #[prost(string, optional, tag = "1")]
90    pub id: ::core::option::Option<::prost::alloc::string::String>,
91}
92/// GetCompanyIpAccessSettingsResponse is the response for the
93/// GetCompanyIpAccessSettings RPC.
94#[derive(serde::Serialize, serde::Deserialize)]
95#[serde(rename_all = "snake_case")]
96#[derive(Clone, PartialEq, ::prost::Message)]
97pub struct GetCompanyIpAccessSettingsResponse {
98    /// The company IP access settings.
99    #[prost(message, optional, tag = "1")]
100    pub settings: ::core::option::Option<CompanyIpAccessSettings>,
101}
102/// DeleteCompanyIpAccessSettingsRequest is the request for the
103/// DeleteCompanyIpAccessSettings RPC.
104#[derive(serde::Serialize, serde::Deserialize)]
105#[serde(rename_all = "snake_case")]
106#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct DeleteCompanyIpAccessSettingsRequest {
108    #[prost(string, optional, tag = "1")]
109    pub id: ::core::option::Option<::prost::alloc::string::String>,
110}
111/// DeleteCompanyIpAccessSettingsResponse is the response for the
112/// DeleteCompanyIpAccessSettings RPC.
113#[derive(serde::Serialize, serde::Deserialize)]
114#[serde(rename_all = "snake_case")]
115#[derive(Clone, Copy, PartialEq, ::prost::Message)]
116pub struct DeleteCompanyIpAccessSettingsResponse {}
117/// CoralogixCustomerSupportAccess represents the state of Coralogix customer
118/// support access.
119#[derive(serde::Serialize, serde::Deserialize)]
120#[serde(rename_all = "snake_case")]
121#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
122#[repr(i32)]
123pub enum CoralogixCustomerSupportAccess {
124    /// The default value, which is unspecified.
125    Unspecified = 0,
126    /// Customer support access is disabled
127    Disabled = 1,
128    /// Customer support access is enabled
129    Enabled = 2,
130}
131impl CoralogixCustomerSupportAccess {
132    /// String value of the enum field names used in the ProtoBuf definition.
133    ///
134    /// The values are not transformed in any way and thus are considered stable
135    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
136    pub fn as_str_name(&self) -> &'static str {
137        match self {
138            Self::Unspecified => "CORALOGIX_CUSTOMER_SUPPORT_ACCESS_UNSPECIFIED",
139            Self::Disabled => "CORALOGIX_CUSTOMER_SUPPORT_ACCESS_DISABLED",
140            Self::Enabled => "CORALOGIX_CUSTOMER_SUPPORT_ACCESS_ENABLED",
141        }
142    }
143    /// Creates an enum from field names used in the ProtoBuf definition.
144    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
145        match value {
146            "CORALOGIX_CUSTOMER_SUPPORT_ACCESS_UNSPECIFIED" => Some(Self::Unspecified),
147            "CORALOGIX_CUSTOMER_SUPPORT_ACCESS_DISABLED" => Some(Self::Disabled),
148            "CORALOGIX_CUSTOMER_SUPPORT_ACCESS_ENABLED" => Some(Self::Enabled),
149            _ => None,
150        }
151    }
152}
153/// Generated client implementations.
154pub mod ip_access_service_client {
155    #![allow(
156        unused_variables,
157        dead_code,
158        missing_docs,
159        clippy::wildcard_imports,
160        clippy::let_unit_value,
161    )]
162    use tonic::codegen::*;
163    use tonic::codegen::http::Uri;
164    /// IpAccessService is the service for managing IP access settings.
165    #[derive(Debug, Clone)]
166    pub struct IpAccessServiceClient<T> {
167        inner: tonic::client::Grpc<T>,
168    }
169    impl IpAccessServiceClient<tonic::transport::Channel> {
170        /// Attempt to create a new client by connecting to a given endpoint.
171        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
172        where
173            D: TryInto<tonic::transport::Endpoint>,
174            D::Error: Into<StdError>,
175        {
176            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
177            Ok(Self::new(conn))
178        }
179    }
180    impl<T> IpAccessServiceClient<T>
181    where
182        T: tonic::client::GrpcService<tonic::body::BoxBody>,
183        T::Error: Into<StdError>,
184        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
185        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
186    {
187        pub fn new(inner: T) -> Self {
188            let inner = tonic::client::Grpc::new(inner);
189            Self { inner }
190        }
191        pub fn with_origin(inner: T, origin: Uri) -> Self {
192            let inner = tonic::client::Grpc::with_origin(inner, origin);
193            Self { inner }
194        }
195        pub fn with_interceptor<F>(
196            inner: T,
197            interceptor: F,
198        ) -> IpAccessServiceClient<InterceptedService<T, F>>
199        where
200            F: tonic::service::Interceptor,
201            T::ResponseBody: Default,
202            T: tonic::codegen::Service<
203                http::Request<tonic::body::BoxBody>,
204                Response = http::Response<
205                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
206                >,
207            >,
208            <T as tonic::codegen::Service<
209                http::Request<tonic::body::BoxBody>,
210            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
211        {
212            IpAccessServiceClient::new(InterceptedService::new(inner, interceptor))
213        }
214        /// Compress requests with the given encoding.
215        ///
216        /// This requires the server to support it otherwise it might respond with an
217        /// error.
218        #[must_use]
219        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
220            self.inner = self.inner.send_compressed(encoding);
221            self
222        }
223        /// Enable decompressing responses.
224        #[must_use]
225        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
226            self.inner = self.inner.accept_compressed(encoding);
227            self
228        }
229        /// Limits the maximum size of a decoded message.
230        ///
231        /// Default: `4MB`
232        #[must_use]
233        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
234            self.inner = self.inner.max_decoding_message_size(limit);
235            self
236        }
237        /// Limits the maximum size of an encoded message.
238        ///
239        /// Default: `usize::MAX`
240        #[must_use]
241        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
242            self.inner = self.inner.max_encoding_message_size(limit);
243            self
244        }
245        /// RPC for creating company IP access settings.
246        pub async fn create_company_ip_access_settings(
247            &mut self,
248            request: impl tonic::IntoRequest<super::CreateCompanyIpAccessSettingsRequest>,
249        ) -> std::result::Result<
250            tonic::Response<super::CreateCompanyIpAccessSettingsResponse>,
251            tonic::Status,
252        > {
253            self.inner
254                .ready()
255                .await
256                .map_err(|e| {
257                    tonic::Status::unknown(
258                        format!("Service was not ready: {}", e.into()),
259                    )
260                })?;
261            let codec = tonic::codec::ProstCodec::default();
262            let path = http::uri::PathAndQuery::from_static(
263                "/com.coralogixapis.aaa.v1.IpAccessService/CreateCompanyIpAccessSettings",
264            );
265            let mut req = request.into_request();
266            req.extensions_mut()
267                .insert(
268                    GrpcMethod::new(
269                        "com.coralogixapis.aaa.v1.IpAccessService",
270                        "CreateCompanyIpAccessSettings",
271                    ),
272                );
273            self.inner.unary(req, path, codec).await
274        }
275        /// RPC for replacing company IP access settings.
276        pub async fn replace_company_ip_access_settings(
277            &mut self,
278            request: impl tonic::IntoRequest<
279                super::ReplaceCompanyIpAccessSettingsRequest,
280            >,
281        ) -> std::result::Result<
282            tonic::Response<super::ReplaceCompanyIpAccessSettingsResponse>,
283            tonic::Status,
284        > {
285            self.inner
286                .ready()
287                .await
288                .map_err(|e| {
289                    tonic::Status::unknown(
290                        format!("Service was not ready: {}", e.into()),
291                    )
292                })?;
293            let codec = tonic::codec::ProstCodec::default();
294            let path = http::uri::PathAndQuery::from_static(
295                "/com.coralogixapis.aaa.v1.IpAccessService/ReplaceCompanyIpAccessSettings",
296            );
297            let mut req = request.into_request();
298            req.extensions_mut()
299                .insert(
300                    GrpcMethod::new(
301                        "com.coralogixapis.aaa.v1.IpAccessService",
302                        "ReplaceCompanyIpAccessSettings",
303                    ),
304                );
305            self.inner.unary(req, path, codec).await
306        }
307        /// RPC for getting company IP access settings.
308        pub async fn get_company_ip_access_settings(
309            &mut self,
310            request: impl tonic::IntoRequest<super::GetCompanyIpAccessSettingsRequest>,
311        ) -> std::result::Result<
312            tonic::Response<super::GetCompanyIpAccessSettingsResponse>,
313            tonic::Status,
314        > {
315            self.inner
316                .ready()
317                .await
318                .map_err(|e| {
319                    tonic::Status::unknown(
320                        format!("Service was not ready: {}", e.into()),
321                    )
322                })?;
323            let codec = tonic::codec::ProstCodec::default();
324            let path = http::uri::PathAndQuery::from_static(
325                "/com.coralogixapis.aaa.v1.IpAccessService/GetCompanyIpAccessSettings",
326            );
327            let mut req = request.into_request();
328            req.extensions_mut()
329                .insert(
330                    GrpcMethod::new(
331                        "com.coralogixapis.aaa.v1.IpAccessService",
332                        "GetCompanyIpAccessSettings",
333                    ),
334                );
335            self.inner.unary(req, path, codec).await
336        }
337        /// RPC for deleting company IP access settings.
338        pub async fn delete_company_ip_access_settings(
339            &mut self,
340            request: impl tonic::IntoRequest<super::DeleteCompanyIpAccessSettingsRequest>,
341        ) -> std::result::Result<
342            tonic::Response<super::DeleteCompanyIpAccessSettingsResponse>,
343            tonic::Status,
344        > {
345            self.inner
346                .ready()
347                .await
348                .map_err(|e| {
349                    tonic::Status::unknown(
350                        format!("Service was not ready: {}", e.into()),
351                    )
352                })?;
353            let codec = tonic::codec::ProstCodec::default();
354            let path = http::uri::PathAndQuery::from_static(
355                "/com.coralogixapis.aaa.v1.IpAccessService/DeleteCompanyIpAccessSettings",
356            );
357            let mut req = request.into_request();
358            req.extensions_mut()
359                .insert(
360                    GrpcMethod::new(
361                        "com.coralogixapis.aaa.v1.IpAccessService",
362                        "DeleteCompanyIpAccessSettings",
363                    ),
364                );
365            self.inner.unary(req, path, codec).await
366        }
367    }
368}