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