Skip to main content

nominal_api_proto/proto/
nominal.authentication.groups.v1.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct Group {
4    #[prost(string, tag = "1")]
5    pub rid: ::prost::alloc::string::String,
6    #[prost(string, tag = "2")]
7    pub org_rid: ::prost::alloc::string::String,
8    #[prost(string, tag = "3")]
9    pub group_id: ::prost::alloc::string::String,
10    #[prost(string, tag = "4")]
11    pub display_name: ::prost::alloc::string::String,
12    #[prost(string, tag = "5")]
13    pub description: ::prost::alloc::string::String,
14    #[prost(string, repeated, tag = "6")]
15    pub user_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
16    #[prost(message, optional, tag = "7")]
17    pub created_at: ::core::option::Option<
18        super::super::super::super::google::protobuf::Timestamp,
19    >,
20    #[prost(message, optional, tag = "8")]
21    pub updated_at: ::core::option::Option<
22        super::super::super::super::google::protobuf::Timestamp,
23    >,
24    #[prost(message, optional, tag = "9")]
25    pub symbol: ::core::option::Option<super::super::super::scout::elements::v1::Symbol>,
26}
27#[derive(Clone, PartialEq, ::prost::Message)]
28pub struct SearchGroupsQuery {
29    #[prost(oneof = "search_groups_query::Query", tags = "1, 2, 3")]
30    pub query: ::core::option::Option<search_groups_query::Query>,
31}
32/// Nested message and enum types in `SearchGroupsQuery`.
33pub mod search_groups_query {
34    #[derive(Clone, PartialEq, ::prost::Oneof)]
35    pub enum Query {
36        #[prost(string, tag = "1")]
37        ExactSubstringText(::prost::alloc::string::String),
38        #[prost(message, tag = "2")]
39        And(super::SearchQueryAnd),
40        #[prost(message, tag = "3")]
41        Or(super::SearchQueryOr),
42    }
43}
44#[derive(Clone, PartialEq, ::prost::Message)]
45pub struct SearchQueryAnd {
46    #[prost(message, repeated, tag = "1")]
47    pub queries: ::prost::alloc::vec::Vec<SearchGroupsQuery>,
48}
49#[derive(Clone, PartialEq, ::prost::Message)]
50pub struct SearchQueryOr {
51    #[prost(message, repeated, tag = "1")]
52    pub queries: ::prost::alloc::vec::Vec<SearchGroupsQuery>,
53}
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct SearchGroupsRequest {
56    #[prost(int32, optional, tag = "1")]
57    pub page_size: ::core::option::Option<i32>,
58    #[prost(string, optional, tag = "2")]
59    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
60    #[prost(message, optional, tag = "3")]
61    pub query: ::core::option::Option<SearchGroupsQuery>,
62}
63#[derive(Clone, PartialEq, ::prost::Message)]
64pub struct SearchGroupsResponse {
65    #[prost(message, repeated, tag = "1")]
66    pub results: ::prost::alloc::vec::Vec<Group>,
67    #[prost(string, optional, tag = "2")]
68    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
69}
70#[derive(Clone, PartialEq, ::prost::Message)]
71pub struct GetGroupRequest {
72    #[prost(string, tag = "1")]
73    pub group_rid: ::prost::alloc::string::String,
74}
75#[derive(Clone, PartialEq, ::prost::Message)]
76pub struct GetGroupResponse {
77    #[prost(message, optional, tag = "1")]
78    pub group: ::core::option::Option<Group>,
79}
80#[derive(Clone, PartialEq, ::prost::Message)]
81pub struct GetGroupByIdRequest {
82    #[prost(string, tag = "1")]
83    pub group_id: ::prost::alloc::string::String,
84}
85#[derive(Clone, PartialEq, ::prost::Message)]
86pub struct GetGroupByIdResponse {
87    #[prost(message, optional, tag = "1")]
88    pub group: ::core::option::Option<Group>,
89}
90#[derive(Clone, PartialEq, ::prost::Message)]
91pub struct GetGroupsRequest {
92    #[prost(string, repeated, tag = "1")]
93    pub group_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
94}
95#[derive(Clone, PartialEq, ::prost::Message)]
96pub struct GetGroupsResponse {
97    #[prost(map = "string, message", tag = "1")]
98    pub groups: ::std::collections::HashMap<::prost::alloc::string::String, Group>,
99}
100#[derive(Clone, PartialEq, ::prost::Message)]
101pub struct UpdateGroupMetadataRequest {
102    #[prost(string, optional, tag = "1")]
103    pub display_name: ::core::option::Option<::prost::alloc::string::String>,
104    #[prost(string, optional, tag = "2")]
105    pub description: ::core::option::Option<::prost::alloc::string::String>,
106    #[prost(message, optional, tag = "3")]
107    pub symbol: ::core::option::Option<
108        update_group_metadata_request::UpdateGroupSymbolWrapper,
109    >,
110}
111/// Nested message and enum types in `UpdateGroupMetadataRequest`.
112pub mod update_group_metadata_request {
113    #[derive(Clone, PartialEq, ::prost::Message)]
114    pub struct UpdateGroupSymbolWrapper {
115        #[prost(message, optional, tag = "1")]
116        pub value: ::core::option::Option<
117            super::super::super::super::scout::elements::v1::Symbol,
118        >,
119    }
120}
121#[derive(Clone, PartialEq, ::prost::Message)]
122pub struct UpdateGroupMetadataRequestWrapper {
123    #[prost(string, tag = "1")]
124    pub group_rid: ::prost::alloc::string::String,
125    #[prost(message, optional, tag = "2")]
126    pub request: ::core::option::Option<UpdateGroupMetadataRequest>,
127}
128#[derive(Clone, PartialEq, ::prost::Message)]
129pub struct UpdateGroupMetadataResponse {
130    #[prost(message, optional, tag = "1")]
131    pub group: ::core::option::Option<Group>,
132}
133#[derive(Clone, PartialEq, ::prost::Message)]
134pub struct CreateOrUpdateGroupRequest {
135    #[prost(message, optional, tag = "1")]
136    pub group: ::core::option::Option<Group>,
137}
138#[derive(Clone, PartialEq, ::prost::Message)]
139pub struct CreateOrUpdateGroupResponse {
140    #[prost(message, optional, tag = "1")]
141    pub group: ::core::option::Option<Group>,
142}
143#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
144#[repr(i32)]
145pub enum GroupErrors {
146    Unauthorized = 0,
147    NotFound = 1,
148    RequestedPageSizeTooLarge = 2,
149    IdConflict = 3,
150    IdentityMismatch = 4,
151    MissingRequiredField = 5,
152}
153impl GroupErrors {
154    /// String value of the enum field names used in the ProtoBuf definition.
155    ///
156    /// The values are not transformed in any way and thus are considered stable
157    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
158    pub fn as_str_name(&self) -> &'static str {
159        match self {
160            Self::Unauthorized => "GROUP_ERRORS_UNAUTHORIZED",
161            Self::NotFound => "GROUP_ERRORS_NOT_FOUND",
162            Self::RequestedPageSizeTooLarge => {
163                "GROUP_ERRORS_REQUESTED_PAGE_SIZE_TOO_LARGE"
164            }
165            Self::IdConflict => "GROUP_ERRORS_ID_CONFLICT",
166            Self::IdentityMismatch => "GROUP_ERRORS_IDENTITY_MISMATCH",
167            Self::MissingRequiredField => "GROUP_ERRORS_MISSING_REQUIRED_FIELD",
168        }
169    }
170    /// Creates an enum from field names used in the ProtoBuf definition.
171    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
172        match value {
173            "GROUP_ERRORS_UNAUTHORIZED" => Some(Self::Unauthorized),
174            "GROUP_ERRORS_NOT_FOUND" => Some(Self::NotFound),
175            "GROUP_ERRORS_REQUESTED_PAGE_SIZE_TOO_LARGE" => {
176                Some(Self::RequestedPageSizeTooLarge)
177            }
178            "GROUP_ERRORS_ID_CONFLICT" => Some(Self::IdConflict),
179            "GROUP_ERRORS_IDENTITY_MISMATCH" => Some(Self::IdentityMismatch),
180            "GROUP_ERRORS_MISSING_REQUIRED_FIELD" => Some(Self::MissingRequiredField),
181            _ => None,
182        }
183    }
184}
185/// Generated client implementations.
186pub mod group_service_client {
187    #![allow(
188        unused_variables,
189        dead_code,
190        missing_docs,
191        clippy::wildcard_imports,
192        clippy::let_unit_value,
193    )]
194    use tonic::codegen::*;
195    use tonic::codegen::http::Uri;
196    #[derive(Debug, Clone)]
197    pub struct GroupServiceClient<T> {
198        inner: tonic::client::Grpc<T>,
199    }
200    impl GroupServiceClient<tonic::transport::Channel> {
201        /// Attempt to create a new client by connecting to a given endpoint.
202        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
203        where
204            D: TryInto<tonic::transport::Endpoint>,
205            D::Error: Into<StdError>,
206        {
207            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
208            Ok(Self::new(conn))
209        }
210    }
211    impl<T> GroupServiceClient<T>
212    where
213        T: tonic::client::GrpcService<tonic::body::Body>,
214        T::Error: Into<StdError>,
215        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
216        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
217    {
218        pub fn new(inner: T) -> Self {
219            let inner = tonic::client::Grpc::new(inner);
220            Self { inner }
221        }
222        pub fn with_origin(inner: T, origin: Uri) -> Self {
223            let inner = tonic::client::Grpc::with_origin(inner, origin);
224            Self { inner }
225        }
226        pub fn with_interceptor<F>(
227            inner: T,
228            interceptor: F,
229        ) -> GroupServiceClient<InterceptedService<T, F>>
230        where
231            F: tonic::service::Interceptor,
232            T::ResponseBody: Default,
233            T: tonic::codegen::Service<
234                http::Request<tonic::body::Body>,
235                Response = http::Response<
236                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
237                >,
238            >,
239            <T as tonic::codegen::Service<
240                http::Request<tonic::body::Body>,
241            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
242        {
243            GroupServiceClient::new(InterceptedService::new(inner, interceptor))
244        }
245        /// Compress requests with the given encoding.
246        ///
247        /// This requires the server to support it otherwise it might respond with an
248        /// error.
249        #[must_use]
250        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
251            self.inner = self.inner.send_compressed(encoding);
252            self
253        }
254        /// Enable decompressing responses.
255        #[must_use]
256        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
257            self.inner = self.inner.accept_compressed(encoding);
258            self
259        }
260        /// Limits the maximum size of a decoded message.
261        ///
262        /// Default: `4MB`
263        #[must_use]
264        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
265            self.inner = self.inner.max_decoding_message_size(limit);
266            self
267        }
268        /// Limits the maximum size of an encoded message.
269        ///
270        /// Default: `usize::MAX`
271        #[must_use]
272        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
273            self.inner = self.inner.max_encoding_message_size(limit);
274            self
275        }
276        pub async fn get_group(
277            &mut self,
278            request: impl tonic::IntoRequest<super::GetGroupRequest>,
279        ) -> std::result::Result<
280            tonic::Response<super::GetGroupResponse>,
281            tonic::Status,
282        > {
283            self.inner
284                .ready()
285                .await
286                .map_err(|e| {
287                    tonic::Status::unknown(
288                        format!("Service was not ready: {}", e.into()),
289                    )
290                })?;
291            let codec = tonic::codec::ProstCodec::default();
292            let path = http::uri::PathAndQuery::from_static(
293                "/nominal.authentication.groups.v1.GroupService/GetGroup",
294            );
295            let mut req = request.into_request();
296            req.extensions_mut()
297                .insert(
298                    GrpcMethod::new(
299                        "nominal.authentication.groups.v1.GroupService",
300                        "GetGroup",
301                    ),
302                );
303            self.inner.unary(req, path, codec).await
304        }
305        pub async fn get_groups(
306            &mut self,
307            request: impl tonic::IntoRequest<super::GetGroupsRequest>,
308        ) -> std::result::Result<
309            tonic::Response<super::GetGroupsResponse>,
310            tonic::Status,
311        > {
312            self.inner
313                .ready()
314                .await
315                .map_err(|e| {
316                    tonic::Status::unknown(
317                        format!("Service was not ready: {}", e.into()),
318                    )
319                })?;
320            let codec = tonic::codec::ProstCodec::default();
321            let path = http::uri::PathAndQuery::from_static(
322                "/nominal.authentication.groups.v1.GroupService/GetGroups",
323            );
324            let mut req = request.into_request();
325            req.extensions_mut()
326                .insert(
327                    GrpcMethod::new(
328                        "nominal.authentication.groups.v1.GroupService",
329                        "GetGroups",
330                    ),
331                );
332            self.inner.unary(req, path, codec).await
333        }
334        pub async fn get_group_by_id(
335            &mut self,
336            request: impl tonic::IntoRequest<super::GetGroupByIdRequest>,
337        ) -> std::result::Result<
338            tonic::Response<super::GetGroupByIdResponse>,
339            tonic::Status,
340        > {
341            self.inner
342                .ready()
343                .await
344                .map_err(|e| {
345                    tonic::Status::unknown(
346                        format!("Service was not ready: {}", e.into()),
347                    )
348                })?;
349            let codec = tonic::codec::ProstCodec::default();
350            let path = http::uri::PathAndQuery::from_static(
351                "/nominal.authentication.groups.v1.GroupService/GetGroupById",
352            );
353            let mut req = request.into_request();
354            req.extensions_mut()
355                .insert(
356                    GrpcMethod::new(
357                        "nominal.authentication.groups.v1.GroupService",
358                        "GetGroupById",
359                    ),
360                );
361            self.inner.unary(req, path, codec).await
362        }
363        pub async fn update_group_metadata(
364            &mut self,
365            request: impl tonic::IntoRequest<super::UpdateGroupMetadataRequestWrapper>,
366        ) -> std::result::Result<
367            tonic::Response<super::UpdateGroupMetadataResponse>,
368            tonic::Status,
369        > {
370            self.inner
371                .ready()
372                .await
373                .map_err(|e| {
374                    tonic::Status::unknown(
375                        format!("Service was not ready: {}", e.into()),
376                    )
377                })?;
378            let codec = tonic::codec::ProstCodec::default();
379            let path = http::uri::PathAndQuery::from_static(
380                "/nominal.authentication.groups.v1.GroupService/UpdateGroupMetadata",
381            );
382            let mut req = request.into_request();
383            req.extensions_mut()
384                .insert(
385                    GrpcMethod::new(
386                        "nominal.authentication.groups.v1.GroupService",
387                        "UpdateGroupMetadata",
388                    ),
389                );
390            self.inner.unary(req, path, codec).await
391        }
392        pub async fn search_groups(
393            &mut self,
394            request: impl tonic::IntoRequest<super::SearchGroupsRequest>,
395        ) -> std::result::Result<
396            tonic::Response<super::SearchGroupsResponse>,
397            tonic::Status,
398        > {
399            self.inner
400                .ready()
401                .await
402                .map_err(|e| {
403                    tonic::Status::unknown(
404                        format!("Service was not ready: {}", e.into()),
405                    )
406                })?;
407            let codec = tonic::codec::ProstCodec::default();
408            let path = http::uri::PathAndQuery::from_static(
409                "/nominal.authentication.groups.v1.GroupService/SearchGroups",
410            );
411            let mut req = request.into_request();
412            req.extensions_mut()
413                .insert(
414                    GrpcMethod::new(
415                        "nominal.authentication.groups.v1.GroupService",
416                        "SearchGroups",
417                    ),
418                );
419            self.inner.unary(req, path, codec).await
420        }
421        pub async fn create_or_update_group(
422            &mut self,
423            request: impl tonic::IntoRequest<super::CreateOrUpdateGroupRequest>,
424        ) -> std::result::Result<
425            tonic::Response<super::CreateOrUpdateGroupResponse>,
426            tonic::Status,
427        > {
428            self.inner
429                .ready()
430                .await
431                .map_err(|e| {
432                    tonic::Status::unknown(
433                        format!("Service was not ready: {}", e.into()),
434                    )
435                })?;
436            let codec = tonic::codec::ProstCodec::default();
437            let path = http::uri::PathAndQuery::from_static(
438                "/nominal.authentication.groups.v1.GroupService/CreateOrUpdateGroup",
439            );
440            let mut req = request.into_request();
441            req.extensions_mut()
442                .insert(
443                    GrpcMethod::new(
444                        "nominal.authentication.groups.v1.GroupService",
445                        "CreateOrUpdateGroup",
446                    ),
447                );
448            self.inner.unary(req, path, codec).await
449        }
450    }
451}