1#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct Relationship {
7 #[prost(message, optional, tag = "1")]
9 pub resource: ::core::option::Option<ObjectReference>,
10 #[prost(string, tag = "2")]
12 pub relation: ::prost::alloc::string::String,
13 #[prost(message, optional, tag = "3")]
15 pub subject: ::core::option::Option<SubjectReference>,
16 #[prost(message, optional, tag = "4")]
18 pub optional_caveat: ::core::option::Option<ContextualizedCaveat>,
19 #[prost(message, optional, tag = "5")]
21 pub optional_expires_at: ::core::option::Option<::prost_types::Timestamp>,
22}
23#[derive(Clone, PartialEq, ::prost::Message)]
27pub struct ContextualizedCaveat {
28 #[prost(string, tag = "1")]
30 pub caveat_name: ::prost::alloc::string::String,
31 #[prost(message, optional, tag = "2")]
33 pub context: ::core::option::Option<::prost_types::Struct>,
34}
35#[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#[derive(Clone, PartialEq, ::prost::Message)]
47pub struct ObjectReference {
48 #[prost(string, tag = "1")]
49 pub object_type: ::prost::alloc::string::String,
50 #[prost(string, tag = "2")]
51 pub object_id: ::prost::alloc::string::String,
52}
53#[derive(Clone, PartialEq, ::prost::Message)]
59pub struct ZedToken {
60 #[prost(string, tag = "1")]
61 pub token: ::prost::alloc::string::String,
62}
63#[derive(Clone, PartialEq, ::prost::Message)]
66pub struct Cursor {
67 #[prost(string, tag = "1")]
68 pub token: ::prost::alloc::string::String,
69}
70#[derive(Clone, PartialEq, ::prost::Message)]
82pub struct RelationshipUpdate {
83 #[prost(enumeration = "relationship_update::Operation", tag = "1")]
84 pub operation: i32,
85 #[prost(message, optional, tag = "2")]
86 pub relationship: ::core::option::Option<Relationship>,
87}
88pub mod relationship_update {
90 #[derive(
91 Clone,
92 Copy,
93 Debug,
94 PartialEq,
95 Eq,
96 Hash,
97 PartialOrd,
98 Ord,
99 ::prost::Enumeration
100 )]
101 #[repr(i32)]
102 pub enum Operation {
103 Unspecified = 0,
104 Create = 1,
105 Touch = 2,
106 Delete = 3,
107 }
108 impl Operation {
109 pub fn as_str_name(&self) -> &'static str {
114 match self {
115 Self::Unspecified => "OPERATION_UNSPECIFIED",
116 Self::Create => "OPERATION_CREATE",
117 Self::Touch => "OPERATION_TOUCH",
118 Self::Delete => "OPERATION_DELETE",
119 }
120 }
121 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
123 match value {
124 "OPERATION_UNSPECIFIED" => Some(Self::Unspecified),
125 "OPERATION_CREATE" => Some(Self::Create),
126 "OPERATION_TOUCH" => Some(Self::Touch),
127 "OPERATION_DELETE" => Some(Self::Delete),
128 _ => None,
129 }
130 }
131 }
132}
133#[derive(Clone, PartialEq, ::prost::Message)]
136pub struct PermissionRelationshipTree {
137 #[prost(message, optional, tag = "3")]
138 pub expanded_object: ::core::option::Option<ObjectReference>,
139 #[prost(string, tag = "4")]
140 pub expanded_relation: ::prost::alloc::string::String,
141 #[prost(oneof = "permission_relationship_tree::TreeType", tags = "1, 2")]
142 pub tree_type: ::core::option::Option<permission_relationship_tree::TreeType>,
143}
144pub mod permission_relationship_tree {
146 #[derive(Clone, PartialEq, ::prost::Oneof)]
147 pub enum TreeType {
148 #[prost(message, tag = "1")]
149 Intermediate(super::AlgebraicSubjectSet),
150 #[prost(message, tag = "2")]
151 Leaf(super::DirectSubjectSet),
152 }
153}
154#[derive(Clone, PartialEq, ::prost::Message)]
165pub struct AlgebraicSubjectSet {
166 #[prost(enumeration = "algebraic_subject_set::Operation", tag = "1")]
167 pub operation: i32,
168 #[prost(message, repeated, tag = "2")]
169 pub children: ::prost::alloc::vec::Vec<PermissionRelationshipTree>,
170}
171pub mod algebraic_subject_set {
173 #[derive(
174 Clone,
175 Copy,
176 Debug,
177 PartialEq,
178 Eq,
179 Hash,
180 PartialOrd,
181 Ord,
182 ::prost::Enumeration
183 )]
184 #[repr(i32)]
185 pub enum Operation {
186 Unspecified = 0,
187 Union = 1,
188 Intersection = 2,
189 Exclusion = 3,
190 }
191 impl Operation {
192 pub fn as_str_name(&self) -> &'static str {
197 match self {
198 Self::Unspecified => "OPERATION_UNSPECIFIED",
199 Self::Union => "OPERATION_UNION",
200 Self::Intersection => "OPERATION_INTERSECTION",
201 Self::Exclusion => "OPERATION_EXCLUSION",
202 }
203 }
204 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
206 match value {
207 "OPERATION_UNSPECIFIED" => Some(Self::Unspecified),
208 "OPERATION_UNION" => Some(Self::Union),
209 "OPERATION_INTERSECTION" => Some(Self::Intersection),
210 "OPERATION_EXCLUSION" => Some(Self::Exclusion),
211 _ => None,
212 }
213 }
214 }
215}
216#[derive(Clone, PartialEq, ::prost::Message)]
218pub struct DirectSubjectSet {
219 #[prost(message, repeated, tag = "1")]
220 pub subjects: ::prost::alloc::vec::Vec<SubjectReference>,
221}
222#[derive(Clone, PartialEq, ::prost::Message)]
225pub struct PartialCaveatInfo {
226 #[prost(string, repeated, tag = "1")]
229 pub missing_required_context: ::prost::alloc::vec::Vec<
230 ::prost::alloc::string::String,
231 >,
232}
233#[derive(Clone, PartialEq, ::prost::Message)]
240pub struct DebugInformation {
241 #[prost(message, optional, tag = "1")]
243 pub check: ::core::option::Option<CheckDebugTrace>,
244 #[prost(string, tag = "2")]
246 pub schema_used: ::prost::alloc::string::String,
247}
248#[derive(Clone, PartialEq, ::prost::Message)]
251pub struct CheckDebugTrace {
252 #[prost(message, optional, tag = "1")]
256 pub resource: ::core::option::Option<ObjectReference>,
257 #[prost(string, tag = "2")]
259 pub permission: ::prost::alloc::string::String,
260 #[prost(enumeration = "check_debug_trace::PermissionType", tag = "3")]
262 pub permission_type: i32,
263 #[prost(message, optional, tag = "4")]
266 pub subject: ::core::option::Option<SubjectReference>,
267 #[prost(enumeration = "check_debug_trace::Permissionship", tag = "5")]
269 pub result: i32,
270 #[prost(message, optional, tag = "8")]
272 pub caveat_evaluation_info: ::core::option::Option<CaveatEvalInfo>,
273 #[prost(message, optional, tag = "9")]
275 pub duration: ::core::option::Option<::prost_types::Duration>,
276 #[prost(message, optional, tag = "10")]
279 pub optional_expires_at: ::core::option::Option<::prost_types::Timestamp>,
280 #[prost(string, tag = "11")]
289 pub trace_operation_id: ::prost::alloc::string::String,
290 #[prost(string, tag = "12")]
294 pub source: ::prost::alloc::string::String,
295 #[prost(oneof = "check_debug_trace::Resolution", tags = "6, 7")]
297 pub resolution: ::core::option::Option<check_debug_trace::Resolution>,
298}
299pub mod check_debug_trace {
301 #[derive(Clone, PartialEq, ::prost::Message)]
302 pub struct SubProblems {
303 #[prost(message, repeated, tag = "1")]
304 pub traces: ::prost::alloc::vec::Vec<super::CheckDebugTrace>,
305 }
306 #[derive(
307 Clone,
308 Copy,
309 Debug,
310 PartialEq,
311 Eq,
312 Hash,
313 PartialOrd,
314 Ord,
315 ::prost::Enumeration
316 )]
317 #[repr(i32)]
318 pub enum PermissionType {
319 Unspecified = 0,
320 Relation = 1,
321 Permission = 2,
322 }
323 impl PermissionType {
324 pub fn as_str_name(&self) -> &'static str {
329 match self {
330 Self::Unspecified => "PERMISSION_TYPE_UNSPECIFIED",
331 Self::Relation => "PERMISSION_TYPE_RELATION",
332 Self::Permission => "PERMISSION_TYPE_PERMISSION",
333 }
334 }
335 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
337 match value {
338 "PERMISSION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
339 "PERMISSION_TYPE_RELATION" => Some(Self::Relation),
340 "PERMISSION_TYPE_PERMISSION" => Some(Self::Permission),
341 _ => None,
342 }
343 }
344 }
345 #[derive(
346 Clone,
347 Copy,
348 Debug,
349 PartialEq,
350 Eq,
351 Hash,
352 PartialOrd,
353 Ord,
354 ::prost::Enumeration
355 )]
356 #[repr(i32)]
357 pub enum Permissionship {
358 Unspecified = 0,
359 NoPermission = 1,
360 HasPermission = 2,
361 ConditionalPermission = 3,
362 }
363 impl Permissionship {
364 pub fn as_str_name(&self) -> &'static str {
369 match self {
370 Self::Unspecified => "PERMISSIONSHIP_UNSPECIFIED",
371 Self::NoPermission => "PERMISSIONSHIP_NO_PERMISSION",
372 Self::HasPermission => "PERMISSIONSHIP_HAS_PERMISSION",
373 Self::ConditionalPermission => "PERMISSIONSHIP_CONDITIONAL_PERMISSION",
374 }
375 }
376 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
378 match value {
379 "PERMISSIONSHIP_UNSPECIFIED" => Some(Self::Unspecified),
380 "PERMISSIONSHIP_NO_PERMISSION" => Some(Self::NoPermission),
381 "PERMISSIONSHIP_HAS_PERMISSION" => Some(Self::HasPermission),
382 "PERMISSIONSHIP_CONDITIONAL_PERMISSION" => {
383 Some(Self::ConditionalPermission)
384 }
385 _ => None,
386 }
387 }
388 }
389 #[derive(Clone, PartialEq, ::prost::Oneof)]
391 pub enum Resolution {
392 #[prost(bool, tag = "6")]
394 WasCachedResult(bool),
395 #[prost(message, tag = "7")]
398 SubProblems(SubProblems),
399 }
400}
401#[derive(Clone, PartialEq, ::prost::Message)]
403pub struct CaveatEvalInfo {
404 #[prost(string, tag = "1")]
406 pub expression: ::prost::alloc::string::String,
407 #[prost(enumeration = "caveat_eval_info::Result", tag = "2")]
409 pub result: i32,
410 #[prost(message, optional, tag = "3")]
412 pub context: ::core::option::Option<::prost_types::Struct>,
413 #[prost(message, optional, tag = "4")]
415 pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
416 #[prost(string, tag = "5")]
418 pub caveat_name: ::prost::alloc::string::String,
419}
420pub mod caveat_eval_info {
422 #[derive(
423 Clone,
424 Copy,
425 Debug,
426 PartialEq,
427 Eq,
428 Hash,
429 PartialOrd,
430 Ord,
431 ::prost::Enumeration
432 )]
433 #[repr(i32)]
434 pub enum Result {
435 Unspecified = 0,
436 Unevaluated = 1,
437 False = 2,
438 True = 3,
439 MissingSomeContext = 4,
440 }
441 impl Result {
442 pub fn as_str_name(&self) -> &'static str {
447 match self {
448 Self::Unspecified => "RESULT_UNSPECIFIED",
449 Self::Unevaluated => "RESULT_UNEVALUATED",
450 Self::False => "RESULT_FALSE",
451 Self::True => "RESULT_TRUE",
452 Self::MissingSomeContext => "RESULT_MISSING_SOME_CONTEXT",
453 }
454 }
455 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
457 match value {
458 "RESULT_UNSPECIFIED" => Some(Self::Unspecified),
459 "RESULT_UNEVALUATED" => Some(Self::Unevaluated),
460 "RESULT_FALSE" => Some(Self::False),
461 "RESULT_TRUE" => Some(Self::True),
462 "RESULT_MISSING_SOME_CONTEXT" => Some(Self::MissingSomeContext),
463 _ => None,
464 }
465 }
466 }
467}
468#[derive(Clone, PartialEq, ::prost::Message)]
472pub struct Consistency {
473 #[prost(oneof = "consistency::Requirement", tags = "1, 2, 3, 4")]
474 pub requirement: ::core::option::Option<consistency::Requirement>,
475}
476pub mod consistency {
478 #[derive(Clone, PartialEq, ::prost::Oneof)]
479 pub enum Requirement {
480 #[prost(bool, tag = "1")]
483 MinimizeLatency(bool),
484 #[prost(message, tag = "2")]
488 AtLeastAsFresh(super::ZedToken),
489 #[prost(message, tag = "3")]
493 AtExactSnapshot(super::ZedToken),
494 #[prost(bool, tag = "4")]
501 FullyConsistent(bool),
502 }
503}
504#[derive(Clone, PartialEq, ::prost::Message)]
514pub struct RelationshipFilter {
515 #[prost(string, tag = "1")]
518 pub resource_type: ::prost::alloc::string::String,
519 #[prost(string, tag = "2")]
522 pub optional_resource_id: ::prost::alloc::string::String,
523 #[prost(string, tag = "5")]
526 pub optional_resource_id_prefix: ::prost::alloc::string::String,
527 #[prost(string, tag = "3")]
529 pub optional_relation: ::prost::alloc::string::String,
530 #[prost(message, optional, tag = "4")]
532 pub optional_subject_filter: ::core::option::Option<SubjectFilter>,
533}
534#[derive(Clone, PartialEq, ::prost::Message)]
539pub struct SubjectFilter {
540 #[prost(string, tag = "1")]
541 pub subject_type: ::prost::alloc::string::String,
542 #[prost(string, tag = "2")]
543 pub optional_subject_id: ::prost::alloc::string::String,
544 #[prost(message, optional, tag = "3")]
545 pub optional_relation: ::core::option::Option<subject_filter::RelationFilter>,
546}
547pub mod subject_filter {
549 #[derive(Clone, PartialEq, ::prost::Message)]
550 pub struct RelationFilter {
551 #[prost(string, tag = "1")]
552 pub relation: ::prost::alloc::string::String,
553 }
554}
555#[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#[derive(Clone, PartialEq, ::prost::Message)]
580pub struct ReadRelationshipsResponse {
581 #[prost(message, optional, tag = "1")]
583 pub read_at: ::core::option::Option<ZedToken>,
584 #[prost(message, optional, tag = "2")]
586 pub relationship: ::core::option::Option<Relationship>,
587 #[prost(message, optional, tag = "3")]
590 pub after_result_cursor: ::core::option::Option<Cursor>,
591}
592#[derive(Clone, PartialEq, ::prost::Message)]
601pub struct Precondition {
602 #[prost(enumeration = "precondition::Operation", tag = "1")]
603 pub operation: i32,
604 #[prost(message, optional, tag = "2")]
605 pub filter: ::core::option::Option<RelationshipFilter>,
606}
607pub mod precondition {
609 #[derive(
610 Clone,
611 Copy,
612 Debug,
613 PartialEq,
614 Eq,
615 Hash,
616 PartialOrd,
617 Ord,
618 ::prost::Enumeration
619 )]
620 #[repr(i32)]
621 pub enum Operation {
622 Unspecified = 0,
623 MustNotMatch = 1,
624 MustMatch = 2,
625 }
626 impl Operation {
627 pub fn as_str_name(&self) -> &'static str {
632 match self {
633 Self::Unspecified => "OPERATION_UNSPECIFIED",
634 Self::MustNotMatch => "OPERATION_MUST_NOT_MATCH",
635 Self::MustMatch => "OPERATION_MUST_MATCH",
636 }
637 }
638 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
640 match value {
641 "OPERATION_UNSPECIFIED" => Some(Self::Unspecified),
642 "OPERATION_MUST_NOT_MATCH" => Some(Self::MustNotMatch),
643 "OPERATION_MUST_MATCH" => Some(Self::MustMatch),
644 _ => None,
645 }
646 }
647 }
648}
649#[derive(Clone, PartialEq, ::prost::Message)]
655pub struct WriteRelationshipsRequest {
656 #[prost(message, repeated, tag = "1")]
657 pub updates: ::prost::alloc::vec::Vec<RelationshipUpdate>,
658 #[prost(message, repeated, tag = "2")]
660 pub optional_preconditions: ::prost::alloc::vec::Vec<Precondition>,
661 #[prost(message, optional, tag = "3")]
665 pub optional_transaction_metadata: ::core::option::Option<::prost_types::Struct>,
666}
667#[derive(Clone, PartialEq, ::prost::Message)]
668pub struct WriteRelationshipsResponse {
669 #[prost(message, optional, tag = "1")]
671 pub written_at: ::core::option::Option<ZedToken>,
672}
673#[derive(Clone, PartialEq, ::prost::Message)]
679pub struct DeleteRelationshipsRequest {
680 #[prost(message, optional, tag = "1")]
681 pub relationship_filter: ::core::option::Option<RelationshipFilter>,
682 #[prost(message, repeated, tag = "2")]
684 pub optional_preconditions: ::prost::alloc::vec::Vec<Precondition>,
685 #[prost(uint32, tag = "3")]
691 pub optional_limit: u32,
692 #[prost(bool, tag = "4")]
695 pub optional_allow_partial_deletions: bool,
696 #[prost(message, optional, tag = "5")]
700 pub optional_transaction_metadata: ::core::option::Option<::prost_types::Struct>,
701}
702#[derive(Clone, PartialEq, ::prost::Message)]
703pub struct DeleteRelationshipsResponse {
704 #[prost(message, optional, tag = "1")]
706 pub deleted_at: ::core::option::Option<ZedToken>,
707 #[prost(enumeration = "delete_relationships_response::DeletionProgress", tag = "2")]
709 pub deletion_progress: i32,
710 #[prost(uint64, tag = "3")]
712 pub relationships_deleted_count: u64,
713}
714pub mod delete_relationships_response {
716 #[derive(
717 Clone,
718 Copy,
719 Debug,
720 PartialEq,
721 Eq,
722 Hash,
723 PartialOrd,
724 Ord,
725 ::prost::Enumeration
726 )]
727 #[repr(i32)]
728 pub enum DeletionProgress {
729 Unspecified = 0,
730 Complete = 1,
733 Partial = 2,
738 }
739 impl DeletionProgress {
740 pub fn as_str_name(&self) -> &'static str {
745 match self {
746 Self::Unspecified => "DELETION_PROGRESS_UNSPECIFIED",
747 Self::Complete => "DELETION_PROGRESS_COMPLETE",
748 Self::Partial => "DELETION_PROGRESS_PARTIAL",
749 }
750 }
751 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
753 match value {
754 "DELETION_PROGRESS_UNSPECIFIED" => Some(Self::Unspecified),
755 "DELETION_PROGRESS_COMPLETE" => Some(Self::Complete),
756 "DELETION_PROGRESS_PARTIAL" => Some(Self::Partial),
757 _ => None,
758 }
759 }
760 }
761}
762#[derive(Clone, PartialEq, ::prost::Message)]
765pub struct CheckPermissionRequest {
766 #[prost(message, optional, tag = "1")]
767 pub consistency: ::core::option::Option<Consistency>,
768 #[prost(message, optional, tag = "2")]
770 pub resource: ::core::option::Option<ObjectReference>,
771 #[prost(string, tag = "3")]
774 pub permission: ::prost::alloc::string::String,
775 #[prost(message, optional, tag = "4")]
777 pub subject: ::core::option::Option<SubjectReference>,
778 #[prost(message, optional, tag = "5")]
780 pub context: ::core::option::Option<::prost_types::Struct>,
781 #[prost(bool, tag = "6")]
785 pub with_tracing: bool,
786}
787#[derive(Clone, PartialEq, ::prost::Message)]
788pub struct CheckPermissionResponse {
789 #[prost(message, optional, tag = "1")]
790 pub checked_at: ::core::option::Option<ZedToken>,
791 #[prost(enumeration = "check_permission_response::Permissionship", tag = "2")]
800 pub permissionship: i32,
801 #[prost(message, optional, tag = "3")]
803 pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
804 #[prost(message, optional, tag = "4")]
806 pub debug_trace: ::core::option::Option<DebugInformation>,
807 #[prost(message, optional, tag = "5")]
810 pub optional_expires_at: ::core::option::Option<::prost_types::Timestamp>,
811}
812pub mod check_permission_response {
814 #[derive(
815 Clone,
816 Copy,
817 Debug,
818 PartialEq,
819 Eq,
820 Hash,
821 PartialOrd,
822 Ord,
823 ::prost::Enumeration
824 )]
825 #[repr(i32)]
826 pub enum Permissionship {
827 Unspecified = 0,
828 NoPermission = 1,
829 HasPermission = 2,
830 ConditionalPermission = 3,
831 }
832 impl Permissionship {
833 pub fn as_str_name(&self) -> &'static str {
838 match self {
839 Self::Unspecified => "PERMISSIONSHIP_UNSPECIFIED",
840 Self::NoPermission => "PERMISSIONSHIP_NO_PERMISSION",
841 Self::HasPermission => "PERMISSIONSHIP_HAS_PERMISSION",
842 Self::ConditionalPermission => "PERMISSIONSHIP_CONDITIONAL_PERMISSION",
843 }
844 }
845 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
847 match value {
848 "PERMISSIONSHIP_UNSPECIFIED" => Some(Self::Unspecified),
849 "PERMISSIONSHIP_NO_PERMISSION" => Some(Self::NoPermission),
850 "PERMISSIONSHIP_HAS_PERMISSION" => Some(Self::HasPermission),
851 "PERMISSIONSHIP_CONDITIONAL_PERMISSION" => {
852 Some(Self::ConditionalPermission)
853 }
854 _ => None,
855 }
856 }
857 }
858}
859#[derive(Clone, PartialEq, ::prost::Message)]
865pub struct CheckBulkPermissionsRequest {
866 #[prost(message, optional, tag = "1")]
867 pub consistency: ::core::option::Option<Consistency>,
868 #[prost(message, repeated, tag = "2")]
869 pub items: ::prost::alloc::vec::Vec<CheckBulkPermissionsRequestItem>,
870 #[prost(bool, tag = "3")]
874 pub with_tracing: bool,
875}
876#[derive(Clone, PartialEq, ::prost::Message)]
877pub struct CheckBulkPermissionsRequestItem {
878 #[prost(message, optional, tag = "1")]
879 pub resource: ::core::option::Option<ObjectReference>,
880 #[prost(string, tag = "2")]
881 pub permission: ::prost::alloc::string::String,
882 #[prost(message, optional, tag = "3")]
883 pub subject: ::core::option::Option<SubjectReference>,
884 #[prost(message, optional, tag = "4")]
885 pub context: ::core::option::Option<::prost_types::Struct>,
886}
887#[derive(Clone, PartialEq, ::prost::Message)]
888pub struct CheckBulkPermissionsResponse {
889 #[prost(message, optional, tag = "1")]
890 pub checked_at: ::core::option::Option<ZedToken>,
891 #[prost(message, repeated, tag = "2")]
892 pub pairs: ::prost::alloc::vec::Vec<CheckBulkPermissionsPair>,
893}
894#[derive(Clone, PartialEq, ::prost::Message)]
895pub struct CheckBulkPermissionsPair {
896 #[prost(message, optional, tag = "1")]
897 pub request: ::core::option::Option<CheckBulkPermissionsRequestItem>,
898 #[prost(oneof = "check_bulk_permissions_pair::Response", tags = "2, 3")]
899 pub response: ::core::option::Option<check_bulk_permissions_pair::Response>,
900}
901pub mod check_bulk_permissions_pair {
903 #[derive(Clone, PartialEq, ::prost::Oneof)]
904 pub enum Response {
905 #[prost(message, tag = "2")]
906 Item(super::CheckBulkPermissionsResponseItem),
907 #[prost(message, tag = "3")]
908 Error(super::super::super::super::google::rpc::Status),
909 }
910}
911#[derive(Clone, PartialEq, ::prost::Message)]
912pub struct CheckBulkPermissionsResponseItem {
913 #[prost(enumeration = "check_permission_response::Permissionship", tag = "1")]
914 pub permissionship: i32,
915 #[prost(message, optional, tag = "2")]
916 pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
917 #[prost(message, optional, tag = "3")]
919 pub debug_trace: ::core::option::Option<DebugInformation>,
920}
921#[derive(Clone, PartialEq, ::prost::Message)]
929pub struct ExpandPermissionTreeRequest {
930 #[prost(message, optional, tag = "1")]
931 pub consistency: ::core::option::Option<Consistency>,
932 #[prost(message, optional, tag = "2")]
934 pub resource: ::core::option::Option<ObjectReference>,
935 #[prost(string, tag = "3")]
938 pub permission: ::prost::alloc::string::String,
939}
940#[derive(Clone, PartialEq, ::prost::Message)]
941pub struct ExpandPermissionTreeResponse {
942 #[prost(message, optional, tag = "1")]
943 pub expanded_at: ::core::option::Option<ZedToken>,
944 #[prost(message, optional, tag = "2")]
948 pub tree_root: ::core::option::Option<PermissionRelationshipTree>,
949}
950#[derive(Clone, PartialEq, ::prost::Message)]
954pub struct LookupResourcesRequest {
955 #[prost(message, optional, tag = "1")]
956 pub consistency: ::core::option::Option<Consistency>,
957 #[prost(string, tag = "2")]
960 pub resource_object_type: ::prost::alloc::string::String,
961 #[prost(string, tag = "3")]
964 pub permission: ::prost::alloc::string::String,
965 #[prost(message, optional, tag = "4")]
967 pub subject: ::core::option::Option<SubjectReference>,
968 #[prost(message, optional, tag = "5")]
970 pub context: ::core::option::Option<::prost_types::Struct>,
971 #[prost(uint32, tag = "6")]
976 pub optional_limit: u32,
977 #[prost(message, optional, tag = "7")]
980 pub optional_cursor: ::core::option::Option<Cursor>,
981}
982#[derive(Clone, PartialEq, ::prost::Message)]
985pub struct LookupResourcesResponse {
986 #[prost(message, optional, tag = "1")]
988 pub looked_up_at: ::core::option::Option<ZedToken>,
989 #[prost(string, tag = "2")]
991 pub resource_object_id: ::prost::alloc::string::String,
992 #[prost(enumeration = "LookupPermissionship", tag = "3")]
994 pub permissionship: i32,
995 #[prost(message, optional, tag = "4")]
997 pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
998 #[prost(message, optional, tag = "5")]
1001 pub after_result_cursor: ::core::option::Option<Cursor>,
1002}
1003#[derive(Clone, PartialEq, ::prost::Message)]
1007pub struct LookupSubjectsRequest {
1008 #[prost(message, optional, tag = "1")]
1009 pub consistency: ::core::option::Option<Consistency>,
1010 #[prost(message, optional, tag = "2")]
1013 pub resource: ::core::option::Option<ObjectReference>,
1014 #[prost(string, tag = "3")]
1017 pub permission: ::prost::alloc::string::String,
1018 #[prost(string, tag = "4")]
1021 pub subject_object_type: ::prost::alloc::string::String,
1022 #[prost(string, tag = "5")]
1024 pub optional_subject_relation: ::prost::alloc::string::String,
1025 #[prost(message, optional, tag = "6")]
1027 pub context: ::core::option::Option<::prost_types::Struct>,
1028 #[prost(uint32, tag = "7")]
1032 pub optional_concrete_limit: u32,
1033 #[prost(message, optional, tag = "8")]
1037 pub optional_cursor: ::core::option::Option<Cursor>,
1038 #[prost(enumeration = "lookup_subjects_request::WildcardOption", tag = "9")]
1041 pub wildcard_option: i32,
1042}
1043pub mod lookup_subjects_request {
1045 #[derive(
1046 Clone,
1047 Copy,
1048 Debug,
1049 PartialEq,
1050 Eq,
1051 Hash,
1052 PartialOrd,
1053 Ord,
1054 ::prost::Enumeration
1055 )]
1056 #[repr(i32)]
1057 pub enum WildcardOption {
1058 Unspecified = 0,
1059 IncludeWildcards = 1,
1060 ExcludeWildcards = 2,
1061 }
1062 impl WildcardOption {
1063 pub fn as_str_name(&self) -> &'static str {
1068 match self {
1069 Self::Unspecified => "WILDCARD_OPTION_UNSPECIFIED",
1070 Self::IncludeWildcards => "WILDCARD_OPTION_INCLUDE_WILDCARDS",
1071 Self::ExcludeWildcards => "WILDCARD_OPTION_EXCLUDE_WILDCARDS",
1072 }
1073 }
1074 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1076 match value {
1077 "WILDCARD_OPTION_UNSPECIFIED" => Some(Self::Unspecified),
1078 "WILDCARD_OPTION_INCLUDE_WILDCARDS" => Some(Self::IncludeWildcards),
1079 "WILDCARD_OPTION_EXCLUDE_WILDCARDS" => Some(Self::ExcludeWildcards),
1080 _ => None,
1081 }
1082 }
1083 }
1084}
1085#[derive(Clone, PartialEq, ::prost::Message)]
1088pub struct LookupSubjectsResponse {
1089 #[prost(message, optional, tag = "1")]
1090 pub looked_up_at: ::core::option::Option<ZedToken>,
1091 #[deprecated]
1095 #[prost(string, tag = "2")]
1096 pub subject_object_id: ::prost::alloc::string::String,
1097 #[deprecated]
1102 #[prost(string, repeated, tag = "3")]
1103 pub excluded_subject_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1104 #[deprecated]
1107 #[prost(enumeration = "LookupPermissionship", tag = "4")]
1108 pub permissionship: i32,
1109 #[deprecated]
1112 #[prost(message, optional, tag = "5")]
1113 pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
1114 #[prost(message, optional, tag = "6")]
1116 pub subject: ::core::option::Option<ResolvedSubject>,
1117 #[prost(message, repeated, tag = "7")]
1121 pub excluded_subjects: ::prost::alloc::vec::Vec<ResolvedSubject>,
1122 #[prost(message, optional, tag = "8")]
1125 pub after_result_cursor: ::core::option::Option<Cursor>,
1126}
1127#[derive(Clone, PartialEq, ::prost::Message)]
1129pub struct ResolvedSubject {
1130 #[prost(string, tag = "1")]
1133 pub subject_object_id: ::prost::alloc::string::String,
1134 #[prost(enumeration = "LookupPermissionship", tag = "2")]
1136 pub permissionship: i32,
1137 #[prost(message, optional, tag = "3")]
1139 pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
1140}
1141#[derive(Clone, PartialEq, ::prost::Message)]
1149pub struct ImportBulkRelationshipsRequest {
1150 #[prost(message, repeated, tag = "1")]
1151 pub relationships: ::prost::alloc::vec::Vec<Relationship>,
1152}
1153#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1156pub struct ImportBulkRelationshipsResponse {
1157 #[prost(uint64, tag = "1")]
1158 pub num_loaded: u64,
1159}
1160#[derive(Clone, PartialEq, ::prost::Message)]
1163pub struct ExportBulkRelationshipsRequest {
1164 #[prost(message, optional, tag = "1")]
1165 pub consistency: ::core::option::Option<Consistency>,
1166 #[prost(uint32, tag = "2")]
1171 pub optional_limit: u32,
1172 #[prost(message, optional, tag = "3")]
1176 pub optional_cursor: ::core::option::Option<Cursor>,
1177 #[prost(message, optional, tag = "4")]
1180 pub optional_relationship_filter: ::core::option::Option<RelationshipFilter>,
1181}
1182#[derive(Clone, PartialEq, ::prost::Message)]
1187pub struct ExportBulkRelationshipsResponse {
1188 #[prost(message, optional, tag = "1")]
1189 pub after_result_cursor: ::core::option::Option<Cursor>,
1190 #[prost(message, repeated, tag = "2")]
1191 pub relationships: ::prost::alloc::vec::Vec<Relationship>,
1192}
1193#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1195#[repr(i32)]
1196pub enum LookupPermissionship {
1197 Unspecified = 0,
1198 HasPermission = 1,
1199 ConditionalPermission = 2,
1200}
1201impl LookupPermissionship {
1202 pub fn as_str_name(&self) -> &'static str {
1207 match self {
1208 Self::Unspecified => "LOOKUP_PERMISSIONSHIP_UNSPECIFIED",
1209 Self::HasPermission => "LOOKUP_PERMISSIONSHIP_HAS_PERMISSION",
1210 Self::ConditionalPermission => "LOOKUP_PERMISSIONSHIP_CONDITIONAL_PERMISSION",
1211 }
1212 }
1213 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1215 match value {
1216 "LOOKUP_PERMISSIONSHIP_UNSPECIFIED" => Some(Self::Unspecified),
1217 "LOOKUP_PERMISSIONSHIP_HAS_PERMISSION" => Some(Self::HasPermission),
1218 "LOOKUP_PERMISSIONSHIP_CONDITIONAL_PERMISSION" => {
1219 Some(Self::ConditionalPermission)
1220 }
1221 _ => None,
1222 }
1223 }
1224}
1225pub mod permissions_service_client {
1227 #![allow(
1228 unused_variables,
1229 dead_code,
1230 missing_docs,
1231 clippy::wildcard_imports,
1232 clippy::let_unit_value,
1233 )]
1234 use tonic::codegen::*;
1235 use tonic::codegen::http::Uri;
1236 #[derive(Debug, Clone)]
1239 pub struct PermissionsServiceClient<T> {
1240 inner: tonic::client::Grpc<T>,
1241 }
1242 impl PermissionsServiceClient<tonic::transport::Channel> {
1243 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1245 where
1246 D: TryInto<tonic::transport::Endpoint>,
1247 D::Error: Into<StdError>,
1248 {
1249 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1250 Ok(Self::new(conn))
1251 }
1252 }
1253 impl<T> PermissionsServiceClient<T>
1254 where
1255 T: tonic::client::GrpcService<tonic::body::BoxBody>,
1256 T::Error: Into<StdError>,
1257 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1258 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1259 {
1260 pub fn new(inner: T) -> Self {
1261 let inner = tonic::client::Grpc::new(inner);
1262 Self { inner }
1263 }
1264 pub fn with_origin(inner: T, origin: Uri) -> Self {
1265 let inner = tonic::client::Grpc::with_origin(inner, origin);
1266 Self { inner }
1267 }
1268 pub fn with_interceptor<F>(
1269 inner: T,
1270 interceptor: F,
1271 ) -> PermissionsServiceClient<InterceptedService<T, F>>
1272 where
1273 F: tonic::service::Interceptor,
1274 T::ResponseBody: Default,
1275 T: tonic::codegen::Service<
1276 http::Request<tonic::body::BoxBody>,
1277 Response = http::Response<
1278 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1279 >,
1280 >,
1281 <T as tonic::codegen::Service<
1282 http::Request<tonic::body::BoxBody>,
1283 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1284 {
1285 PermissionsServiceClient::new(InterceptedService::new(inner, interceptor))
1286 }
1287 #[must_use]
1292 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1293 self.inner = self.inner.send_compressed(encoding);
1294 self
1295 }
1296 #[must_use]
1298 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1299 self.inner = self.inner.accept_compressed(encoding);
1300 self
1301 }
1302 #[must_use]
1306 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1307 self.inner = self.inner.max_decoding_message_size(limit);
1308 self
1309 }
1310 #[must_use]
1314 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1315 self.inner = self.inner.max_encoding_message_size(limit);
1316 self
1317 }
1318 pub async fn read_relationships(
1321 &mut self,
1322 request: impl tonic::IntoRequest<super::ReadRelationshipsRequest>,
1323 ) -> std::result::Result<
1324 tonic::Response<tonic::codec::Streaming<super::ReadRelationshipsResponse>>,
1325 tonic::Status,
1326 > {
1327 self.inner
1328 .ready()
1329 .await
1330 .map_err(|e| {
1331 tonic::Status::unknown(
1332 format!("Service was not ready: {}", e.into()),
1333 )
1334 })?;
1335 let codec = tonic::codec::ProstCodec::default();
1336 let path = http::uri::PathAndQuery::from_static(
1337 "/authzed.api.v1.PermissionsService/ReadRelationships",
1338 );
1339 let mut req = request.into_request();
1340 req.extensions_mut()
1341 .insert(
1342 GrpcMethod::new(
1343 "authzed.api.v1.PermissionsService",
1344 "ReadRelationships",
1345 ),
1346 );
1347 self.inner.server_streaming(req, path, codec).await
1348 }
1349 pub async fn write_relationships(
1353 &mut self,
1354 request: impl tonic::IntoRequest<super::WriteRelationshipsRequest>,
1355 ) -> std::result::Result<
1356 tonic::Response<super::WriteRelationshipsResponse>,
1357 tonic::Status,
1358 > {
1359 self.inner
1360 .ready()
1361 .await
1362 .map_err(|e| {
1363 tonic::Status::unknown(
1364 format!("Service was not ready: {}", e.into()),
1365 )
1366 })?;
1367 let codec = tonic::codec::ProstCodec::default();
1368 let path = http::uri::PathAndQuery::from_static(
1369 "/authzed.api.v1.PermissionsService/WriteRelationships",
1370 );
1371 let mut req = request.into_request();
1372 req.extensions_mut()
1373 .insert(
1374 GrpcMethod::new(
1375 "authzed.api.v1.PermissionsService",
1376 "WriteRelationships",
1377 ),
1378 );
1379 self.inner.unary(req, path, codec).await
1380 }
1381 pub async fn delete_relationships(
1386 &mut self,
1387 request: impl tonic::IntoRequest<super::DeleteRelationshipsRequest>,
1388 ) -> std::result::Result<
1389 tonic::Response<super::DeleteRelationshipsResponse>,
1390 tonic::Status,
1391 > {
1392 self.inner
1393 .ready()
1394 .await
1395 .map_err(|e| {
1396 tonic::Status::unknown(
1397 format!("Service was not ready: {}", e.into()),
1398 )
1399 })?;
1400 let codec = tonic::codec::ProstCodec::default();
1401 let path = http::uri::PathAndQuery::from_static(
1402 "/authzed.api.v1.PermissionsService/DeleteRelationships",
1403 );
1404 let mut req = request.into_request();
1405 req.extensions_mut()
1406 .insert(
1407 GrpcMethod::new(
1408 "authzed.api.v1.PermissionsService",
1409 "DeleteRelationships",
1410 ),
1411 );
1412 self.inner.unary(req, path, codec).await
1413 }
1414 pub async fn check_permission(
1417 &mut self,
1418 request: impl tonic::IntoRequest<super::CheckPermissionRequest>,
1419 ) -> std::result::Result<
1420 tonic::Response<super::CheckPermissionResponse>,
1421 tonic::Status,
1422 > {
1423 self.inner
1424 .ready()
1425 .await
1426 .map_err(|e| {
1427 tonic::Status::unknown(
1428 format!("Service was not ready: {}", e.into()),
1429 )
1430 })?;
1431 let codec = tonic::codec::ProstCodec::default();
1432 let path = http::uri::PathAndQuery::from_static(
1433 "/authzed.api.v1.PermissionsService/CheckPermission",
1434 );
1435 let mut req = request.into_request();
1436 req.extensions_mut()
1437 .insert(
1438 GrpcMethod::new(
1439 "authzed.api.v1.PermissionsService",
1440 "CheckPermission",
1441 ),
1442 );
1443 self.inner.unary(req, path, codec).await
1444 }
1445 pub async fn check_bulk_permissions(
1448 &mut self,
1449 request: impl tonic::IntoRequest<super::CheckBulkPermissionsRequest>,
1450 ) -> std::result::Result<
1451 tonic::Response<super::CheckBulkPermissionsResponse>,
1452 tonic::Status,
1453 > {
1454 self.inner
1455 .ready()
1456 .await
1457 .map_err(|e| {
1458 tonic::Status::unknown(
1459 format!("Service was not ready: {}", e.into()),
1460 )
1461 })?;
1462 let codec = tonic::codec::ProstCodec::default();
1463 let path = http::uri::PathAndQuery::from_static(
1464 "/authzed.api.v1.PermissionsService/CheckBulkPermissions",
1465 );
1466 let mut req = request.into_request();
1467 req.extensions_mut()
1468 .insert(
1469 GrpcMethod::new(
1470 "authzed.api.v1.PermissionsService",
1471 "CheckBulkPermissions",
1472 ),
1473 );
1474 self.inner.unary(req, path, codec).await
1475 }
1476 pub async fn expand_permission_tree(
1480 &mut self,
1481 request: impl tonic::IntoRequest<super::ExpandPermissionTreeRequest>,
1482 ) -> std::result::Result<
1483 tonic::Response<super::ExpandPermissionTreeResponse>,
1484 tonic::Status,
1485 > {
1486 self.inner
1487 .ready()
1488 .await
1489 .map_err(|e| {
1490 tonic::Status::unknown(
1491 format!("Service was not ready: {}", e.into()),
1492 )
1493 })?;
1494 let codec = tonic::codec::ProstCodec::default();
1495 let path = http::uri::PathAndQuery::from_static(
1496 "/authzed.api.v1.PermissionsService/ExpandPermissionTree",
1497 );
1498 let mut req = request.into_request();
1499 req.extensions_mut()
1500 .insert(
1501 GrpcMethod::new(
1502 "authzed.api.v1.PermissionsService",
1503 "ExpandPermissionTree",
1504 ),
1505 );
1506 self.inner.unary(req, path, codec).await
1507 }
1508 pub async fn lookup_resources(
1511 &mut self,
1512 request: impl tonic::IntoRequest<super::LookupResourcesRequest>,
1513 ) -> std::result::Result<
1514 tonic::Response<tonic::codec::Streaming<super::LookupResourcesResponse>>,
1515 tonic::Status,
1516 > {
1517 self.inner
1518 .ready()
1519 .await
1520 .map_err(|e| {
1521 tonic::Status::unknown(
1522 format!("Service was not ready: {}", e.into()),
1523 )
1524 })?;
1525 let codec = tonic::codec::ProstCodec::default();
1526 let path = http::uri::PathAndQuery::from_static(
1527 "/authzed.api.v1.PermissionsService/LookupResources",
1528 );
1529 let mut req = request.into_request();
1530 req.extensions_mut()
1531 .insert(
1532 GrpcMethod::new(
1533 "authzed.api.v1.PermissionsService",
1534 "LookupResources",
1535 ),
1536 );
1537 self.inner.server_streaming(req, path, codec).await
1538 }
1539 pub async fn lookup_subjects(
1542 &mut self,
1543 request: impl tonic::IntoRequest<super::LookupSubjectsRequest>,
1544 ) -> std::result::Result<
1545 tonic::Response<tonic::codec::Streaming<super::LookupSubjectsResponse>>,
1546 tonic::Status,
1547 > {
1548 self.inner
1549 .ready()
1550 .await
1551 .map_err(|e| {
1552 tonic::Status::unknown(
1553 format!("Service was not ready: {}", e.into()),
1554 )
1555 })?;
1556 let codec = tonic::codec::ProstCodec::default();
1557 let path = http::uri::PathAndQuery::from_static(
1558 "/authzed.api.v1.PermissionsService/LookupSubjects",
1559 );
1560 let mut req = request.into_request();
1561 req.extensions_mut()
1562 .insert(
1563 GrpcMethod::new(
1564 "authzed.api.v1.PermissionsService",
1565 "LookupSubjects",
1566 ),
1567 );
1568 self.inner.server_streaming(req, path, codec).await
1569 }
1570 pub async fn import_bulk_relationships(
1578 &mut self,
1579 request: impl tonic::IntoStreamingRequest<
1580 Message = super::ImportBulkRelationshipsRequest,
1581 >,
1582 ) -> std::result::Result<
1583 tonic::Response<super::ImportBulkRelationshipsResponse>,
1584 tonic::Status,
1585 > {
1586 self.inner
1587 .ready()
1588 .await
1589 .map_err(|e| {
1590 tonic::Status::unknown(
1591 format!("Service was not ready: {}", e.into()),
1592 )
1593 })?;
1594 let codec = tonic::codec::ProstCodec::default();
1595 let path = http::uri::PathAndQuery::from_static(
1596 "/authzed.api.v1.PermissionsService/ImportBulkRelationships",
1597 );
1598 let mut req = request.into_streaming_request();
1599 req.extensions_mut()
1600 .insert(
1601 GrpcMethod::new(
1602 "authzed.api.v1.PermissionsService",
1603 "ImportBulkRelationships",
1604 ),
1605 );
1606 self.inner.client_streaming(req, path, codec).await
1607 }
1608 pub async fn export_bulk_relationships(
1612 &mut self,
1613 request: impl tonic::IntoRequest<super::ExportBulkRelationshipsRequest>,
1614 ) -> std::result::Result<
1615 tonic::Response<
1616 tonic::codec::Streaming<super::ExportBulkRelationshipsResponse>,
1617 >,
1618 tonic::Status,
1619 > {
1620 self.inner
1621 .ready()
1622 .await
1623 .map_err(|e| {
1624 tonic::Status::unknown(
1625 format!("Service was not ready: {}", e.into()),
1626 )
1627 })?;
1628 let codec = tonic::codec::ProstCodec::default();
1629 let path = http::uri::PathAndQuery::from_static(
1630 "/authzed.api.v1.PermissionsService/ExportBulkRelationships",
1631 );
1632 let mut req = request.into_request();
1633 req.extensions_mut()
1634 .insert(
1635 GrpcMethod::new(
1636 "authzed.api.v1.PermissionsService",
1637 "ExportBulkRelationships",
1638 ),
1639 );
1640 self.inner.server_streaming(req, path, codec).await
1641 }
1642 }
1643}
1644#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1646pub struct ReadSchemaRequest {}
1647#[derive(Clone, PartialEq, ::prost::Message)]
1650pub struct ReadSchemaResponse {
1651 #[prost(string, tag = "1")]
1653 pub schema_text: ::prost::alloc::string::String,
1654 #[prost(message, optional, tag = "2")]
1656 pub read_at: ::core::option::Option<ZedToken>,
1657}
1658#[derive(Clone, PartialEq, ::prost::Message)]
1661pub struct WriteSchemaRequest {
1662 #[prost(string, tag = "1")]
1667 pub schema: ::prost::alloc::string::String,
1668}
1669#[derive(Clone, PartialEq, ::prost::Message)]
1672pub struct WriteSchemaResponse {
1673 #[prost(message, optional, tag = "1")]
1675 pub written_at: ::core::option::Option<ZedToken>,
1676}
1677#[derive(Clone, PartialEq, ::prost::Message)]
1678pub struct ReflectSchemaRequest {
1679 #[prost(message, optional, tag = "1")]
1680 pub consistency: ::core::option::Option<Consistency>,
1681 #[prost(message, repeated, tag = "2")]
1684 pub optional_filters: ::prost::alloc::vec::Vec<ReflectionSchemaFilter>,
1685}
1686#[derive(Clone, PartialEq, ::prost::Message)]
1687pub struct ReflectSchemaResponse {
1688 #[prost(message, repeated, tag = "1")]
1690 pub definitions: ::prost::alloc::vec::Vec<ReflectionDefinition>,
1691 #[prost(message, repeated, tag = "2")]
1693 pub caveats: ::prost::alloc::vec::Vec<ReflectionCaveat>,
1694 #[prost(message, optional, tag = "3")]
1696 pub read_at: ::core::option::Option<ZedToken>,
1697}
1698#[derive(Clone, PartialEq, ::prost::Message)]
1700pub struct ReflectionSchemaFilter {
1701 #[prost(string, tag = "1")]
1703 pub optional_definition_name_filter: ::prost::alloc::string::String,
1704 #[prost(string, tag = "2")]
1706 pub optional_caveat_name_filter: ::prost::alloc::string::String,
1707 #[prost(string, tag = "3")]
1709 pub optional_relation_name_filter: ::prost::alloc::string::String,
1710 #[prost(string, tag = "4")]
1712 pub optional_permission_name_filter: ::prost::alloc::string::String,
1713}
1714#[derive(Clone, PartialEq, ::prost::Message)]
1716pub struct ReflectionDefinition {
1717 #[prost(string, tag = "1")]
1718 pub name: ::prost::alloc::string::String,
1719 #[prost(string, tag = "2")]
1722 pub comment: ::prost::alloc::string::String,
1723 #[prost(message, repeated, tag = "3")]
1724 pub relations: ::prost::alloc::vec::Vec<ReflectionRelation>,
1725 #[prost(message, repeated, tag = "4")]
1726 pub permissions: ::prost::alloc::vec::Vec<ReflectionPermission>,
1727}
1728#[derive(Clone, PartialEq, ::prost::Message)]
1730pub struct ReflectionCaveat {
1731 #[prost(string, tag = "1")]
1732 pub name: ::prost::alloc::string::String,
1733 #[prost(string, tag = "2")]
1736 pub comment: ::prost::alloc::string::String,
1737 #[prost(message, repeated, tag = "3")]
1738 pub parameters: ::prost::alloc::vec::Vec<ReflectionCaveatParameter>,
1739 #[prost(string, tag = "4")]
1740 pub expression: ::prost::alloc::string::String,
1741}
1742#[derive(Clone, PartialEq, ::prost::Message)]
1744pub struct ReflectionCaveatParameter {
1745 #[prost(string, tag = "1")]
1746 pub name: ::prost::alloc::string::String,
1747 #[prost(string, tag = "2")]
1750 pub r#type: ::prost::alloc::string::String,
1751 #[prost(string, tag = "3")]
1752 pub parent_caveat_name: ::prost::alloc::string::String,
1753}
1754#[derive(Clone, PartialEq, ::prost::Message)]
1756pub struct ReflectionRelation {
1757 #[prost(string, tag = "1")]
1758 pub name: ::prost::alloc::string::String,
1759 #[prost(string, tag = "2")]
1760 pub comment: ::prost::alloc::string::String,
1761 #[prost(string, tag = "3")]
1762 pub parent_definition_name: ::prost::alloc::string::String,
1763 #[prost(message, repeated, tag = "4")]
1764 pub subject_types: ::prost::alloc::vec::Vec<ReflectionTypeReference>,
1765}
1766#[derive(Clone, PartialEq, ::prost::Message)]
1768pub struct ReflectionTypeReference {
1769 #[prost(string, tag = "1")]
1771 pub subject_definition_name: ::prost::alloc::string::String,
1772 #[prost(string, tag = "2")]
1774 pub optional_caveat_name: ::prost::alloc::string::String,
1775 #[prost(oneof = "reflection_type_reference::Typeref", tags = "3, 4, 5")]
1776 pub typeref: ::core::option::Option<reflection_type_reference::Typeref>,
1777}
1778pub mod reflection_type_reference {
1780 #[derive(Clone, PartialEq, ::prost::Oneof)]
1781 pub enum Typeref {
1782 #[prost(bool, tag = "3")]
1784 IsTerminalSubject(bool),
1785 #[prost(string, tag = "4")]
1787 OptionalRelationName(::prost::alloc::string::String),
1788 #[prost(bool, tag = "5")]
1790 IsPublicWildcard(bool),
1791 }
1792}
1793#[derive(Clone, PartialEq, ::prost::Message)]
1795pub struct ReflectionPermission {
1796 #[prost(string, tag = "1")]
1797 pub name: ::prost::alloc::string::String,
1798 #[prost(string, tag = "2")]
1801 pub comment: ::prost::alloc::string::String,
1802 #[prost(string, tag = "3")]
1803 pub parent_definition_name: ::prost::alloc::string::String,
1804}
1805#[derive(Clone, PartialEq, ::prost::Message)]
1806pub struct ComputablePermissionsRequest {
1807 #[prost(message, optional, tag = "1")]
1808 pub consistency: ::core::option::Option<Consistency>,
1809 #[prost(string, tag = "2")]
1810 pub definition_name: ::prost::alloc::string::String,
1811 #[prost(string, tag = "3")]
1812 pub relation_name: ::prost::alloc::string::String,
1813 #[prost(string, tag = "4")]
1817 pub optional_definition_name_filter: ::prost::alloc::string::String,
1818}
1819#[derive(Clone, PartialEq, ::prost::Message)]
1821pub struct ReflectionRelationReference {
1822 #[prost(string, tag = "1")]
1823 pub definition_name: ::prost::alloc::string::String,
1824 #[prost(string, tag = "2")]
1825 pub relation_name: ::prost::alloc::string::String,
1826 #[prost(bool, tag = "3")]
1827 pub is_permission: bool,
1828}
1829#[derive(Clone, PartialEq, ::prost::Message)]
1830pub struct ComputablePermissionsResponse {
1831 #[prost(message, repeated, tag = "1")]
1832 pub permissions: ::prost::alloc::vec::Vec<ReflectionRelationReference>,
1833 #[prost(message, optional, tag = "2")]
1835 pub read_at: ::core::option::Option<ZedToken>,
1836}
1837#[derive(Clone, PartialEq, ::prost::Message)]
1838pub struct DependentRelationsRequest {
1839 #[prost(message, optional, tag = "1")]
1840 pub consistency: ::core::option::Option<Consistency>,
1841 #[prost(string, tag = "2")]
1842 pub definition_name: ::prost::alloc::string::String,
1843 #[prost(string, tag = "3")]
1844 pub permission_name: ::prost::alloc::string::String,
1845}
1846#[derive(Clone, PartialEq, ::prost::Message)]
1847pub struct DependentRelationsResponse {
1848 #[prost(message, repeated, tag = "1")]
1849 pub relations: ::prost::alloc::vec::Vec<ReflectionRelationReference>,
1850 #[prost(message, optional, tag = "2")]
1852 pub read_at: ::core::option::Option<ZedToken>,
1853}
1854#[derive(Clone, PartialEq, ::prost::Message)]
1855pub struct DiffSchemaRequest {
1856 #[prost(message, optional, tag = "1")]
1857 pub consistency: ::core::option::Option<Consistency>,
1858 #[prost(string, tag = "2")]
1859 pub comparison_schema: ::prost::alloc::string::String,
1860}
1861#[derive(Clone, PartialEq, ::prost::Message)]
1862pub struct DiffSchemaResponse {
1863 #[prost(message, repeated, tag = "1")]
1864 pub diffs: ::prost::alloc::vec::Vec<ReflectionSchemaDiff>,
1865 #[prost(message, optional, tag = "2")]
1867 pub read_at: ::core::option::Option<ZedToken>,
1868}
1869#[derive(Clone, PartialEq, ::prost::Message)]
1870pub struct ReflectionRelationSubjectTypeChange {
1871 #[prost(message, optional, tag = "1")]
1872 pub relation: ::core::option::Option<ReflectionRelation>,
1873 #[prost(message, optional, tag = "2")]
1874 pub changed_subject_type: ::core::option::Option<ReflectionTypeReference>,
1875}
1876#[derive(Clone, PartialEq, ::prost::Message)]
1877pub struct ReflectionCaveatParameterTypeChange {
1878 #[prost(message, optional, tag = "1")]
1879 pub parameter: ::core::option::Option<ReflectionCaveatParameter>,
1880 #[prost(string, tag = "2")]
1881 pub previous_type: ::prost::alloc::string::String,
1882}
1883#[derive(Clone, PartialEq, ::prost::Message)]
1885pub struct ReflectionSchemaDiff {
1886 #[prost(
1887 oneof = "reflection_schema_diff::Diff",
1888 tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19"
1889 )]
1890 pub diff: ::core::option::Option<reflection_schema_diff::Diff>,
1891}
1892pub mod reflection_schema_diff {
1894 #[derive(Clone, PartialEq, ::prost::Oneof)]
1895 pub enum Diff {
1896 #[prost(message, tag = "1")]
1897 DefinitionAdded(super::ReflectionDefinition),
1898 #[prost(message, tag = "2")]
1899 DefinitionRemoved(super::ReflectionDefinition),
1900 #[prost(message, tag = "3")]
1901 DefinitionDocCommentChanged(super::ReflectionDefinition),
1902 #[prost(message, tag = "4")]
1903 RelationAdded(super::ReflectionRelation),
1904 #[prost(message, tag = "5")]
1905 RelationRemoved(super::ReflectionRelation),
1906 #[prost(message, tag = "6")]
1907 RelationDocCommentChanged(super::ReflectionRelation),
1908 #[prost(message, tag = "7")]
1909 RelationSubjectTypeAdded(super::ReflectionRelationSubjectTypeChange),
1910 #[prost(message, tag = "8")]
1911 RelationSubjectTypeRemoved(super::ReflectionRelationSubjectTypeChange),
1912 #[prost(message, tag = "9")]
1913 PermissionAdded(super::ReflectionPermission),
1914 #[prost(message, tag = "10")]
1915 PermissionRemoved(super::ReflectionPermission),
1916 #[prost(message, tag = "11")]
1917 PermissionDocCommentChanged(super::ReflectionPermission),
1918 #[prost(message, tag = "12")]
1919 PermissionExprChanged(super::ReflectionPermission),
1920 #[prost(message, tag = "13")]
1921 CaveatAdded(super::ReflectionCaveat),
1922 #[prost(message, tag = "14")]
1923 CaveatRemoved(super::ReflectionCaveat),
1924 #[prost(message, tag = "15")]
1925 CaveatDocCommentChanged(super::ReflectionCaveat),
1926 #[prost(message, tag = "16")]
1927 CaveatExprChanged(super::ReflectionCaveat),
1928 #[prost(message, tag = "17")]
1929 CaveatParameterAdded(super::ReflectionCaveatParameter),
1930 #[prost(message, tag = "18")]
1931 CaveatParameterRemoved(super::ReflectionCaveatParameter),
1932 #[prost(message, tag = "19")]
1933 CaveatParameterTypeChanged(super::ReflectionCaveatParameterTypeChange),
1934 }
1935}
1936pub mod schema_service_client {
1938 #![allow(
1939 unused_variables,
1940 dead_code,
1941 missing_docs,
1942 clippy::wildcard_imports,
1943 clippy::let_unit_value,
1944 )]
1945 use tonic::codegen::*;
1946 use tonic::codegen::http::Uri;
1947 #[derive(Debug, Clone)]
1949 pub struct SchemaServiceClient<T> {
1950 inner: tonic::client::Grpc<T>,
1951 }
1952 impl SchemaServiceClient<tonic::transport::Channel> {
1953 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1955 where
1956 D: TryInto<tonic::transport::Endpoint>,
1957 D::Error: Into<StdError>,
1958 {
1959 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1960 Ok(Self::new(conn))
1961 }
1962 }
1963 impl<T> SchemaServiceClient<T>
1964 where
1965 T: tonic::client::GrpcService<tonic::body::BoxBody>,
1966 T::Error: Into<StdError>,
1967 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1968 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1969 {
1970 pub fn new(inner: T) -> Self {
1971 let inner = tonic::client::Grpc::new(inner);
1972 Self { inner }
1973 }
1974 pub fn with_origin(inner: T, origin: Uri) -> Self {
1975 let inner = tonic::client::Grpc::with_origin(inner, origin);
1976 Self { inner }
1977 }
1978 pub fn with_interceptor<F>(
1979 inner: T,
1980 interceptor: F,
1981 ) -> SchemaServiceClient<InterceptedService<T, F>>
1982 where
1983 F: tonic::service::Interceptor,
1984 T::ResponseBody: Default,
1985 T: tonic::codegen::Service<
1986 http::Request<tonic::body::BoxBody>,
1987 Response = http::Response<
1988 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1989 >,
1990 >,
1991 <T as tonic::codegen::Service<
1992 http::Request<tonic::body::BoxBody>,
1993 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1994 {
1995 SchemaServiceClient::new(InterceptedService::new(inner, interceptor))
1996 }
1997 #[must_use]
2002 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2003 self.inner = self.inner.send_compressed(encoding);
2004 self
2005 }
2006 #[must_use]
2008 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2009 self.inner = self.inner.accept_compressed(encoding);
2010 self
2011 }
2012 #[must_use]
2016 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2017 self.inner = self.inner.max_decoding_message_size(limit);
2018 self
2019 }
2020 #[must_use]
2024 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2025 self.inner = self.inner.max_encoding_message_size(limit);
2026 self
2027 }
2028 pub async fn read_schema(
2034 &mut self,
2035 request: impl tonic::IntoRequest<super::ReadSchemaRequest>,
2036 ) -> std::result::Result<
2037 tonic::Response<super::ReadSchemaResponse>,
2038 tonic::Status,
2039 > {
2040 self.inner
2041 .ready()
2042 .await
2043 .map_err(|e| {
2044 tonic::Status::unknown(
2045 format!("Service was not ready: {}", e.into()),
2046 )
2047 })?;
2048 let codec = tonic::codec::ProstCodec::default();
2049 let path = http::uri::PathAndQuery::from_static(
2050 "/authzed.api.v1.SchemaService/ReadSchema",
2051 );
2052 let mut req = request.into_request();
2053 req.extensions_mut()
2054 .insert(GrpcMethod::new("authzed.api.v1.SchemaService", "ReadSchema"));
2055 self.inner.unary(req, path, codec).await
2056 }
2057 pub async fn write_schema(
2059 &mut self,
2060 request: impl tonic::IntoRequest<super::WriteSchemaRequest>,
2061 ) -> std::result::Result<
2062 tonic::Response<super::WriteSchemaResponse>,
2063 tonic::Status,
2064 > {
2065 self.inner
2066 .ready()
2067 .await
2068 .map_err(|e| {
2069 tonic::Status::unknown(
2070 format!("Service was not ready: {}", e.into()),
2071 )
2072 })?;
2073 let codec = tonic::codec::ProstCodec::default();
2074 let path = http::uri::PathAndQuery::from_static(
2075 "/authzed.api.v1.SchemaService/WriteSchema",
2076 );
2077 let mut req = request.into_request();
2078 req.extensions_mut()
2079 .insert(GrpcMethod::new("authzed.api.v1.SchemaService", "WriteSchema"));
2080 self.inner.unary(req, path, codec).await
2081 }
2082 pub async fn reflect_schema(
2085 &mut self,
2086 request: impl tonic::IntoRequest<super::ReflectSchemaRequest>,
2087 ) -> std::result::Result<
2088 tonic::Response<super::ReflectSchemaResponse>,
2089 tonic::Status,
2090 > {
2091 self.inner
2092 .ready()
2093 .await
2094 .map_err(|e| {
2095 tonic::Status::unknown(
2096 format!("Service was not ready: {}", e.into()),
2097 )
2098 })?;
2099 let codec = tonic::codec::ProstCodec::default();
2100 let path = http::uri::PathAndQuery::from_static(
2101 "/authzed.api.v1.SchemaService/ReflectSchema",
2102 );
2103 let mut req = request.into_request();
2104 req.extensions_mut()
2105 .insert(
2106 GrpcMethod::new("authzed.api.v1.SchemaService", "ReflectSchema"),
2107 );
2108 self.inner.unary(req, path, codec).await
2109 }
2110 pub async fn computable_permissions(
2115 &mut self,
2116 request: impl tonic::IntoRequest<super::ComputablePermissionsRequest>,
2117 ) -> std::result::Result<
2118 tonic::Response<super::ComputablePermissionsResponse>,
2119 tonic::Status,
2120 > {
2121 self.inner
2122 .ready()
2123 .await
2124 .map_err(|e| {
2125 tonic::Status::unknown(
2126 format!("Service was not ready: {}", e.into()),
2127 )
2128 })?;
2129 let codec = tonic::codec::ProstCodec::default();
2130 let path = http::uri::PathAndQuery::from_static(
2131 "/authzed.api.v1.SchemaService/ComputablePermissions",
2132 );
2133 let mut req = request.into_request();
2134 req.extensions_mut()
2135 .insert(
2136 GrpcMethod::new(
2137 "authzed.api.v1.SchemaService",
2138 "ComputablePermissions",
2139 ),
2140 );
2141 self.inner.unary(req, path, codec).await
2142 }
2143 pub async fn dependent_relations(
2147 &mut self,
2148 request: impl tonic::IntoRequest<super::DependentRelationsRequest>,
2149 ) -> std::result::Result<
2150 tonic::Response<super::DependentRelationsResponse>,
2151 tonic::Status,
2152 > {
2153 self.inner
2154 .ready()
2155 .await
2156 .map_err(|e| {
2157 tonic::Status::unknown(
2158 format!("Service was not ready: {}", e.into()),
2159 )
2160 })?;
2161 let codec = tonic::codec::ProstCodec::default();
2162 let path = http::uri::PathAndQuery::from_static(
2163 "/authzed.api.v1.SchemaService/DependentRelations",
2164 );
2165 let mut req = request.into_request();
2166 req.extensions_mut()
2167 .insert(
2168 GrpcMethod::new("authzed.api.v1.SchemaService", "DependentRelations"),
2169 );
2170 self.inner.unary(req, path, codec).await
2171 }
2172 pub async fn diff_schema(
2175 &mut self,
2176 request: impl tonic::IntoRequest<super::DiffSchemaRequest>,
2177 ) -> std::result::Result<
2178 tonic::Response<super::DiffSchemaResponse>,
2179 tonic::Status,
2180 > {
2181 self.inner
2182 .ready()
2183 .await
2184 .map_err(|e| {
2185 tonic::Status::unknown(
2186 format!("Service was not ready: {}", e.into()),
2187 )
2188 })?;
2189 let codec = tonic::codec::ProstCodec::default();
2190 let path = http::uri::PathAndQuery::from_static(
2191 "/authzed.api.v1.SchemaService/DiffSchema",
2192 );
2193 let mut req = request.into_request();
2194 req.extensions_mut()
2195 .insert(GrpcMethod::new("authzed.api.v1.SchemaService", "DiffSchema"));
2196 self.inner.unary(req, path, codec).await
2197 }
2198 }
2199}
2200#[derive(Clone, PartialEq, ::prost::Message)]
2203pub struct WatchRequest {
2204 #[prost(string, repeated, tag = "1")]
2208 pub optional_object_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2209 #[prost(message, optional, tag = "2")]
2215 pub optional_start_cursor: ::core::option::Option<ZedToken>,
2216 #[prost(message, repeated, tag = "3")]
2222 pub optional_relationship_filters: ::prost::alloc::vec::Vec<RelationshipFilter>,
2223 #[prost(enumeration = "WatchKind", repeated, tag = "4")]
2227 pub optional_update_kinds: ::prost::alloc::vec::Vec<i32>,
2228}
2229#[derive(Clone, PartialEq, ::prost::Message)]
2234pub struct WatchResponse {
2235 #[prost(message, repeated, tag = "1")]
2238 pub updates: ::prost::alloc::vec::Vec<RelationshipUpdate>,
2239 #[prost(message, optional, tag = "2")]
2243 pub changes_through: ::core::option::Option<ZedToken>,
2244 #[prost(message, optional, tag = "3")]
2249 pub optional_transaction_metadata: ::core::option::Option<::prost_types::Struct>,
2250 #[prost(bool, tag = "4")]
2252 pub schema_updated: bool,
2253 #[prost(bool, tag = "5")]
2257 pub is_checkpoint: bool,
2258 #[prost(message, repeated, tag = "6")]
2263 pub full_revision_metadata: ::prost::alloc::vec::Vec<::prost_types::Struct>,
2264}
2265#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2266#[repr(i32)]
2267pub enum WatchKind {
2268 Unspecified = 0,
2270 IncludeRelationshipUpdates = 1,
2271 IncludeSchemaUpdates = 2,
2272 IncludeCheckpoints = 3,
2273}
2274impl WatchKind {
2275 pub fn as_str_name(&self) -> &'static str {
2280 match self {
2281 Self::Unspecified => "WATCH_KIND_UNSPECIFIED",
2282 Self::IncludeRelationshipUpdates => "WATCH_KIND_INCLUDE_RELATIONSHIP_UPDATES",
2283 Self::IncludeSchemaUpdates => "WATCH_KIND_INCLUDE_SCHEMA_UPDATES",
2284 Self::IncludeCheckpoints => "WATCH_KIND_INCLUDE_CHECKPOINTS",
2285 }
2286 }
2287 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2289 match value {
2290 "WATCH_KIND_UNSPECIFIED" => Some(Self::Unspecified),
2291 "WATCH_KIND_INCLUDE_RELATIONSHIP_UPDATES" => {
2292 Some(Self::IncludeRelationshipUpdates)
2293 }
2294 "WATCH_KIND_INCLUDE_SCHEMA_UPDATES" => Some(Self::IncludeSchemaUpdates),
2295 "WATCH_KIND_INCLUDE_CHECKPOINTS" => Some(Self::IncludeCheckpoints),
2296 _ => None,
2297 }
2298 }
2299}
2300pub mod watch_service_client {
2302 #![allow(
2303 unused_variables,
2304 dead_code,
2305 missing_docs,
2306 clippy::wildcard_imports,
2307 clippy::let_unit_value,
2308 )]
2309 use tonic::codegen::*;
2310 use tonic::codegen::http::Uri;
2311 #[derive(Debug, Clone)]
2312 pub struct WatchServiceClient<T> {
2313 inner: tonic::client::Grpc<T>,
2314 }
2315 impl WatchServiceClient<tonic::transport::Channel> {
2316 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2318 where
2319 D: TryInto<tonic::transport::Endpoint>,
2320 D::Error: Into<StdError>,
2321 {
2322 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2323 Ok(Self::new(conn))
2324 }
2325 }
2326 impl<T> WatchServiceClient<T>
2327 where
2328 T: tonic::client::GrpcService<tonic::body::BoxBody>,
2329 T::Error: Into<StdError>,
2330 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2331 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2332 {
2333 pub fn new(inner: T) -> Self {
2334 let inner = tonic::client::Grpc::new(inner);
2335 Self { inner }
2336 }
2337 pub fn with_origin(inner: T, origin: Uri) -> Self {
2338 let inner = tonic::client::Grpc::with_origin(inner, origin);
2339 Self { inner }
2340 }
2341 pub fn with_interceptor<F>(
2342 inner: T,
2343 interceptor: F,
2344 ) -> WatchServiceClient<InterceptedService<T, F>>
2345 where
2346 F: tonic::service::Interceptor,
2347 T::ResponseBody: Default,
2348 T: tonic::codegen::Service<
2349 http::Request<tonic::body::BoxBody>,
2350 Response = http::Response<
2351 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
2352 >,
2353 >,
2354 <T as tonic::codegen::Service<
2355 http::Request<tonic::body::BoxBody>,
2356 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2357 {
2358 WatchServiceClient::new(InterceptedService::new(inner, interceptor))
2359 }
2360 #[must_use]
2365 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2366 self.inner = self.inner.send_compressed(encoding);
2367 self
2368 }
2369 #[must_use]
2371 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2372 self.inner = self.inner.accept_compressed(encoding);
2373 self
2374 }
2375 #[must_use]
2379 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2380 self.inner = self.inner.max_decoding_message_size(limit);
2381 self
2382 }
2383 #[must_use]
2387 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2388 self.inner = self.inner.max_encoding_message_size(limit);
2389 self
2390 }
2391 pub async fn watch(
2394 &mut self,
2395 request: impl tonic::IntoRequest<super::WatchRequest>,
2396 ) -> std::result::Result<
2397 tonic::Response<tonic::codec::Streaming<super::WatchResponse>>,
2398 tonic::Status,
2399 > {
2400 self.inner
2401 .ready()
2402 .await
2403 .map_err(|e| {
2404 tonic::Status::unknown(
2405 format!("Service was not ready: {}", e.into()),
2406 )
2407 })?;
2408 let codec = tonic::codec::ProstCodec::default();
2409 let path = http::uri::PathAndQuery::from_static(
2410 "/authzed.api.v1.WatchService/Watch",
2411 );
2412 let mut req = request.into_request();
2413 req.extensions_mut()
2414 .insert(GrpcMethod::new("authzed.api.v1.WatchService", "Watch"));
2415 self.inner.server_streaming(req, path, codec).await
2416 }
2417 }
2418}