1#[allow(clippy::derive_partial_eq_without_eq)]
6#[derive(Clone, PartialEq, ::prost::Message)]
7pub struct Relationship {
8 #[prost(message, optional, tag = "1")]
10 pub resource: ::core::option::Option<ObjectReference>,
11 #[prost(string, tag = "2")]
13 pub relation: ::prost::alloc::string::String,
14 #[prost(message, optional, tag = "3")]
16 pub subject: ::core::option::Option<SubjectReference>,
17 #[prost(message, optional, tag = "4")]
19 pub optional_caveat: ::core::option::Option<ContextualizedCaveat>,
20}
21#[allow(clippy::derive_partial_eq_without_eq)]
25#[derive(Clone, PartialEq, ::prost::Message)]
26pub struct ContextualizedCaveat {
27 #[prost(string, tag = "1")]
29 pub caveat_name: ::prost::alloc::string::String,
30 #[prost(message, optional, tag = "2")]
32 pub context: ::core::option::Option<::prost_types::Struct>,
33}
34#[allow(clippy::derive_partial_eq_without_eq)]
38#[derive(Clone, PartialEq, ::prost::Message)]
39pub struct SubjectReference {
40 #[prost(message, optional, tag = "1")]
41 pub object: ::core::option::Option<ObjectReference>,
42 #[prost(string, tag = "2")]
43 pub optional_relation: ::prost::alloc::string::String,
44}
45#[allow(clippy::derive_partial_eq_without_eq)]
47#[derive(Clone, PartialEq, ::prost::Message)]
48pub struct ObjectReference {
49 #[prost(string, tag = "1")]
50 pub object_type: ::prost::alloc::string::String,
51 #[prost(string, tag = "2")]
52 pub object_id: ::prost::alloc::string::String,
53}
54#[allow(clippy::derive_partial_eq_without_eq)]
59#[derive(Clone, PartialEq, ::prost::Message)]
60pub struct ZedToken {
61 #[prost(string, tag = "1")]
62 pub token: ::prost::alloc::string::String,
63}
64#[allow(clippy::derive_partial_eq_without_eq)]
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct Cursor {
69 #[prost(string, tag = "1")]
70 pub token: ::prost::alloc::string::String,
71}
72#[allow(clippy::derive_partial_eq_without_eq)]
84#[derive(Clone, PartialEq, ::prost::Message)]
85pub struct RelationshipUpdate {
86 #[prost(enumeration = "relationship_update::Operation", tag = "1")]
87 pub operation: i32,
88 #[prost(message, optional, tag = "2")]
89 pub relationship: ::core::option::Option<Relationship>,
90}
91pub mod relationship_update {
93 #[derive(
94 Clone,
95 Copy,
96 Debug,
97 PartialEq,
98 Eq,
99 Hash,
100 PartialOrd,
101 Ord,
102 ::prost::Enumeration
103 )]
104 #[repr(i32)]
105 pub enum Operation {
106 Unspecified = 0,
107 Create = 1,
108 Touch = 2,
109 Delete = 3,
110 }
111 impl Operation {
112 pub fn as_str_name(&self) -> &'static str {
117 match self {
118 Operation::Unspecified => "OPERATION_UNSPECIFIED",
119 Operation::Create => "OPERATION_CREATE",
120 Operation::Touch => "OPERATION_TOUCH",
121 Operation::Delete => "OPERATION_DELETE",
122 }
123 }
124 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
126 match value {
127 "OPERATION_UNSPECIFIED" => Some(Self::Unspecified),
128 "OPERATION_CREATE" => Some(Self::Create),
129 "OPERATION_TOUCH" => Some(Self::Touch),
130 "OPERATION_DELETE" => Some(Self::Delete),
131 _ => None,
132 }
133 }
134 }
135}
136#[allow(clippy::derive_partial_eq_without_eq)]
139#[derive(Clone, PartialEq, ::prost::Message)]
140pub struct PermissionRelationshipTree {
141 #[prost(message, optional, tag = "3")]
142 pub expanded_object: ::core::option::Option<ObjectReference>,
143 #[prost(string, tag = "4")]
144 pub expanded_relation: ::prost::alloc::string::String,
145 #[prost(oneof = "permission_relationship_tree::TreeType", tags = "1, 2")]
146 pub tree_type: ::core::option::Option<permission_relationship_tree::TreeType>,
147}
148pub mod permission_relationship_tree {
150 #[allow(clippy::derive_partial_eq_without_eq)]
151 #[derive(Clone, PartialEq, ::prost::Oneof)]
152 pub enum TreeType {
153 #[prost(message, tag = "1")]
154 Intermediate(super::AlgebraicSubjectSet),
155 #[prost(message, tag = "2")]
156 Leaf(super::DirectSubjectSet),
157 }
158}
159#[allow(clippy::derive_partial_eq_without_eq)]
170#[derive(Clone, PartialEq, ::prost::Message)]
171pub struct AlgebraicSubjectSet {
172 #[prost(enumeration = "algebraic_subject_set::Operation", tag = "1")]
173 pub operation: i32,
174 #[prost(message, repeated, tag = "2")]
175 pub children: ::prost::alloc::vec::Vec<PermissionRelationshipTree>,
176}
177pub mod algebraic_subject_set {
179 #[derive(
180 Clone,
181 Copy,
182 Debug,
183 PartialEq,
184 Eq,
185 Hash,
186 PartialOrd,
187 Ord,
188 ::prost::Enumeration
189 )]
190 #[repr(i32)]
191 pub enum Operation {
192 Unspecified = 0,
193 Union = 1,
194 Intersection = 2,
195 Exclusion = 3,
196 }
197 impl Operation {
198 pub fn as_str_name(&self) -> &'static str {
203 match self {
204 Operation::Unspecified => "OPERATION_UNSPECIFIED",
205 Operation::Union => "OPERATION_UNION",
206 Operation::Intersection => "OPERATION_INTERSECTION",
207 Operation::Exclusion => "OPERATION_EXCLUSION",
208 }
209 }
210 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
212 match value {
213 "OPERATION_UNSPECIFIED" => Some(Self::Unspecified),
214 "OPERATION_UNION" => Some(Self::Union),
215 "OPERATION_INTERSECTION" => Some(Self::Intersection),
216 "OPERATION_EXCLUSION" => Some(Self::Exclusion),
217 _ => None,
218 }
219 }
220 }
221}
222#[allow(clippy::derive_partial_eq_without_eq)]
224#[derive(Clone, PartialEq, ::prost::Message)]
225pub struct DirectSubjectSet {
226 #[prost(message, repeated, tag = "1")]
227 pub subjects: ::prost::alloc::vec::Vec<SubjectReference>,
228}
229#[allow(clippy::derive_partial_eq_without_eq)]
232#[derive(Clone, PartialEq, ::prost::Message)]
233pub struct PartialCaveatInfo {
234 #[prost(string, repeated, tag = "1")]
237 pub missing_required_context: ::prost::alloc::vec::Vec<
238 ::prost::alloc::string::String,
239 >,
240}
241#[allow(clippy::derive_partial_eq_without_eq)]
248#[derive(Clone, PartialEq, ::prost::Message)]
249pub struct DebugInformation {
250 #[prost(message, optional, tag = "1")]
252 pub check: ::core::option::Option<CheckDebugTrace>,
253 #[prost(string, tag = "2")]
255 pub schema_used: ::prost::alloc::string::String,
256}
257#[allow(clippy::derive_partial_eq_without_eq)]
260#[derive(Clone, PartialEq, ::prost::Message)]
261pub struct CheckDebugTrace {
262 #[prost(message, optional, tag = "1")]
264 pub resource: ::core::option::Option<ObjectReference>,
265 #[prost(string, tag = "2")]
267 pub permission: ::prost::alloc::string::String,
268 #[prost(enumeration = "check_debug_trace::PermissionType", tag = "3")]
270 pub permission_type: i32,
271 #[prost(message, optional, tag = "4")]
274 pub subject: ::core::option::Option<SubjectReference>,
275 #[prost(enumeration = "check_debug_trace::Permissionship", tag = "5")]
277 pub result: i32,
278 #[prost(message, optional, tag = "8")]
280 pub caveat_evaluation_info: ::core::option::Option<CaveatEvalInfo>,
281 #[prost(message, optional, tag = "9")]
283 pub duration: ::core::option::Option<::prost_types::Duration>,
284 #[prost(oneof = "check_debug_trace::Resolution", tags = "6, 7")]
286 pub resolution: ::core::option::Option<check_debug_trace::Resolution>,
287}
288pub mod check_debug_trace {
290 #[allow(clippy::derive_partial_eq_without_eq)]
291 #[derive(Clone, PartialEq, ::prost::Message)]
292 pub struct SubProblems {
293 #[prost(message, repeated, tag = "1")]
294 pub traces: ::prost::alloc::vec::Vec<super::CheckDebugTrace>,
295 }
296 #[derive(
297 Clone,
298 Copy,
299 Debug,
300 PartialEq,
301 Eq,
302 Hash,
303 PartialOrd,
304 Ord,
305 ::prost::Enumeration
306 )]
307 #[repr(i32)]
308 pub enum PermissionType {
309 Unspecified = 0,
310 Relation = 1,
311 Permission = 2,
312 }
313 impl PermissionType {
314 pub fn as_str_name(&self) -> &'static str {
319 match self {
320 PermissionType::Unspecified => "PERMISSION_TYPE_UNSPECIFIED",
321 PermissionType::Relation => "PERMISSION_TYPE_RELATION",
322 PermissionType::Permission => "PERMISSION_TYPE_PERMISSION",
323 }
324 }
325 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
327 match value {
328 "PERMISSION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
329 "PERMISSION_TYPE_RELATION" => Some(Self::Relation),
330 "PERMISSION_TYPE_PERMISSION" => Some(Self::Permission),
331 _ => None,
332 }
333 }
334 }
335 #[derive(
336 Clone,
337 Copy,
338 Debug,
339 PartialEq,
340 Eq,
341 Hash,
342 PartialOrd,
343 Ord,
344 ::prost::Enumeration
345 )]
346 #[repr(i32)]
347 pub enum Permissionship {
348 Unspecified = 0,
349 NoPermission = 1,
350 HasPermission = 2,
351 ConditionalPermission = 3,
352 }
353 impl Permissionship {
354 pub fn as_str_name(&self) -> &'static str {
359 match self {
360 Permissionship::Unspecified => "PERMISSIONSHIP_UNSPECIFIED",
361 Permissionship::NoPermission => "PERMISSIONSHIP_NO_PERMISSION",
362 Permissionship::HasPermission => "PERMISSIONSHIP_HAS_PERMISSION",
363 Permissionship::ConditionalPermission => {
364 "PERMISSIONSHIP_CONDITIONAL_PERMISSION"
365 }
366 }
367 }
368 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
370 match value {
371 "PERMISSIONSHIP_UNSPECIFIED" => Some(Self::Unspecified),
372 "PERMISSIONSHIP_NO_PERMISSION" => Some(Self::NoPermission),
373 "PERMISSIONSHIP_HAS_PERMISSION" => Some(Self::HasPermission),
374 "PERMISSIONSHIP_CONDITIONAL_PERMISSION" => {
375 Some(Self::ConditionalPermission)
376 }
377 _ => None,
378 }
379 }
380 }
381 #[allow(clippy::derive_partial_eq_without_eq)]
383 #[derive(Clone, PartialEq, ::prost::Oneof)]
384 pub enum Resolution {
385 #[prost(bool, tag = "6")]
387 WasCachedResult(bool),
388 #[prost(message, tag = "7")]
391 SubProblems(SubProblems),
392 }
393}
394#[allow(clippy::derive_partial_eq_without_eq)]
396#[derive(Clone, PartialEq, ::prost::Message)]
397pub struct CaveatEvalInfo {
398 #[prost(string, tag = "1")]
400 pub expression: ::prost::alloc::string::String,
401 #[prost(enumeration = "caveat_eval_info::Result", tag = "2")]
403 pub result: i32,
404 #[prost(message, optional, tag = "3")]
406 pub context: ::core::option::Option<::prost_types::Struct>,
407 #[prost(message, optional, tag = "4")]
409 pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
410 #[prost(string, tag = "5")]
412 pub caveat_name: ::prost::alloc::string::String,
413}
414pub mod caveat_eval_info {
416 #[derive(
417 Clone,
418 Copy,
419 Debug,
420 PartialEq,
421 Eq,
422 Hash,
423 PartialOrd,
424 Ord,
425 ::prost::Enumeration
426 )]
427 #[repr(i32)]
428 pub enum Result {
429 Unspecified = 0,
430 Unevaluated = 1,
431 False = 2,
432 True = 3,
433 MissingSomeContext = 4,
434 }
435 impl Result {
436 pub fn as_str_name(&self) -> &'static str {
441 match self {
442 Result::Unspecified => "RESULT_UNSPECIFIED",
443 Result::Unevaluated => "RESULT_UNEVALUATED",
444 Result::False => "RESULT_FALSE",
445 Result::True => "RESULT_TRUE",
446 Result::MissingSomeContext => "RESULT_MISSING_SOME_CONTEXT",
447 }
448 }
449 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
451 match value {
452 "RESULT_UNSPECIFIED" => Some(Self::Unspecified),
453 "RESULT_UNEVALUATED" => Some(Self::Unevaluated),
454 "RESULT_FALSE" => Some(Self::False),
455 "RESULT_TRUE" => Some(Self::True),
456 "RESULT_MISSING_SOME_CONTEXT" => Some(Self::MissingSomeContext),
457 _ => None,
458 }
459 }
460 }
461}
462#[allow(clippy::derive_partial_eq_without_eq)]
466#[derive(Clone, PartialEq, ::prost::Message)]
467pub struct Consistency {
468 #[prost(oneof = "consistency::Requirement", tags = "1, 2, 3, 4")]
469 pub requirement: ::core::option::Option<consistency::Requirement>,
470}
471pub mod consistency {
473 #[allow(clippy::derive_partial_eq_without_eq)]
474 #[derive(Clone, PartialEq, ::prost::Oneof)]
475 pub enum Requirement {
476 #[prost(bool, tag = "1")]
479 MinimizeLatency(bool),
480 #[prost(message, tag = "2")]
484 AtLeastAsFresh(super::ZedToken),
485 #[prost(message, tag = "3")]
489 AtExactSnapshot(super::ZedToken),
490 #[prost(bool, tag = "4")]
497 FullyConsistent(bool),
498 }
499}
500#[allow(clippy::derive_partial_eq_without_eq)]
510#[derive(Clone, PartialEq, ::prost::Message)]
511pub struct RelationshipFilter {
512 #[prost(string, tag = "1")]
515 pub resource_type: ::prost::alloc::string::String,
516 #[prost(string, tag = "2")]
519 pub optional_resource_id: ::prost::alloc::string::String,
520 #[prost(string, tag = "5")]
523 pub optional_resource_id_prefix: ::prost::alloc::string::String,
524 #[prost(string, tag = "3")]
526 pub optional_relation: ::prost::alloc::string::String,
527 #[prost(message, optional, tag = "4")]
529 pub optional_subject_filter: ::core::option::Option<SubjectFilter>,
530}
531#[allow(clippy::derive_partial_eq_without_eq)]
536#[derive(Clone, PartialEq, ::prost::Message)]
537pub struct SubjectFilter {
538 #[prost(string, tag = "1")]
539 pub subject_type: ::prost::alloc::string::String,
540 #[prost(string, tag = "2")]
541 pub optional_subject_id: ::prost::alloc::string::String,
542 #[prost(message, optional, tag = "3")]
543 pub optional_relation: ::core::option::Option<subject_filter::RelationFilter>,
544}
545pub mod subject_filter {
547 #[allow(clippy::derive_partial_eq_without_eq)]
548 #[derive(Clone, PartialEq, ::prost::Message)]
549 pub struct RelationFilter {
550 #[prost(string, tag = "1")]
551 pub relation: ::prost::alloc::string::String,
552 }
553}
554#[allow(clippy::derive_partial_eq_without_eq)]
557#[derive(Clone, PartialEq, ::prost::Message)]
558pub struct ReadRelationshipsRequest {
559 #[prost(message, optional, tag = "1")]
560 pub consistency: ::core::option::Option<Consistency>,
561 #[prost(message, optional, tag = "2")]
564 pub relationship_filter: ::core::option::Option<RelationshipFilter>,
565 #[prost(uint32, tag = "3")]
570 pub optional_limit: u32,
571 #[prost(message, optional, tag = "4")]
574 pub optional_cursor: ::core::option::Option<Cursor>,
575}
576#[allow(clippy::derive_partial_eq_without_eq)]
580#[derive(Clone, PartialEq, ::prost::Message)]
581pub struct ReadRelationshipsResponse {
582 #[prost(message, optional, tag = "1")]
584 pub read_at: ::core::option::Option<ZedToken>,
585 #[prost(message, optional, tag = "2")]
587 pub relationship: ::core::option::Option<Relationship>,
588 #[prost(message, optional, tag = "3")]
591 pub after_result_cursor: ::core::option::Option<Cursor>,
592}
593#[allow(clippy::derive_partial_eq_without_eq)]
602#[derive(Clone, PartialEq, ::prost::Message)]
603pub struct Precondition {
604 #[prost(enumeration = "precondition::Operation", tag = "1")]
605 pub operation: i32,
606 #[prost(message, optional, tag = "2")]
607 pub filter: ::core::option::Option<RelationshipFilter>,
608}
609pub mod precondition {
611 #[derive(
612 Clone,
613 Copy,
614 Debug,
615 PartialEq,
616 Eq,
617 Hash,
618 PartialOrd,
619 Ord,
620 ::prost::Enumeration
621 )]
622 #[repr(i32)]
623 pub enum Operation {
624 Unspecified = 0,
625 MustNotMatch = 1,
626 MustMatch = 2,
627 }
628 impl Operation {
629 pub fn as_str_name(&self) -> &'static str {
634 match self {
635 Operation::Unspecified => "OPERATION_UNSPECIFIED",
636 Operation::MustNotMatch => "OPERATION_MUST_NOT_MATCH",
637 Operation::MustMatch => "OPERATION_MUST_MATCH",
638 }
639 }
640 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
642 match value {
643 "OPERATION_UNSPECIFIED" => Some(Self::Unspecified),
644 "OPERATION_MUST_NOT_MATCH" => Some(Self::MustNotMatch),
645 "OPERATION_MUST_MATCH" => Some(Self::MustMatch),
646 _ => None,
647 }
648 }
649 }
650}
651#[allow(clippy::derive_partial_eq_without_eq)]
656#[derive(Clone, PartialEq, ::prost::Message)]
657pub struct WriteRelationshipsRequest {
658 #[prost(message, repeated, tag = "1")]
659 pub updates: ::prost::alloc::vec::Vec<RelationshipUpdate>,
660 #[prost(message, repeated, tag = "2")]
662 pub optional_preconditions: ::prost::alloc::vec::Vec<Precondition>,
663}
664#[allow(clippy::derive_partial_eq_without_eq)]
665#[derive(Clone, PartialEq, ::prost::Message)]
666pub struct WriteRelationshipsResponse {
667 #[prost(message, optional, tag = "1")]
668 pub written_at: ::core::option::Option<ZedToken>,
669}
670#[allow(clippy::derive_partial_eq_without_eq)]
676#[derive(Clone, PartialEq, ::prost::Message)]
677pub struct DeleteRelationshipsRequest {
678 #[prost(message, optional, tag = "1")]
679 pub relationship_filter: ::core::option::Option<RelationshipFilter>,
680 #[prost(message, repeated, tag = "2")]
682 pub optional_preconditions: ::prost::alloc::vec::Vec<Precondition>,
683 #[prost(uint32, tag = "3")]
689 pub optional_limit: u32,
690 #[prost(bool, tag = "4")]
693 pub optional_allow_partial_deletions: bool,
694}
695#[allow(clippy::derive_partial_eq_without_eq)]
696#[derive(Clone, PartialEq, ::prost::Message)]
697pub struct DeleteRelationshipsResponse {
698 #[prost(message, optional, tag = "1")]
700 pub deleted_at: ::core::option::Option<ZedToken>,
701 #[prost(enumeration = "delete_relationships_response::DeletionProgress", tag = "2")]
703 pub deletion_progress: i32,
704}
705pub mod delete_relationships_response {
707 #[derive(
708 Clone,
709 Copy,
710 Debug,
711 PartialEq,
712 Eq,
713 Hash,
714 PartialOrd,
715 Ord,
716 ::prost::Enumeration
717 )]
718 #[repr(i32)]
719 pub enum DeletionProgress {
720 Unspecified = 0,
721 Complete = 1,
724 Partial = 2,
729 }
730 impl DeletionProgress {
731 pub fn as_str_name(&self) -> &'static str {
736 match self {
737 DeletionProgress::Unspecified => "DELETION_PROGRESS_UNSPECIFIED",
738 DeletionProgress::Complete => "DELETION_PROGRESS_COMPLETE",
739 DeletionProgress::Partial => "DELETION_PROGRESS_PARTIAL",
740 }
741 }
742 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
744 match value {
745 "DELETION_PROGRESS_UNSPECIFIED" => Some(Self::Unspecified),
746 "DELETION_PROGRESS_COMPLETE" => Some(Self::Complete),
747 "DELETION_PROGRESS_PARTIAL" => Some(Self::Partial),
748 _ => None,
749 }
750 }
751 }
752}
753#[allow(clippy::derive_partial_eq_without_eq)]
756#[derive(Clone, PartialEq, ::prost::Message)]
757pub struct CheckPermissionRequest {
758 #[prost(message, optional, tag = "1")]
759 pub consistency: ::core::option::Option<Consistency>,
760 #[prost(message, optional, tag = "2")]
762 pub resource: ::core::option::Option<ObjectReference>,
763 #[prost(string, tag = "3")]
766 pub permission: ::prost::alloc::string::String,
767 #[prost(message, optional, tag = "4")]
769 pub subject: ::core::option::Option<SubjectReference>,
770 #[prost(message, optional, tag = "5")]
772 pub context: ::core::option::Option<::prost_types::Struct>,
773 #[prost(bool, tag = "6")]
777 pub with_tracing: bool,
778}
779#[allow(clippy::derive_partial_eq_without_eq)]
780#[derive(Clone, PartialEq, ::prost::Message)]
781pub struct CheckPermissionResponse {
782 #[prost(message, optional, tag = "1")]
783 pub checked_at: ::core::option::Option<ZedToken>,
784 #[prost(enumeration = "check_permission_response::Permissionship", tag = "2")]
793 pub permissionship: i32,
794 #[prost(message, optional, tag = "3")]
796 pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
797 #[prost(message, optional, tag = "4")]
799 pub debug_trace: ::core::option::Option<DebugInformation>,
800}
801pub mod check_permission_response {
803 #[derive(
804 Clone,
805 Copy,
806 Debug,
807 PartialEq,
808 Eq,
809 Hash,
810 PartialOrd,
811 Ord,
812 ::prost::Enumeration
813 )]
814 #[repr(i32)]
815 pub enum Permissionship {
816 Unspecified = 0,
817 NoPermission = 1,
818 HasPermission = 2,
819 ConditionalPermission = 3,
820 }
821 impl Permissionship {
822 pub fn as_str_name(&self) -> &'static str {
827 match self {
828 Permissionship::Unspecified => "PERMISSIONSHIP_UNSPECIFIED",
829 Permissionship::NoPermission => "PERMISSIONSHIP_NO_PERMISSION",
830 Permissionship::HasPermission => "PERMISSIONSHIP_HAS_PERMISSION",
831 Permissionship::ConditionalPermission => {
832 "PERMISSIONSHIP_CONDITIONAL_PERMISSION"
833 }
834 }
835 }
836 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
838 match value {
839 "PERMISSIONSHIP_UNSPECIFIED" => Some(Self::Unspecified),
840 "PERMISSIONSHIP_NO_PERMISSION" => Some(Self::NoPermission),
841 "PERMISSIONSHIP_HAS_PERMISSION" => Some(Self::HasPermission),
842 "PERMISSIONSHIP_CONDITIONAL_PERMISSION" => {
843 Some(Self::ConditionalPermission)
844 }
845 _ => None,
846 }
847 }
848 }
849}
850#[allow(clippy::derive_partial_eq_without_eq)]
856#[derive(Clone, PartialEq, ::prost::Message)]
857pub struct CheckBulkPermissionsRequest {
858 #[prost(message, optional, tag = "1")]
859 pub consistency: ::core::option::Option<Consistency>,
860 #[prost(message, repeated, tag = "2")]
861 pub items: ::prost::alloc::vec::Vec<CheckBulkPermissionsRequestItem>,
862}
863#[allow(clippy::derive_partial_eq_without_eq)]
864#[derive(Clone, PartialEq, ::prost::Message)]
865pub struct CheckBulkPermissionsRequestItem {
866 #[prost(message, optional, tag = "1")]
867 pub resource: ::core::option::Option<ObjectReference>,
868 #[prost(string, tag = "2")]
869 pub permission: ::prost::alloc::string::String,
870 #[prost(message, optional, tag = "3")]
871 pub subject: ::core::option::Option<SubjectReference>,
872 #[prost(message, optional, tag = "4")]
873 pub context: ::core::option::Option<::prost_types::Struct>,
874}
875#[allow(clippy::derive_partial_eq_without_eq)]
876#[derive(Clone, PartialEq, ::prost::Message)]
877pub struct CheckBulkPermissionsResponse {
878 #[prost(message, optional, tag = "1")]
879 pub checked_at: ::core::option::Option<ZedToken>,
880 #[prost(message, repeated, tag = "2")]
881 pub pairs: ::prost::alloc::vec::Vec<CheckBulkPermissionsPair>,
882}
883#[allow(clippy::derive_partial_eq_without_eq)]
884#[derive(Clone, PartialEq, ::prost::Message)]
885pub struct CheckBulkPermissionsPair {
886 #[prost(message, optional, tag = "1")]
887 pub request: ::core::option::Option<CheckBulkPermissionsRequestItem>,
888 #[prost(oneof = "check_bulk_permissions_pair::Response", tags = "2, 3")]
889 pub response: ::core::option::Option<check_bulk_permissions_pair::Response>,
890}
891pub mod check_bulk_permissions_pair {
893 #[allow(clippy::derive_partial_eq_without_eq)]
894 #[derive(Clone, PartialEq, ::prost::Oneof)]
895 pub enum Response {
896 #[prost(message, tag = "2")]
897 Item(super::CheckBulkPermissionsResponseItem),
898 #[prost(message, tag = "3")]
899 Error(super::super::super::super::google::rpc::Status),
900 }
901}
902#[allow(clippy::derive_partial_eq_without_eq)]
903#[derive(Clone, PartialEq, ::prost::Message)]
904pub struct CheckBulkPermissionsResponseItem {
905 #[prost(enumeration = "check_permission_response::Permissionship", tag = "1")]
906 pub permissionship: i32,
907 #[prost(message, optional, tag = "2")]
908 pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
909}
910#[allow(clippy::derive_partial_eq_without_eq)]
918#[derive(Clone, PartialEq, ::prost::Message)]
919pub struct ExpandPermissionTreeRequest {
920 #[prost(message, optional, tag = "1")]
921 pub consistency: ::core::option::Option<Consistency>,
922 #[prost(message, optional, tag = "2")]
924 pub resource: ::core::option::Option<ObjectReference>,
925 #[prost(string, tag = "3")]
928 pub permission: ::prost::alloc::string::String,
929}
930#[allow(clippy::derive_partial_eq_without_eq)]
931#[derive(Clone, PartialEq, ::prost::Message)]
932pub struct ExpandPermissionTreeResponse {
933 #[prost(message, optional, tag = "1")]
934 pub expanded_at: ::core::option::Option<ZedToken>,
935 #[prost(message, optional, tag = "2")]
939 pub tree_root: ::core::option::Option<PermissionRelationshipTree>,
940}
941#[allow(clippy::derive_partial_eq_without_eq)]
945#[derive(Clone, PartialEq, ::prost::Message)]
946pub struct LookupResourcesRequest {
947 #[prost(message, optional, tag = "1")]
948 pub consistency: ::core::option::Option<Consistency>,
949 #[prost(string, tag = "2")]
952 pub resource_object_type: ::prost::alloc::string::String,
953 #[prost(string, tag = "3")]
956 pub permission: ::prost::alloc::string::String,
957 #[prost(message, optional, tag = "4")]
959 pub subject: ::core::option::Option<SubjectReference>,
960 #[prost(message, optional, tag = "5")]
962 pub context: ::core::option::Option<::prost_types::Struct>,
963 #[prost(uint32, tag = "6")]
968 pub optional_limit: u32,
969 #[prost(message, optional, tag = "7")]
972 pub optional_cursor: ::core::option::Option<Cursor>,
973}
974#[allow(clippy::derive_partial_eq_without_eq)]
977#[derive(Clone, PartialEq, ::prost::Message)]
978pub struct LookupResourcesResponse {
979 #[prost(message, optional, tag = "1")]
981 pub looked_up_at: ::core::option::Option<ZedToken>,
982 #[prost(string, tag = "2")]
984 pub resource_object_id: ::prost::alloc::string::String,
985 #[prost(enumeration = "LookupPermissionship", tag = "3")]
987 pub permissionship: i32,
988 #[prost(message, optional, tag = "4")]
990 pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
991 #[prost(message, optional, tag = "5")]
994 pub after_result_cursor: ::core::option::Option<Cursor>,
995}
996#[allow(clippy::derive_partial_eq_without_eq)]
1000#[derive(Clone, PartialEq, ::prost::Message)]
1001pub struct LookupSubjectsRequest {
1002 #[prost(message, optional, tag = "1")]
1003 pub consistency: ::core::option::Option<Consistency>,
1004 #[prost(message, optional, tag = "2")]
1007 pub resource: ::core::option::Option<ObjectReference>,
1008 #[prost(string, tag = "3")]
1011 pub permission: ::prost::alloc::string::String,
1012 #[prost(string, tag = "4")]
1015 pub subject_object_type: ::prost::alloc::string::String,
1016 #[prost(string, tag = "5")]
1018 pub optional_subject_relation: ::prost::alloc::string::String,
1019 #[prost(message, optional, tag = "6")]
1021 pub context: ::core::option::Option<::prost_types::Struct>,
1022 #[prost(uint32, tag = "7")]
1043 pub optional_concrete_limit: u32,
1044 #[prost(message, optional, tag = "8")]
1049 pub optional_cursor: ::core::option::Option<Cursor>,
1050 #[prost(enumeration = "lookup_subjects_request::WildcardOption", tag = "9")]
1053 pub wildcard_option: i32,
1054}
1055pub mod lookup_subjects_request {
1057 #[derive(
1058 Clone,
1059 Copy,
1060 Debug,
1061 PartialEq,
1062 Eq,
1063 Hash,
1064 PartialOrd,
1065 Ord,
1066 ::prost::Enumeration
1067 )]
1068 #[repr(i32)]
1069 pub enum WildcardOption {
1070 Unspecified = 0,
1071 IncludeWildcards = 1,
1072 ExcludeWildcards = 2,
1073 }
1074 impl WildcardOption {
1075 pub fn as_str_name(&self) -> &'static str {
1080 match self {
1081 WildcardOption::Unspecified => "WILDCARD_OPTION_UNSPECIFIED",
1082 WildcardOption::IncludeWildcards => "WILDCARD_OPTION_INCLUDE_WILDCARDS",
1083 WildcardOption::ExcludeWildcards => "WILDCARD_OPTION_EXCLUDE_WILDCARDS",
1084 }
1085 }
1086 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1088 match value {
1089 "WILDCARD_OPTION_UNSPECIFIED" => Some(Self::Unspecified),
1090 "WILDCARD_OPTION_INCLUDE_WILDCARDS" => Some(Self::IncludeWildcards),
1091 "WILDCARD_OPTION_EXCLUDE_WILDCARDS" => Some(Self::ExcludeWildcards),
1092 _ => None,
1093 }
1094 }
1095 }
1096}
1097#[allow(clippy::derive_partial_eq_without_eq)]
1100#[derive(Clone, PartialEq, ::prost::Message)]
1101pub struct LookupSubjectsResponse {
1102 #[prost(message, optional, tag = "1")]
1103 pub looked_up_at: ::core::option::Option<ZedToken>,
1104 #[deprecated]
1108 #[prost(string, tag = "2")]
1109 pub subject_object_id: ::prost::alloc::string::String,
1110 #[deprecated]
1115 #[prost(string, repeated, tag = "3")]
1116 pub excluded_subject_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1117 #[deprecated]
1120 #[prost(enumeration = "LookupPermissionship", tag = "4")]
1121 pub permissionship: i32,
1122 #[deprecated]
1125 #[prost(message, optional, tag = "5")]
1126 pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
1127 #[prost(message, optional, tag = "6")]
1129 pub subject: ::core::option::Option<ResolvedSubject>,
1130 #[prost(message, repeated, tag = "7")]
1134 pub excluded_subjects: ::prost::alloc::vec::Vec<ResolvedSubject>,
1135 #[prost(message, optional, tag = "8")]
1138 pub after_result_cursor: ::core::option::Option<Cursor>,
1139}
1140#[allow(clippy::derive_partial_eq_without_eq)]
1142#[derive(Clone, PartialEq, ::prost::Message)]
1143pub struct ResolvedSubject {
1144 #[prost(string, tag = "1")]
1147 pub subject_object_id: ::prost::alloc::string::String,
1148 #[prost(enumeration = "LookupPermissionship", tag = "2")]
1150 pub permissionship: i32,
1151 #[prost(message, optional, tag = "3")]
1153 pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
1154}
1155#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1157#[repr(i32)]
1158pub enum LookupPermissionship {
1159 Unspecified = 0,
1160 HasPermission = 1,
1161 ConditionalPermission = 2,
1162}
1163impl LookupPermissionship {
1164 pub fn as_str_name(&self) -> &'static str {
1169 match self {
1170 LookupPermissionship::Unspecified => "LOOKUP_PERMISSIONSHIP_UNSPECIFIED",
1171 LookupPermissionship::HasPermission => "LOOKUP_PERMISSIONSHIP_HAS_PERMISSION",
1172 LookupPermissionship::ConditionalPermission => {
1173 "LOOKUP_PERMISSIONSHIP_CONDITIONAL_PERMISSION"
1174 }
1175 }
1176 }
1177 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1179 match value {
1180 "LOOKUP_PERMISSIONSHIP_UNSPECIFIED" => Some(Self::Unspecified),
1181 "LOOKUP_PERMISSIONSHIP_HAS_PERMISSION" => Some(Self::HasPermission),
1182 "LOOKUP_PERMISSIONSHIP_CONDITIONAL_PERMISSION" => {
1183 Some(Self::ConditionalPermission)
1184 }
1185 _ => None,
1186 }
1187 }
1188}
1189pub mod permissions_service_client {
1191 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
1192 use tonic::codegen::*;
1193 use tonic::codegen::http::Uri;
1194 #[derive(Debug, Clone)]
1197 pub struct PermissionsServiceClient<T> {
1198 inner: tonic::client::Grpc<T>,
1199 }
1200 impl PermissionsServiceClient<tonic::transport::Channel> {
1201 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1203 where
1204 D: TryInto<tonic::transport::Endpoint>,
1205 D::Error: Into<StdError>,
1206 {
1207 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1208 Ok(Self::new(conn))
1209 }
1210 }
1211 impl<T> PermissionsServiceClient<T>
1212 where
1213 T: tonic::client::GrpcService<tonic::body::BoxBody>,
1214 T::Error: Into<StdError>,
1215 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
1216 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
1217 {
1218 pub fn new(inner: T) -> Self {
1219 let inner = tonic::client::Grpc::new(inner);
1220 Self { inner }
1221 }
1222 pub fn with_origin(inner: T, origin: Uri) -> Self {
1223 let inner = tonic::client::Grpc::with_origin(inner, origin);
1224 Self { inner }
1225 }
1226 pub fn with_interceptor<F>(
1227 inner: T,
1228 interceptor: F,
1229 ) -> PermissionsServiceClient<InterceptedService<T, F>>
1230 where
1231 F: tonic::service::Interceptor,
1232 T::ResponseBody: Default,
1233 T: tonic::codegen::Service<
1234 http::Request<tonic::body::BoxBody>,
1235 Response = http::Response<
1236 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1237 >,
1238 >,
1239 <T as tonic::codegen::Service<
1240 http::Request<tonic::body::BoxBody>,
1241 >>::Error: Into<StdError> + Send + Sync,
1242 {
1243 PermissionsServiceClient::new(InterceptedService::new(inner, interceptor))
1244 }
1245 #[must_use]
1250 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1251 self.inner = self.inner.send_compressed(encoding);
1252 self
1253 }
1254 #[must_use]
1256 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1257 self.inner = self.inner.accept_compressed(encoding);
1258 self
1259 }
1260 #[must_use]
1264 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1265 self.inner = self.inner.max_decoding_message_size(limit);
1266 self
1267 }
1268 #[must_use]
1272 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1273 self.inner = self.inner.max_encoding_message_size(limit);
1274 self
1275 }
1276 pub async fn read_relationships(
1279 &mut self,
1280 request: impl tonic::IntoRequest<super::ReadRelationshipsRequest>,
1281 ) -> std::result::Result<
1282 tonic::Response<tonic::codec::Streaming<super::ReadRelationshipsResponse>>,
1283 tonic::Status,
1284 > {
1285 self.inner
1286 .ready()
1287 .await
1288 .map_err(|e| {
1289 tonic::Status::new(
1290 tonic::Code::Unknown,
1291 format!("Service was not ready: {}", e.into()),
1292 )
1293 })?;
1294 let codec = tonic::codec::ProstCodec::default();
1295 let path = http::uri::PathAndQuery::from_static(
1296 "/authzed.api.v1.PermissionsService/ReadRelationships",
1297 );
1298 let mut req = request.into_request();
1299 req.extensions_mut()
1300 .insert(
1301 GrpcMethod::new(
1302 "authzed.api.v1.PermissionsService",
1303 "ReadRelationships",
1304 ),
1305 );
1306 self.inner.server_streaming(req, path, codec).await
1307 }
1308 pub async fn write_relationships(
1312 &mut self,
1313 request: impl tonic::IntoRequest<super::WriteRelationshipsRequest>,
1314 ) -> std::result::Result<
1315 tonic::Response<super::WriteRelationshipsResponse>,
1316 tonic::Status,
1317 > {
1318 self.inner
1319 .ready()
1320 .await
1321 .map_err(|e| {
1322 tonic::Status::new(
1323 tonic::Code::Unknown,
1324 format!("Service was not ready: {}", e.into()),
1325 )
1326 })?;
1327 let codec = tonic::codec::ProstCodec::default();
1328 let path = http::uri::PathAndQuery::from_static(
1329 "/authzed.api.v1.PermissionsService/WriteRelationships",
1330 );
1331 let mut req = request.into_request();
1332 req.extensions_mut()
1333 .insert(
1334 GrpcMethod::new(
1335 "authzed.api.v1.PermissionsService",
1336 "WriteRelationships",
1337 ),
1338 );
1339 self.inner.unary(req, path, codec).await
1340 }
1341 pub async fn delete_relationships(
1346 &mut self,
1347 request: impl tonic::IntoRequest<super::DeleteRelationshipsRequest>,
1348 ) -> std::result::Result<
1349 tonic::Response<super::DeleteRelationshipsResponse>,
1350 tonic::Status,
1351 > {
1352 self.inner
1353 .ready()
1354 .await
1355 .map_err(|e| {
1356 tonic::Status::new(
1357 tonic::Code::Unknown,
1358 format!("Service was not ready: {}", e.into()),
1359 )
1360 })?;
1361 let codec = tonic::codec::ProstCodec::default();
1362 let path = http::uri::PathAndQuery::from_static(
1363 "/authzed.api.v1.PermissionsService/DeleteRelationships",
1364 );
1365 let mut req = request.into_request();
1366 req.extensions_mut()
1367 .insert(
1368 GrpcMethod::new(
1369 "authzed.api.v1.PermissionsService",
1370 "DeleteRelationships",
1371 ),
1372 );
1373 self.inner.unary(req, path, codec).await
1374 }
1375 pub async fn check_permission(
1378 &mut self,
1379 request: impl tonic::IntoRequest<super::CheckPermissionRequest>,
1380 ) -> std::result::Result<
1381 tonic::Response<super::CheckPermissionResponse>,
1382 tonic::Status,
1383 > {
1384 self.inner
1385 .ready()
1386 .await
1387 .map_err(|e| {
1388 tonic::Status::new(
1389 tonic::Code::Unknown,
1390 format!("Service was not ready: {}", e.into()),
1391 )
1392 })?;
1393 let codec = tonic::codec::ProstCodec::default();
1394 let path = http::uri::PathAndQuery::from_static(
1395 "/authzed.api.v1.PermissionsService/CheckPermission",
1396 );
1397 let mut req = request.into_request();
1398 req.extensions_mut()
1399 .insert(
1400 GrpcMethod::new(
1401 "authzed.api.v1.PermissionsService",
1402 "CheckPermission",
1403 ),
1404 );
1405 self.inner.unary(req, path, codec).await
1406 }
1407 pub async fn check_bulk_permissions(
1410 &mut self,
1411 request: impl tonic::IntoRequest<super::CheckBulkPermissionsRequest>,
1412 ) -> std::result::Result<
1413 tonic::Response<super::CheckBulkPermissionsResponse>,
1414 tonic::Status,
1415 > {
1416 self.inner
1417 .ready()
1418 .await
1419 .map_err(|e| {
1420 tonic::Status::new(
1421 tonic::Code::Unknown,
1422 format!("Service was not ready: {}", e.into()),
1423 )
1424 })?;
1425 let codec = tonic::codec::ProstCodec::default();
1426 let path = http::uri::PathAndQuery::from_static(
1427 "/authzed.api.v1.PermissionsService/CheckBulkPermissions",
1428 );
1429 let mut req = request.into_request();
1430 req.extensions_mut()
1431 .insert(
1432 GrpcMethod::new(
1433 "authzed.api.v1.PermissionsService",
1434 "CheckBulkPermissions",
1435 ),
1436 );
1437 self.inner.unary(req, path, codec).await
1438 }
1439 pub async fn expand_permission_tree(
1443 &mut self,
1444 request: impl tonic::IntoRequest<super::ExpandPermissionTreeRequest>,
1445 ) -> std::result::Result<
1446 tonic::Response<super::ExpandPermissionTreeResponse>,
1447 tonic::Status,
1448 > {
1449 self.inner
1450 .ready()
1451 .await
1452 .map_err(|e| {
1453 tonic::Status::new(
1454 tonic::Code::Unknown,
1455 format!("Service was not ready: {}", e.into()),
1456 )
1457 })?;
1458 let codec = tonic::codec::ProstCodec::default();
1459 let path = http::uri::PathAndQuery::from_static(
1460 "/authzed.api.v1.PermissionsService/ExpandPermissionTree",
1461 );
1462 let mut req = request.into_request();
1463 req.extensions_mut()
1464 .insert(
1465 GrpcMethod::new(
1466 "authzed.api.v1.PermissionsService",
1467 "ExpandPermissionTree",
1468 ),
1469 );
1470 self.inner.unary(req, path, codec).await
1471 }
1472 pub async fn lookup_resources(
1475 &mut self,
1476 request: impl tonic::IntoRequest<super::LookupResourcesRequest>,
1477 ) -> std::result::Result<
1478 tonic::Response<tonic::codec::Streaming<super::LookupResourcesResponse>>,
1479 tonic::Status,
1480 > {
1481 self.inner
1482 .ready()
1483 .await
1484 .map_err(|e| {
1485 tonic::Status::new(
1486 tonic::Code::Unknown,
1487 format!("Service was not ready: {}", e.into()),
1488 )
1489 })?;
1490 let codec = tonic::codec::ProstCodec::default();
1491 let path = http::uri::PathAndQuery::from_static(
1492 "/authzed.api.v1.PermissionsService/LookupResources",
1493 );
1494 let mut req = request.into_request();
1495 req.extensions_mut()
1496 .insert(
1497 GrpcMethod::new(
1498 "authzed.api.v1.PermissionsService",
1499 "LookupResources",
1500 ),
1501 );
1502 self.inner.server_streaming(req, path, codec).await
1503 }
1504 pub async fn lookup_subjects(
1507 &mut self,
1508 request: impl tonic::IntoRequest<super::LookupSubjectsRequest>,
1509 ) -> std::result::Result<
1510 tonic::Response<tonic::codec::Streaming<super::LookupSubjectsResponse>>,
1511 tonic::Status,
1512 > {
1513 self.inner
1514 .ready()
1515 .await
1516 .map_err(|e| {
1517 tonic::Status::new(
1518 tonic::Code::Unknown,
1519 format!("Service was not ready: {}", e.into()),
1520 )
1521 })?;
1522 let codec = tonic::codec::ProstCodec::default();
1523 let path = http::uri::PathAndQuery::from_static(
1524 "/authzed.api.v1.PermissionsService/LookupSubjects",
1525 );
1526 let mut req = request.into_request();
1527 req.extensions_mut()
1528 .insert(
1529 GrpcMethod::new(
1530 "authzed.api.v1.PermissionsService",
1531 "LookupSubjects",
1532 ),
1533 );
1534 self.inner.server_streaming(req, path, codec).await
1535 }
1536 }
1537}
1538#[allow(clippy::derive_partial_eq_without_eq)]
1540#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1541pub struct ReadSchemaRequest {}
1542#[allow(clippy::derive_partial_eq_without_eq)]
1545#[derive(Clone, PartialEq, ::prost::Message)]
1546pub struct ReadSchemaResponse {
1547 #[prost(string, tag = "1")]
1549 pub schema_text: ::prost::alloc::string::String,
1550 #[prost(message, optional, tag = "2")]
1552 pub read_at: ::core::option::Option<ZedToken>,
1553}
1554#[allow(clippy::derive_partial_eq_without_eq)]
1557#[derive(Clone, PartialEq, ::prost::Message)]
1558pub struct WriteSchemaRequest {
1559 #[prost(string, tag = "1")]
1564 pub schema: ::prost::alloc::string::String,
1565}
1566#[allow(clippy::derive_partial_eq_without_eq)]
1569#[derive(Clone, PartialEq, ::prost::Message)]
1570pub struct WriteSchemaResponse {
1571 #[prost(message, optional, tag = "1")]
1573 pub written_at: ::core::option::Option<ZedToken>,
1574}
1575pub mod schema_service_client {
1577 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
1578 use tonic::codegen::*;
1579 use tonic::codegen::http::Uri;
1580 #[derive(Debug, Clone)]
1582 pub struct SchemaServiceClient<T> {
1583 inner: tonic::client::Grpc<T>,
1584 }
1585 impl SchemaServiceClient<tonic::transport::Channel> {
1586 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1588 where
1589 D: TryInto<tonic::transport::Endpoint>,
1590 D::Error: Into<StdError>,
1591 {
1592 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1593 Ok(Self::new(conn))
1594 }
1595 }
1596 impl<T> SchemaServiceClient<T>
1597 where
1598 T: tonic::client::GrpcService<tonic::body::BoxBody>,
1599 T::Error: Into<StdError>,
1600 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
1601 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
1602 {
1603 pub fn new(inner: T) -> Self {
1604 let inner = tonic::client::Grpc::new(inner);
1605 Self { inner }
1606 }
1607 pub fn with_origin(inner: T, origin: Uri) -> Self {
1608 let inner = tonic::client::Grpc::with_origin(inner, origin);
1609 Self { inner }
1610 }
1611 pub fn with_interceptor<F>(
1612 inner: T,
1613 interceptor: F,
1614 ) -> SchemaServiceClient<InterceptedService<T, F>>
1615 where
1616 F: tonic::service::Interceptor,
1617 T::ResponseBody: Default,
1618 T: tonic::codegen::Service<
1619 http::Request<tonic::body::BoxBody>,
1620 Response = http::Response<
1621 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1622 >,
1623 >,
1624 <T as tonic::codegen::Service<
1625 http::Request<tonic::body::BoxBody>,
1626 >>::Error: Into<StdError> + Send + Sync,
1627 {
1628 SchemaServiceClient::new(InterceptedService::new(inner, interceptor))
1629 }
1630 #[must_use]
1635 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1636 self.inner = self.inner.send_compressed(encoding);
1637 self
1638 }
1639 #[must_use]
1641 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1642 self.inner = self.inner.accept_compressed(encoding);
1643 self
1644 }
1645 #[must_use]
1649 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1650 self.inner = self.inner.max_decoding_message_size(limit);
1651 self
1652 }
1653 #[must_use]
1657 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1658 self.inner = self.inner.max_encoding_message_size(limit);
1659 self
1660 }
1661 pub async fn read_schema(
1667 &mut self,
1668 request: impl tonic::IntoRequest<super::ReadSchemaRequest>,
1669 ) -> std::result::Result<
1670 tonic::Response<super::ReadSchemaResponse>,
1671 tonic::Status,
1672 > {
1673 self.inner
1674 .ready()
1675 .await
1676 .map_err(|e| {
1677 tonic::Status::new(
1678 tonic::Code::Unknown,
1679 format!("Service was not ready: {}", e.into()),
1680 )
1681 })?;
1682 let codec = tonic::codec::ProstCodec::default();
1683 let path = http::uri::PathAndQuery::from_static(
1684 "/authzed.api.v1.SchemaService/ReadSchema",
1685 );
1686 let mut req = request.into_request();
1687 req.extensions_mut()
1688 .insert(GrpcMethod::new("authzed.api.v1.SchemaService", "ReadSchema"));
1689 self.inner.unary(req, path, codec).await
1690 }
1691 pub async fn write_schema(
1693 &mut self,
1694 request: impl tonic::IntoRequest<super::WriteSchemaRequest>,
1695 ) -> std::result::Result<
1696 tonic::Response<super::WriteSchemaResponse>,
1697 tonic::Status,
1698 > {
1699 self.inner
1700 .ready()
1701 .await
1702 .map_err(|e| {
1703 tonic::Status::new(
1704 tonic::Code::Unknown,
1705 format!("Service was not ready: {}", e.into()),
1706 )
1707 })?;
1708 let codec = tonic::codec::ProstCodec::default();
1709 let path = http::uri::PathAndQuery::from_static(
1710 "/authzed.api.v1.SchemaService/WriteSchema",
1711 );
1712 let mut req = request.into_request();
1713 req.extensions_mut()
1714 .insert(GrpcMethod::new("authzed.api.v1.SchemaService", "WriteSchema"));
1715 self.inner.unary(req, path, codec).await
1716 }
1717 }
1718}
1719#[allow(clippy::derive_partial_eq_without_eq)]
1723#[derive(Clone, PartialEq, ::prost::Message)]
1724pub struct WatchRequest {
1725 #[prost(string, repeated, tag = "1")]
1729 pub optional_object_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1730 #[prost(message, optional, tag = "2")]
1738 pub optional_start_cursor: ::core::option::Option<ZedToken>,
1739 #[prost(message, repeated, tag = "3")]
1745 pub optional_relationship_filters: ::prost::alloc::vec::Vec<RelationshipFilter>,
1746}
1747#[allow(clippy::derive_partial_eq_without_eq)]
1752#[derive(Clone, PartialEq, ::prost::Message)]
1753pub struct WatchResponse {
1754 #[prost(message, repeated, tag = "1")]
1755 pub updates: ::prost::alloc::vec::Vec<RelationshipUpdate>,
1756 #[prost(message, optional, tag = "2")]
1757 pub changes_through: ::core::option::Option<ZedToken>,
1758}
1759pub mod watch_service_client {
1761 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
1762 use tonic::codegen::*;
1763 use tonic::codegen::http::Uri;
1764 #[derive(Debug, Clone)]
1765 pub struct WatchServiceClient<T> {
1766 inner: tonic::client::Grpc<T>,
1767 }
1768 impl WatchServiceClient<tonic::transport::Channel> {
1769 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1771 where
1772 D: TryInto<tonic::transport::Endpoint>,
1773 D::Error: Into<StdError>,
1774 {
1775 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1776 Ok(Self::new(conn))
1777 }
1778 }
1779 impl<T> WatchServiceClient<T>
1780 where
1781 T: tonic::client::GrpcService<tonic::body::BoxBody>,
1782 T::Error: Into<StdError>,
1783 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
1784 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
1785 {
1786 pub fn new(inner: T) -> Self {
1787 let inner = tonic::client::Grpc::new(inner);
1788 Self { inner }
1789 }
1790 pub fn with_origin(inner: T, origin: Uri) -> Self {
1791 let inner = tonic::client::Grpc::with_origin(inner, origin);
1792 Self { inner }
1793 }
1794 pub fn with_interceptor<F>(
1795 inner: T,
1796 interceptor: F,
1797 ) -> WatchServiceClient<InterceptedService<T, F>>
1798 where
1799 F: tonic::service::Interceptor,
1800 T::ResponseBody: Default,
1801 T: tonic::codegen::Service<
1802 http::Request<tonic::body::BoxBody>,
1803 Response = http::Response<
1804 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1805 >,
1806 >,
1807 <T as tonic::codegen::Service<
1808 http::Request<tonic::body::BoxBody>,
1809 >>::Error: Into<StdError> + Send + Sync,
1810 {
1811 WatchServiceClient::new(InterceptedService::new(inner, interceptor))
1812 }
1813 #[must_use]
1818 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1819 self.inner = self.inner.send_compressed(encoding);
1820 self
1821 }
1822 #[must_use]
1824 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1825 self.inner = self.inner.accept_compressed(encoding);
1826 self
1827 }
1828 #[must_use]
1832 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1833 self.inner = self.inner.max_decoding_message_size(limit);
1834 self
1835 }
1836 #[must_use]
1840 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1841 self.inner = self.inner.max_encoding_message_size(limit);
1842 self
1843 }
1844 pub async fn watch(
1845 &mut self,
1846 request: impl tonic::IntoRequest<super::WatchRequest>,
1847 ) -> std::result::Result<
1848 tonic::Response<tonic::codec::Streaming<super::WatchResponse>>,
1849 tonic::Status,
1850 > {
1851 self.inner
1852 .ready()
1853 .await
1854 .map_err(|e| {
1855 tonic::Status::new(
1856 tonic::Code::Unknown,
1857 format!("Service was not ready: {}", e.into()),
1858 )
1859 })?;
1860 let codec = tonic::codec::ProstCodec::default();
1861 let path = http::uri::PathAndQuery::from_static(
1862 "/authzed.api.v1.WatchService/Watch",
1863 );
1864 let mut req = request.into_request();
1865 req.extensions_mut()
1866 .insert(GrpcMethod::new("authzed.api.v1.WatchService", "Watch"));
1867 self.inner.server_streaming(req, path, codec).await
1868 }
1869 }
1870}