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