cx_api/generated/
com.coralogixapis.aaa.organisations.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 Team {
6    #[prost(message, optional, tag = "1")]
7    pub id: ::core::option::Option<TeamId>,
8    #[prost(string, tag = "2")]
9    pub cluster_id: ::prost::alloc::string::String,
10    #[prost(float, optional, tag = "3")]
11    pub quota: ::core::option::Option<f32>,
12    #[prost(int32, optional, tag = "4")]
13    pub retention: ::core::option::Option<i32>,
14    #[prost(enumeration = "PlanType", optional, tag = "5")]
15    pub plan_type: ::core::option::Option<i32>,
16    #[prost(bool, tag = "6")]
17    pub is_auditing_team: bool,
18    #[prost(string, tag = "7")]
19    pub name: ::prost::alloc::string::String,
20}
21#[derive(serde::Serialize, serde::Deserialize)]
22#[serde(rename_all = "snake_case")]
23#[derive(Clone, PartialEq, ::prost::Message)]
24pub struct TeamInfo {
25    #[prost(message, optional, tag = "1")]
26    pub id: ::core::option::Option<TeamId>,
27    #[prost(message, optional, tag = "2")]
28    pub organisation_id: ::core::option::Option<OrganisationId>,
29    #[prost(string, tag = "3")]
30    pub organisation_name: ::prost::alloc::string::String,
31}
32#[derive(serde::Serialize, serde::Deserialize)]
33#[serde(rename_all = "snake_case")]
34#[derive(Clone, Copy, PartialEq, ::prost::Message)]
35pub struct TeamId {
36    #[prost(uint32, tag = "1")]
37    pub id: u32,
38}
39#[derive(serde::Serialize, serde::Deserialize)]
40#[serde(rename_all = "snake_case")]
41#[derive(Clone, PartialEq, ::prost::Message)]
42pub struct OrganisationId {
43    #[prost(string, tag = "1")]
44    pub id: ::prost::alloc::string::String,
45}
46#[derive(serde::Serialize, serde::Deserialize)]
47#[serde(rename_all = "snake_case")]
48#[derive(Clone, PartialEq, ::prost::Message)]
49pub struct UserId {
50    #[prost(string, tag = "1")]
51    pub id: ::prost::alloc::string::String,
52}
53#[derive(serde::Serialize, serde::Deserialize)]
54#[serde(rename_all = "snake_case")]
55#[derive(Clone, Copy, PartialEq, ::prost::Message)]
56pub struct UserAccountId {
57    #[prost(uint32, tag = "1")]
58    pub id: u32,
59}
60#[derive(serde::Serialize, serde::Deserialize)]
61#[serde(rename_all = "snake_case")]
62#[derive(Clone, PartialEq, ::prost::Message)]
63pub struct User {
64    #[prost(string, tag = "1")]
65    pub first_name: ::prost::alloc::string::String,
66    #[prost(string, tag = "2")]
67    pub last_name: ::prost::alloc::string::String,
68    #[prost(string, tag = "3")]
69    pub username: ::prost::alloc::string::String,
70    #[prost(message, optional, tag = "4")]
71    pub user_account_id: ::core::option::Option<UserAccountId>,
72}
73#[derive(serde::Serialize, serde::Deserialize)]
74#[serde(rename_all = "snake_case")]
75#[derive(Clone, Copy, PartialEq, ::prost::Message)]
76pub struct TeamCount {
77    #[prost(message, optional, tag = "1")]
78    pub team_id: ::core::option::Option<TeamId>,
79    #[prost(uint32, tag = "2")]
80    pub team_member_count: u32,
81}
82#[derive(serde::Serialize, serde::Deserialize)]
83#[serde(rename_all = "snake_case")]
84#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
85#[repr(i32)]
86pub enum PlanType {
87    Unspecified = 0,
88    PostTrial = 1,
89    Plan = 2,
90    Trial = 3,
91}
92impl PlanType {
93    /// String value of the enum field names used in the ProtoBuf definition.
94    ///
95    /// The values are not transformed in any way and thus are considered stable
96    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
97    pub fn as_str_name(&self) -> &'static str {
98        match self {
99            Self::Unspecified => "PLAN_TYPE_UNSPECIFIED",
100            Self::PostTrial => "PLAN_TYPE_POST_TRIAL",
101            Self::Plan => "PLAN_TYPE_PLAN",
102            Self::Trial => "PLAN_TYPE_TRIAL",
103        }
104    }
105    /// Creates an enum from field names used in the ProtoBuf definition.
106    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
107        match value {
108            "PLAN_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
109            "PLAN_TYPE_POST_TRIAL" => Some(Self::PostTrial),
110            "PLAN_TYPE_PLAN" => Some(Self::Plan),
111            "PLAN_TYPE_TRIAL" => Some(Self::Trial),
112            _ => None,
113        }
114    }
115}
116#[derive(serde::Serialize, serde::Deserialize)]
117#[serde(rename_all = "snake_case")]
118#[derive(Clone, Copy, PartialEq, ::prost::Message)]
119pub struct ListTeamsRequest {}
120#[derive(serde::Serialize, serde::Deserialize)]
121#[serde(rename_all = "snake_case")]
122#[derive(Clone, PartialEq, ::prost::Message)]
123pub struct ListTeamsResponse {
124    #[prost(message, optional, tag = "1")]
125    pub default_team: ::core::option::Option<list_teams_response::TeamInfo>,
126    #[prost(message, repeated, tag = "2")]
127    pub teams: ::prost::alloc::vec::Vec<list_teams_response::TeamInfo>,
128}
129/// Nested message and enum types in `ListTeamsResponse`.
130pub mod list_teams_response {
131    #[derive(serde::Serialize, serde::Deserialize)]
132    #[serde(rename_all = "snake_case")]
133    #[derive(Clone, PartialEq, ::prost::Message)]
134    pub struct TeamInfo {
135        #[prost(message, optional, tag = "1")]
136        pub team_id: ::core::option::Option<super::TeamId>,
137        #[prost(string, tag = "2")]
138        pub team_name: ::prost::alloc::string::String,
139        #[prost(double, tag = "3")]
140        pub daily_quota: f64,
141        #[prost(int32, tag = "4")]
142        pub retention: i32,
143    }
144}
145#[derive(serde::Serialize, serde::Deserialize)]
146#[serde(rename_all = "snake_case")]
147#[derive(Clone, Copy, PartialEq, ::prost::Message)]
148pub struct GetTeamRequest {
149    #[prost(message, optional, tag = "1")]
150    pub team_id: ::core::option::Option<TeamId>,
151}
152#[derive(serde::Serialize, serde::Deserialize)]
153#[serde(rename_all = "snake_case")]
154#[derive(Clone, PartialEq, ::prost::Message)]
155pub struct GetTeamResponse {
156    #[prost(message, optional, tag = "1")]
157    pub team_id: ::core::option::Option<TeamId>,
158    #[prost(string, tag = "2")]
159    pub team_name: ::prost::alloc::string::String,
160    #[prost(double, tag = "3")]
161    pub daily_quota: f64,
162    #[prost(int32, tag = "4")]
163    pub retention: i32,
164}
165#[derive(serde::Serialize, serde::Deserialize)]
166#[serde(rename_all = "snake_case")]
167#[derive(Clone, Copy, PartialEq, ::prost::Message)]
168pub struct DeleteTeamRequest {
169    #[prost(message, optional, tag = "1")]
170    pub team_id: ::core::option::Option<TeamId>,
171}
172#[derive(serde::Serialize, serde::Deserialize)]
173#[serde(rename_all = "snake_case")]
174#[derive(Clone, Copy, PartialEq, ::prost::Message)]
175pub struct DeleteTeamResponse {}
176#[derive(serde::Serialize, serde::Deserialize)]
177#[serde(rename_all = "snake_case")]
178#[derive(Clone, PartialEq, ::prost::Message)]
179pub struct UpdateTeamRequest {
180    #[prost(message, optional, tag = "1")]
181    pub team_id: ::core::option::Option<TeamId>,
182    #[prost(string, optional, tag = "2")]
183    pub team_name: ::core::option::Option<::prost::alloc::string::String>,
184    #[prost(double, optional, tag = "3")]
185    pub daily_quota: ::core::option::Option<f64>,
186}
187#[derive(serde::Serialize, serde::Deserialize)]
188#[serde(rename_all = "snake_case")]
189#[derive(Clone, Copy, PartialEq, ::prost::Message)]
190pub struct UpdateTeamResponse {}
191#[derive(serde::Serialize, serde::Deserialize)]
192#[serde(rename_all = "snake_case")]
193#[derive(Clone, PartialEq, ::prost::Message)]
194pub struct CreateTeamInOrgRequest {
195    #[prost(string, tag = "1")]
196    pub team_name: ::prost::alloc::string::String,
197    #[prost(string, repeated, tag = "3")]
198    pub team_admins_email: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
199    /// Default daily quota is 0.01 units/day
200    #[prost(double, optional, tag = "6")]
201    pub daily_quota: ::core::option::Option<f64>,
202}
203#[derive(serde::Serialize, serde::Deserialize)]
204#[serde(rename_all = "snake_case")]
205#[derive(Clone, Copy, PartialEq, ::prost::Message)]
206pub struct CreateTeamInOrgResponse {
207    #[prost(message, optional, tag = "1")]
208    pub team_id: ::core::option::Option<TeamId>,
209}
210#[derive(serde::Serialize, serde::Deserialize)]
211#[serde(rename_all = "snake_case")]
212#[derive(Clone, Copy, PartialEq, ::prost::Message)]
213pub struct MoveQuotaRequest {
214    #[prost(message, optional, tag = "1")]
215    pub source_team: ::core::option::Option<TeamId>,
216    #[prost(message, optional, tag = "2")]
217    pub destination_team: ::core::option::Option<TeamId>,
218    #[prost(double, tag = "3")]
219    pub units_to_move: f64,
220}
221#[derive(serde::Serialize, serde::Deserialize)]
222#[serde(rename_all = "snake_case")]
223#[derive(Clone, Copy, PartialEq, ::prost::Message)]
224pub struct MoveQuotaResponse {
225    #[prost(double, tag = "1")]
226    pub source_team_quota: f64,
227    #[prost(double, tag = "2")]
228    pub destination_team_quota: f64,
229}
230#[derive(serde::Serialize, serde::Deserialize)]
231#[serde(rename_all = "snake_case")]
232#[derive(Clone, Copy, PartialEq, ::prost::Message)]
233pub struct GetTeamQuotaRequest {
234    #[prost(message, optional, tag = "1")]
235    pub team_id: ::core::option::Option<TeamId>,
236}
237#[derive(serde::Serialize, serde::Deserialize)]
238#[serde(rename_all = "snake_case")]
239#[derive(Clone, Copy, PartialEq, ::prost::Message)]
240pub struct GetTeamQuotaResponse {
241    #[prost(message, optional, tag = "1")]
242    pub team_id: ::core::option::Option<TeamId>,
243    #[prost(float, tag = "2")]
244    pub quota: f32,
245    #[prost(int32, tag = "3")]
246    pub retention: i32,
247}
248#[derive(serde::Serialize, serde::Deserialize)]
249#[serde(rename_all = "snake_case")]
250#[derive(Clone, Copy, PartialEq, ::prost::Message)]
251pub struct SetDailyQuotaRequest {
252    #[prost(message, optional, tag = "1")]
253    pub team_id: ::core::option::Option<TeamId>,
254    #[prost(float, tag = "2")]
255    pub target_daily_quota: f32,
256}
257#[derive(serde::Serialize, serde::Deserialize)]
258#[serde(rename_all = "snake_case")]
259#[derive(Clone, Copy, PartialEq, ::prost::Message)]
260pub struct SetDailyQuotaResponse {}
261/// Generated client implementations.
262pub mod team_service_client {
263    #![allow(
264        unused_variables,
265        dead_code,
266        missing_docs,
267        clippy::wildcard_imports,
268        clippy::let_unit_value,
269    )]
270    use tonic::codegen::*;
271    use tonic::codegen::http::Uri;
272    #[derive(Debug, Clone)]
273    pub struct TeamServiceClient<T> {
274        inner: tonic::client::Grpc<T>,
275    }
276    impl TeamServiceClient<tonic::transport::Channel> {
277        /// Attempt to create a new client by connecting to a given endpoint.
278        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
279        where
280            D: TryInto<tonic::transport::Endpoint>,
281            D::Error: Into<StdError>,
282        {
283            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
284            Ok(Self::new(conn))
285        }
286    }
287    impl<T> TeamServiceClient<T>
288    where
289        T: tonic::client::GrpcService<tonic::body::BoxBody>,
290        T::Error: Into<StdError>,
291        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
292        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
293    {
294        pub fn new(inner: T) -> Self {
295            let inner = tonic::client::Grpc::new(inner);
296            Self { inner }
297        }
298        pub fn with_origin(inner: T, origin: Uri) -> Self {
299            let inner = tonic::client::Grpc::with_origin(inner, origin);
300            Self { inner }
301        }
302        pub fn with_interceptor<F>(
303            inner: T,
304            interceptor: F,
305        ) -> TeamServiceClient<InterceptedService<T, F>>
306        where
307            F: tonic::service::Interceptor,
308            T::ResponseBody: Default,
309            T: tonic::codegen::Service<
310                http::Request<tonic::body::BoxBody>,
311                Response = http::Response<
312                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
313                >,
314            >,
315            <T as tonic::codegen::Service<
316                http::Request<tonic::body::BoxBody>,
317            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
318        {
319            TeamServiceClient::new(InterceptedService::new(inner, interceptor))
320        }
321        /// Compress requests with the given encoding.
322        ///
323        /// This requires the server to support it otherwise it might respond with an
324        /// error.
325        #[must_use]
326        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
327            self.inner = self.inner.send_compressed(encoding);
328            self
329        }
330        /// Enable decompressing responses.
331        #[must_use]
332        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
333            self.inner = self.inner.accept_compressed(encoding);
334            self
335        }
336        /// Limits the maximum size of a decoded message.
337        ///
338        /// Default: `4MB`
339        #[must_use]
340        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
341            self.inner = self.inner.max_decoding_message_size(limit);
342            self
343        }
344        /// Limits the maximum size of an encoded message.
345        ///
346        /// Default: `usize::MAX`
347        #[must_use]
348        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
349            self.inner = self.inner.max_encoding_message_size(limit);
350            self
351        }
352        pub async fn create_team_in_org(
353            &mut self,
354            request: impl tonic::IntoRequest<super::CreateTeamInOrgRequest>,
355        ) -> std::result::Result<
356            tonic::Response<super::CreateTeamInOrgResponse>,
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.coralogixapis.aaa.organisations.v2.TeamService/CreateTeamInOrg",
370            );
371            let mut req = request.into_request();
372            req.extensions_mut()
373                .insert(
374                    GrpcMethod::new(
375                        "com.coralogixapis.aaa.organisations.v2.TeamService",
376                        "CreateTeamInOrg",
377                    ),
378                );
379            self.inner.unary(req, path, codec).await
380        }
381        pub async fn move_quota(
382            &mut self,
383            request: impl tonic::IntoRequest<super::MoveQuotaRequest>,
384        ) -> std::result::Result<
385            tonic::Response<super::MoveQuotaResponse>,
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.coralogixapis.aaa.organisations.v2.TeamService/MoveQuota",
399            );
400            let mut req = request.into_request();
401            req.extensions_mut()
402                .insert(
403                    GrpcMethod::new(
404                        "com.coralogixapis.aaa.organisations.v2.TeamService",
405                        "MoveQuota",
406                    ),
407                );
408            self.inner.unary(req, path, codec).await
409        }
410        pub async fn get_team_quota(
411            &mut self,
412            request: impl tonic::IntoRequest<super::GetTeamQuotaRequest>,
413        ) -> std::result::Result<
414            tonic::Response<super::GetTeamQuotaResponse>,
415            tonic::Status,
416        > {
417            self.inner
418                .ready()
419                .await
420                .map_err(|e| {
421                    tonic::Status::unknown(
422                        format!("Service was not ready: {}", e.into()),
423                    )
424                })?;
425            let codec = tonic::codec::ProstCodec::default();
426            let path = http::uri::PathAndQuery::from_static(
427                "/com.coralogixapis.aaa.organisations.v2.TeamService/GetTeamQuota",
428            );
429            let mut req = request.into_request();
430            req.extensions_mut()
431                .insert(
432                    GrpcMethod::new(
433                        "com.coralogixapis.aaa.organisations.v2.TeamService",
434                        "GetTeamQuota",
435                    ),
436                );
437            self.inner.unary(req, path, codec).await
438        }
439        pub async fn set_daily_quota(
440            &mut self,
441            request: impl tonic::IntoRequest<super::SetDailyQuotaRequest>,
442        ) -> std::result::Result<
443            tonic::Response<super::SetDailyQuotaResponse>,
444            tonic::Status,
445        > {
446            self.inner
447                .ready()
448                .await
449                .map_err(|e| {
450                    tonic::Status::unknown(
451                        format!("Service was not ready: {}", e.into()),
452                    )
453                })?;
454            let codec = tonic::codec::ProstCodec::default();
455            let path = http::uri::PathAndQuery::from_static(
456                "/com.coralogixapis.aaa.organisations.v2.TeamService/SetDailyQuota",
457            );
458            let mut req = request.into_request();
459            req.extensions_mut()
460                .insert(
461                    GrpcMethod::new(
462                        "com.coralogixapis.aaa.organisations.v2.TeamService",
463                        "SetDailyQuota",
464                    ),
465                );
466            self.inner.unary(req, path, codec).await
467        }
468        pub async fn update_team(
469            &mut self,
470            request: impl tonic::IntoRequest<super::UpdateTeamRequest>,
471        ) -> std::result::Result<
472            tonic::Response<super::UpdateTeamResponse>,
473            tonic::Status,
474        > {
475            self.inner
476                .ready()
477                .await
478                .map_err(|e| {
479                    tonic::Status::unknown(
480                        format!("Service was not ready: {}", e.into()),
481                    )
482                })?;
483            let codec = tonic::codec::ProstCodec::default();
484            let path = http::uri::PathAndQuery::from_static(
485                "/com.coralogixapis.aaa.organisations.v2.TeamService/UpdateTeam",
486            );
487            let mut req = request.into_request();
488            req.extensions_mut()
489                .insert(
490                    GrpcMethod::new(
491                        "com.coralogixapis.aaa.organisations.v2.TeamService",
492                        "UpdateTeam",
493                    ),
494                );
495            self.inner.unary(req, path, codec).await
496        }
497        pub async fn get_team(
498            &mut self,
499            request: impl tonic::IntoRequest<super::GetTeamRequest>,
500        ) -> std::result::Result<
501            tonic::Response<super::GetTeamResponse>,
502            tonic::Status,
503        > {
504            self.inner
505                .ready()
506                .await
507                .map_err(|e| {
508                    tonic::Status::unknown(
509                        format!("Service was not ready: {}", e.into()),
510                    )
511                })?;
512            let codec = tonic::codec::ProstCodec::default();
513            let path = http::uri::PathAndQuery::from_static(
514                "/com.coralogixapis.aaa.organisations.v2.TeamService/GetTeam",
515            );
516            let mut req = request.into_request();
517            req.extensions_mut()
518                .insert(
519                    GrpcMethod::new(
520                        "com.coralogixapis.aaa.organisations.v2.TeamService",
521                        "GetTeam",
522                    ),
523                );
524            self.inner.unary(req, path, codec).await
525        }
526        pub async fn delete_team(
527            &mut self,
528            request: impl tonic::IntoRequest<super::DeleteTeamRequest>,
529        ) -> std::result::Result<
530            tonic::Response<super::DeleteTeamResponse>,
531            tonic::Status,
532        > {
533            self.inner
534                .ready()
535                .await
536                .map_err(|e| {
537                    tonic::Status::unknown(
538                        format!("Service was not ready: {}", e.into()),
539                    )
540                })?;
541            let codec = tonic::codec::ProstCodec::default();
542            let path = http::uri::PathAndQuery::from_static(
543                "/com.coralogixapis.aaa.organisations.v2.TeamService/DeleteTeam",
544            );
545            let mut req = request.into_request();
546            req.extensions_mut()
547                .insert(
548                    GrpcMethod::new(
549                        "com.coralogixapis.aaa.organisations.v2.TeamService",
550                        "DeleteTeam",
551                    ),
552                );
553            self.inner.unary(req, path, codec).await
554        }
555        pub async fn list_teams(
556            &mut self,
557            request: impl tonic::IntoRequest<super::ListTeamsRequest>,
558        ) -> std::result::Result<
559            tonic::Response<super::ListTeamsResponse>,
560            tonic::Status,
561        > {
562            self.inner
563                .ready()
564                .await
565                .map_err(|e| {
566                    tonic::Status::unknown(
567                        format!("Service was not ready: {}", e.into()),
568                    )
569                })?;
570            let codec = tonic::codec::ProstCodec::default();
571            let path = http::uri::PathAndQuery::from_static(
572                "/com.coralogixapis.aaa.organisations.v2.TeamService/ListTeams",
573            );
574            let mut req = request.into_request();
575            req.extensions_mut()
576                .insert(
577                    GrpcMethod::new(
578                        "com.coralogixapis.aaa.organisations.v2.TeamService",
579                        "ListTeams",
580                    ),
581                );
582            self.inner.unary(req, path, codec).await
583        }
584    }
585}