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