cx_api/generated/
com.coralogix.archive.v2.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 IbmCosTargetSpec {
6    #[prost(string, tag = "1")]
7    pub bucket_crn: ::prost::alloc::string::String,
8    #[prost(string, tag = "2")]
9    pub endpoint: ::prost::alloc::string::String,
10    #[prost(string, optional, tag = "3")]
11    pub service_crn: ::core::option::Option<::prost::alloc::string::String>,
12    #[prost(enumeration = "IbmBucketType", optional, tag = "4")]
13    pub bucket_type: ::core::option::Option<i32>,
14}
15#[derive(serde::Serialize, serde::Deserialize)]
16#[serde(rename_all = "snake_case")]
17#[derive(Clone, PartialEq, ::prost::Message)]
18pub struct S3TargetSpec {
19    #[prost(string, tag = "1")]
20    pub bucket: ::prost::alloc::string::String,
21    #[prost(string, optional, tag = "2")]
22    pub region: ::core::option::Option<::prost::alloc::string::String>,
23}
24#[derive(serde::Serialize, serde::Deserialize)]
25#[serde(rename_all = "snake_case")]
26#[derive(Clone, PartialEq, ::prost::Message)]
27pub struct ArchiveSpec {
28    #[prost(string, tag = "1")]
29    pub archiving_format_id: ::prost::alloc::string::String,
30    #[prost(bool, tag = "2")]
31    pub is_active: bool,
32    #[prost(bool, tag = "3")]
33    pub enable_tags: bool,
34}
35#[derive(serde::Serialize, serde::Deserialize)]
36#[serde(rename_all = "snake_case")]
37#[derive(Clone, PartialEq, ::prost::Message)]
38pub struct Target {
39    #[prost(message, optional, tag = "3")]
40    pub archive_spec: ::core::option::Option<ArchiveSpec>,
41    #[prost(oneof = "target::TargetSpec", tags = "1, 2")]
42    pub target_spec: ::core::option::Option<target::TargetSpec>,
43}
44/// Nested message and enum types in `Target`.
45pub mod target {
46    #[derive(serde::Serialize, serde::Deserialize)]
47    #[serde(rename_all = "snake_case")]
48    #[derive(Clone, PartialEq, ::prost::Oneof)]
49    pub enum TargetSpec {
50        #[prost(message, tag = "1")]
51        S3(super::S3TargetSpec),
52        #[prost(message, tag = "2")]
53        IbmCos(super::IbmCosTargetSpec),
54    }
55}
56#[derive(serde::Serialize, serde::Deserialize)]
57#[serde(rename_all = "snake_case")]
58#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
59#[repr(i32)]
60pub enum IbmBucketType {
61    Unspecified = 0,
62    External = 1,
63    Internal = 2,
64}
65impl IbmBucketType {
66    /// String value of the enum field names used in the ProtoBuf definition.
67    ///
68    /// The values are not transformed in any way and thus are considered stable
69    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
70    pub fn as_str_name(&self) -> &'static str {
71        match self {
72            Self::Unspecified => "IBM_BUCKET_TYPE_UNSPECIFIED",
73            Self::External => "IBM_BUCKET_TYPE_EXTERNAL",
74            Self::Internal => "IBM_BUCKET_TYPE_INTERNAL",
75        }
76    }
77    /// Creates an enum from field names used in the ProtoBuf definition.
78    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
79        match value {
80            "IBM_BUCKET_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
81            "IBM_BUCKET_TYPE_EXTERNAL" => Some(Self::External),
82            "IBM_BUCKET_TYPE_INTERNAL" => Some(Self::Internal),
83            _ => None,
84        }
85    }
86}
87#[derive(serde::Serialize, serde::Deserialize)]
88#[serde(rename_all = "snake_case")]
89#[derive(Clone, Copy, PartialEq, ::prost::Message)]
90pub struct GetTargetRequest {}
91#[derive(serde::Serialize, serde::Deserialize)]
92#[serde(rename_all = "snake_case")]
93#[derive(Clone, PartialEq, ::prost::Message)]
94pub struct GetTargetResponse {
95    #[prost(message, optional, tag = "1")]
96    pub target: ::core::option::Option<Target>,
97}
98#[derive(serde::Serialize, serde::Deserialize)]
99#[serde(rename_all = "snake_case")]
100#[derive(Clone, PartialEq, ::prost::Message)]
101pub struct SetTargetRequest {
102    #[prost(bool, tag = "1")]
103    pub is_active: bool,
104    #[prost(oneof = "set_target_request::TargetSpec", tags = "2, 3")]
105    pub target_spec: ::core::option::Option<set_target_request::TargetSpec>,
106}
107/// Nested message and enum types in `SetTargetRequest`.
108pub mod set_target_request {
109    #[derive(serde::Serialize, serde::Deserialize)]
110    #[serde(rename_all = "snake_case")]
111    #[derive(Clone, PartialEq, ::prost::Oneof)]
112    pub enum TargetSpec {
113        #[prost(message, tag = "2")]
114        S3(super::S3TargetSpec),
115        #[prost(message, tag = "3")]
116        IbmCos(super::IbmCosTargetSpec),
117    }
118}
119#[derive(serde::Serialize, serde::Deserialize)]
120#[serde(rename_all = "snake_case")]
121#[derive(Clone, PartialEq, ::prost::Message)]
122pub struct SetTargetResponse {
123    #[prost(message, optional, tag = "1")]
124    pub target: ::core::option::Option<Target>,
125}
126#[derive(serde::Serialize, serde::Deserialize)]
127#[serde(rename_all = "snake_case")]
128#[derive(Clone, PartialEq, ::prost::Message)]
129pub struct SetExternalTargetRequest {
130    #[prost(bool, tag = "1")]
131    pub is_active: bool,
132    #[prost(uint32, tag = "4")]
133    pub company_id: u32,
134    #[prost(oneof = "set_external_target_request::TargetSpec", tags = "2, 3")]
135    pub target_spec: ::core::option::Option<set_external_target_request::TargetSpec>,
136}
137/// Nested message and enum types in `SetExternalTargetRequest`.
138pub mod set_external_target_request {
139    #[derive(serde::Serialize, serde::Deserialize)]
140    #[serde(rename_all = "snake_case")]
141    #[derive(Clone, PartialEq, ::prost::Oneof)]
142    pub enum TargetSpec {
143        #[prost(message, tag = "2")]
144        S3(super::S3TargetSpec),
145        #[prost(message, tag = "3")]
146        IbmCos(super::IbmCosTargetSpec),
147    }
148}
149#[derive(serde::Serialize, serde::Deserialize)]
150#[serde(rename_all = "snake_case")]
151#[derive(Clone, PartialEq, ::prost::Message)]
152pub struct SetExternalTargetResponse {
153    #[prost(message, optional, tag = "1")]
154    pub target: ::core::option::Option<Target>,
155}
156#[derive(serde::Serialize, serde::Deserialize)]
157#[serde(rename_all = "snake_case")]
158#[derive(Clone, Copy, PartialEq, ::prost::Message)]
159pub struct CompanyArchiveConfig {
160    #[prost(uint32, tag = "1")]
161    pub company_id: u32,
162    #[prost(bool, tag = "2")]
163    pub archive_configured: bool,
164}
165#[derive(serde::Serialize, serde::Deserialize)]
166#[serde(rename_all = "snake_case")]
167#[derive(Clone, PartialEq, ::prost::Message)]
168pub struct ValidateTargetRequest {
169    #[prost(bool, tag = "1")]
170    pub is_active: bool,
171    #[prost(oneof = "validate_target_request::TargetSpec", tags = "2, 3")]
172    pub target_spec: ::core::option::Option<validate_target_request::TargetSpec>,
173}
174/// Nested message and enum types in `ValidateTargetRequest`.
175pub mod validate_target_request {
176    #[derive(serde::Serialize, serde::Deserialize)]
177    #[serde(rename_all = "snake_case")]
178    #[derive(Clone, PartialEq, ::prost::Oneof)]
179    pub enum TargetSpec {
180        #[prost(message, tag = "2")]
181        S3(super::S3TargetSpec),
182        #[prost(message, tag = "3")]
183        IbmCos(super::IbmCosTargetSpec),
184    }
185}
186#[derive(serde::Serialize, serde::Deserialize)]
187#[serde(rename_all = "snake_case")]
188#[derive(Clone, Copy, PartialEq, ::prost::Message)]
189pub struct ValidateTargetResponse {
190    #[prost(bool, tag = "1")]
191    pub is_valid: bool,
192}
193#[derive(serde::Serialize, serde::Deserialize)]
194#[serde(rename_all = "snake_case")]
195#[derive(Clone, Copy, PartialEq, ::prost::Message)]
196pub struct S3TargetServiceGetTargetRequest {}
197#[derive(serde::Serialize, serde::Deserialize)]
198#[serde(rename_all = "snake_case")]
199#[derive(Clone, PartialEq, ::prost::Message)]
200pub struct S3TargetServiceGetTargetResponse {
201    #[prost(message, optional, tag = "1")]
202    pub target: ::core::option::Option<Target>,
203}
204#[derive(serde::Serialize, serde::Deserialize)]
205#[serde(rename_all = "snake_case")]
206#[derive(Clone, PartialEq, ::prost::Message)]
207pub struct S3TargetServiceSetTargetRequest {
208    #[prost(bool, tag = "1")]
209    pub is_active: bool,
210    #[prost(oneof = "s3_target_service_set_target_request::TargetSpec", tags = "2")]
211    pub target_spec: ::core::option::Option<
212        s3_target_service_set_target_request::TargetSpec,
213    >,
214}
215/// Nested message and enum types in `S3TargetServiceSetTargetRequest`.
216pub mod s3_target_service_set_target_request {
217    #[derive(serde::Serialize, serde::Deserialize)]
218    #[serde(rename_all = "snake_case")]
219    #[derive(Clone, PartialEq, ::prost::Oneof)]
220    pub enum TargetSpec {
221        #[prost(message, tag = "2")]
222        S3(super::S3TargetSpec),
223    }
224}
225#[derive(serde::Serialize, serde::Deserialize)]
226#[serde(rename_all = "snake_case")]
227#[derive(Clone, PartialEq, ::prost::Message)]
228pub struct S3TargetServiceSetTargetResponse {
229    #[prost(message, optional, tag = "1")]
230    pub target: ::core::option::Option<Target>,
231}
232/// Generated client implementations.
233pub mod target_service_client {
234    #![allow(
235        unused_variables,
236        dead_code,
237        missing_docs,
238        clippy::wildcard_imports,
239        clippy::let_unit_value,
240    )]
241    use tonic::codegen::*;
242    use tonic::codegen::http::Uri;
243    #[derive(Debug, Clone)]
244    pub struct TargetServiceClient<T> {
245        inner: tonic::client::Grpc<T>,
246    }
247    impl TargetServiceClient<tonic::transport::Channel> {
248        /// Attempt to create a new client by connecting to a given endpoint.
249        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
250        where
251            D: TryInto<tonic::transport::Endpoint>,
252            D::Error: Into<StdError>,
253        {
254            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
255            Ok(Self::new(conn))
256        }
257    }
258    impl<T> TargetServiceClient<T>
259    where
260        T: tonic::client::GrpcService<tonic::body::BoxBody>,
261        T::Error: Into<StdError>,
262        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
263        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
264    {
265        pub fn new(inner: T) -> Self {
266            let inner = tonic::client::Grpc::new(inner);
267            Self { inner }
268        }
269        pub fn with_origin(inner: T, origin: Uri) -> Self {
270            let inner = tonic::client::Grpc::with_origin(inner, origin);
271            Self { inner }
272        }
273        pub fn with_interceptor<F>(
274            inner: T,
275            interceptor: F,
276        ) -> TargetServiceClient<InterceptedService<T, F>>
277        where
278            F: tonic::service::Interceptor,
279            T::ResponseBody: Default,
280            T: tonic::codegen::Service<
281                http::Request<tonic::body::BoxBody>,
282                Response = http::Response<
283                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
284                >,
285            >,
286            <T as tonic::codegen::Service<
287                http::Request<tonic::body::BoxBody>,
288            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
289        {
290            TargetServiceClient::new(InterceptedService::new(inner, interceptor))
291        }
292        /// Compress requests with the given encoding.
293        ///
294        /// This requires the server to support it otherwise it might respond with an
295        /// error.
296        #[must_use]
297        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
298            self.inner = self.inner.send_compressed(encoding);
299            self
300        }
301        /// Enable decompressing responses.
302        #[must_use]
303        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
304            self.inner = self.inner.accept_compressed(encoding);
305            self
306        }
307        /// Limits the maximum size of a decoded message.
308        ///
309        /// Default: `4MB`
310        #[must_use]
311        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
312            self.inner = self.inner.max_decoding_message_size(limit);
313            self
314        }
315        /// Limits the maximum size of an encoded message.
316        ///
317        /// Default: `usize::MAX`
318        #[must_use]
319        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
320            self.inner = self.inner.max_encoding_message_size(limit);
321            self
322        }
323        pub async fn get_target(
324            &mut self,
325            request: impl tonic::IntoRequest<super::GetTargetRequest>,
326        ) -> std::result::Result<
327            tonic::Response<super::GetTargetResponse>,
328            tonic::Status,
329        > {
330            self.inner
331                .ready()
332                .await
333                .map_err(|e| {
334                    tonic::Status::unknown(
335                        format!("Service was not ready: {}", e.into()),
336                    )
337                })?;
338            let codec = tonic::codec::ProstCodec::default();
339            let path = http::uri::PathAndQuery::from_static(
340                "/com.coralogix.archive.v2.TargetService/GetTarget",
341            );
342            let mut req = request.into_request();
343            req.extensions_mut()
344                .insert(
345                    GrpcMethod::new(
346                        "com.coralogix.archive.v2.TargetService",
347                        "GetTarget",
348                    ),
349                );
350            self.inner.unary(req, path, codec).await
351        }
352        pub async fn set_target(
353            &mut self,
354            request: impl tonic::IntoRequest<super::SetTargetRequest>,
355        ) -> std::result::Result<
356            tonic::Response<super::SetTargetResponse>,
357            tonic::Status,
358        > {
359            self.inner
360                .ready()
361                .await
362                .map_err(|e| {
363                    tonic::Status::unknown(
364                        format!("Service was not ready: {}", e.into()),
365                    )
366                })?;
367            let codec = tonic::codec::ProstCodec::default();
368            let path = http::uri::PathAndQuery::from_static(
369                "/com.coralogix.archive.v2.TargetService/SetTarget",
370            );
371            let mut req = request.into_request();
372            req.extensions_mut()
373                .insert(
374                    GrpcMethod::new(
375                        "com.coralogix.archive.v2.TargetService",
376                        "SetTarget",
377                    ),
378                );
379            self.inner.unary(req, path, codec).await
380        }
381        pub async fn validate_target(
382            &mut self,
383            request: impl tonic::IntoRequest<super::ValidateTargetRequest>,
384        ) -> std::result::Result<
385            tonic::Response<super::ValidateTargetResponse>,
386            tonic::Status,
387        > {
388            self.inner
389                .ready()
390                .await
391                .map_err(|e| {
392                    tonic::Status::unknown(
393                        format!("Service was not ready: {}", e.into()),
394                    )
395                })?;
396            let codec = tonic::codec::ProstCodec::default();
397            let path = http::uri::PathAndQuery::from_static(
398                "/com.coralogix.archive.v2.TargetService/ValidateTarget",
399            );
400            let mut req = request.into_request();
401            req.extensions_mut()
402                .insert(
403                    GrpcMethod::new(
404                        "com.coralogix.archive.v2.TargetService",
405                        "ValidateTarget",
406                    ),
407                );
408            self.inner.unary(req, path, codec).await
409        }
410    }
411}
412/// Generated client implementations.
413pub mod s3_target_service_client {
414    #![allow(
415        unused_variables,
416        dead_code,
417        missing_docs,
418        clippy::wildcard_imports,
419        clippy::let_unit_value,
420    )]
421    use tonic::codegen::*;
422    use tonic::codegen::http::Uri;
423    #[derive(Debug, Clone)]
424    pub struct S3TargetServiceClient<T> {
425        inner: tonic::client::Grpc<T>,
426    }
427    impl S3TargetServiceClient<tonic::transport::Channel> {
428        /// Attempt to create a new client by connecting to a given endpoint.
429        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
430        where
431            D: TryInto<tonic::transport::Endpoint>,
432            D::Error: Into<StdError>,
433        {
434            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
435            Ok(Self::new(conn))
436        }
437    }
438    impl<T> S3TargetServiceClient<T>
439    where
440        T: tonic::client::GrpcService<tonic::body::BoxBody>,
441        T::Error: Into<StdError>,
442        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
443        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
444    {
445        pub fn new(inner: T) -> Self {
446            let inner = tonic::client::Grpc::new(inner);
447            Self { inner }
448        }
449        pub fn with_origin(inner: T, origin: Uri) -> Self {
450            let inner = tonic::client::Grpc::with_origin(inner, origin);
451            Self { inner }
452        }
453        pub fn with_interceptor<F>(
454            inner: T,
455            interceptor: F,
456        ) -> S3TargetServiceClient<InterceptedService<T, F>>
457        where
458            F: tonic::service::Interceptor,
459            T::ResponseBody: Default,
460            T: tonic::codegen::Service<
461                http::Request<tonic::body::BoxBody>,
462                Response = http::Response<
463                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
464                >,
465            >,
466            <T as tonic::codegen::Service<
467                http::Request<tonic::body::BoxBody>,
468            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
469        {
470            S3TargetServiceClient::new(InterceptedService::new(inner, interceptor))
471        }
472        /// Compress requests with the given encoding.
473        ///
474        /// This requires the server to support it otherwise it might respond with an
475        /// error.
476        #[must_use]
477        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
478            self.inner = self.inner.send_compressed(encoding);
479            self
480        }
481        /// Enable decompressing responses.
482        #[must_use]
483        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
484            self.inner = self.inner.accept_compressed(encoding);
485            self
486        }
487        /// Limits the maximum size of a decoded message.
488        ///
489        /// Default: `4MB`
490        #[must_use]
491        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
492            self.inner = self.inner.max_decoding_message_size(limit);
493            self
494        }
495        /// Limits the maximum size of an encoded message.
496        ///
497        /// Default: `usize::MAX`
498        #[must_use]
499        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
500            self.inner = self.inner.max_encoding_message_size(limit);
501            self
502        }
503        pub async fn get_target(
504            &mut self,
505            request: impl tonic::IntoRequest<super::S3TargetServiceGetTargetRequest>,
506        ) -> std::result::Result<
507            tonic::Response<super::S3TargetServiceGetTargetResponse>,
508            tonic::Status,
509        > {
510            self.inner
511                .ready()
512                .await
513                .map_err(|e| {
514                    tonic::Status::unknown(
515                        format!("Service was not ready: {}", e.into()),
516                    )
517                })?;
518            let codec = tonic::codec::ProstCodec::default();
519            let path = http::uri::PathAndQuery::from_static(
520                "/com.coralogix.archive.v2.S3TargetService/GetTarget",
521            );
522            let mut req = request.into_request();
523            req.extensions_mut()
524                .insert(
525                    GrpcMethod::new(
526                        "com.coralogix.archive.v2.S3TargetService",
527                        "GetTarget",
528                    ),
529                );
530            self.inner.unary(req, path, codec).await
531        }
532        pub async fn set_target(
533            &mut self,
534            request: impl tonic::IntoRequest<super::S3TargetServiceSetTargetRequest>,
535        ) -> std::result::Result<
536            tonic::Response<super::S3TargetServiceSetTargetResponse>,
537            tonic::Status,
538        > {
539            self.inner
540                .ready()
541                .await
542                .map_err(|e| {
543                    tonic::Status::unknown(
544                        format!("Service was not ready: {}", e.into()),
545                    )
546                })?;
547            let codec = tonic::codec::ProstCodec::default();
548            let path = http::uri::PathAndQuery::from_static(
549                "/com.coralogix.archive.v2.S3TargetService/SetTarget",
550            );
551            let mut req = request.into_request();
552            req.extensions_mut()
553                .insert(
554                    GrpcMethod::new(
555                        "com.coralogix.archive.v2.S3TargetService",
556                        "SetTarget",
557                    ),
558                );
559            self.inner.unary(req, path, codec).await
560        }
561    }
562}