1#[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}
44pub 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 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 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}
107pub 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}
137pub 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}
174pub 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}
193pub mod target_service_client {
195 #![allow(
196 unused_variables,
197 dead_code,
198 missing_docs,
199 clippy::wildcard_imports,
200 clippy::let_unit_value,
201 )]
202 use tonic::codegen::*;
203 use tonic::codegen::http::Uri;
204 #[derive(Debug, Clone)]
205 pub struct TargetServiceClient<T> {
206 inner: tonic::client::Grpc<T>,
207 }
208 impl TargetServiceClient<tonic::transport::Channel> {
209 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
211 where
212 D: TryInto<tonic::transport::Endpoint>,
213 D::Error: Into<StdError>,
214 {
215 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
216 Ok(Self::new(conn))
217 }
218 }
219 impl<T> TargetServiceClient<T>
220 where
221 T: tonic::client::GrpcService<tonic::body::BoxBody>,
222 T::Error: Into<StdError>,
223 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
224 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
225 {
226 pub fn new(inner: T) -> Self {
227 let inner = tonic::client::Grpc::new(inner);
228 Self { inner }
229 }
230 pub fn with_origin(inner: T, origin: Uri) -> Self {
231 let inner = tonic::client::Grpc::with_origin(inner, origin);
232 Self { inner }
233 }
234 pub fn with_interceptor<F>(
235 inner: T,
236 interceptor: F,
237 ) -> TargetServiceClient<InterceptedService<T, F>>
238 where
239 F: tonic::service::Interceptor,
240 T::ResponseBody: Default,
241 T: tonic::codegen::Service<
242 http::Request<tonic::body::BoxBody>,
243 Response = http::Response<
244 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
245 >,
246 >,
247 <T as tonic::codegen::Service<
248 http::Request<tonic::body::BoxBody>,
249 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
250 {
251 TargetServiceClient::new(InterceptedService::new(inner, interceptor))
252 }
253 #[must_use]
258 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
259 self.inner = self.inner.send_compressed(encoding);
260 self
261 }
262 #[must_use]
264 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
265 self.inner = self.inner.accept_compressed(encoding);
266 self
267 }
268 #[must_use]
272 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
273 self.inner = self.inner.max_decoding_message_size(limit);
274 self
275 }
276 #[must_use]
280 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
281 self.inner = self.inner.max_encoding_message_size(limit);
282 self
283 }
284 pub async fn get_target(
285 &mut self,
286 request: impl tonic::IntoRequest<super::GetTargetRequest>,
287 ) -> std::result::Result<
288 tonic::Response<super::GetTargetResponse>,
289 tonic::Status,
290 > {
291 self.inner
292 .ready()
293 .await
294 .map_err(|e| {
295 tonic::Status::unknown(
296 format!("Service was not ready: {}", e.into()),
297 )
298 })?;
299 let codec = tonic::codec::ProstCodec::default();
300 let path = http::uri::PathAndQuery::from_static(
301 "/com.coralogix.archive.v2.TargetService/GetTarget",
302 );
303 let mut req = request.into_request();
304 req.extensions_mut()
305 .insert(
306 GrpcMethod::new(
307 "com.coralogix.archive.v2.TargetService",
308 "GetTarget",
309 ),
310 );
311 self.inner.unary(req, path, codec).await
312 }
313 pub async fn set_target(
314 &mut self,
315 request: impl tonic::IntoRequest<super::SetTargetRequest>,
316 ) -> std::result::Result<
317 tonic::Response<super::SetTargetResponse>,
318 tonic::Status,
319 > {
320 self.inner
321 .ready()
322 .await
323 .map_err(|e| {
324 tonic::Status::unknown(
325 format!("Service was not ready: {}", e.into()),
326 )
327 })?;
328 let codec = tonic::codec::ProstCodec::default();
329 let path = http::uri::PathAndQuery::from_static(
330 "/com.coralogix.archive.v2.TargetService/SetTarget",
331 );
332 let mut req = request.into_request();
333 req.extensions_mut()
334 .insert(
335 GrpcMethod::new(
336 "com.coralogix.archive.v2.TargetService",
337 "SetTarget",
338 ),
339 );
340 self.inner.unary(req, path, codec).await
341 }
342 pub async fn validate_target(
343 &mut self,
344 request: impl tonic::IntoRequest<super::ValidateTargetRequest>,
345 ) -> std::result::Result<
346 tonic::Response<super::ValidateTargetResponse>,
347 tonic::Status,
348 > {
349 self.inner
350 .ready()
351 .await
352 .map_err(|e| {
353 tonic::Status::unknown(
354 format!("Service was not ready: {}", e.into()),
355 )
356 })?;
357 let codec = tonic::codec::ProstCodec::default();
358 let path = http::uri::PathAndQuery::from_static(
359 "/com.coralogix.archive.v2.TargetService/ValidateTarget",
360 );
361 let mut req = request.into_request();
362 req.extensions_mut()
363 .insert(
364 GrpcMethod::new(
365 "com.coralogix.archive.v2.TargetService",
366 "ValidateTarget",
367 ),
368 );
369 self.inner.unary(req, path, codec).await
370 }
371 }
372}