spicedb_grpc/gen/
authzed.api.v1.rs

1// This file is @generated by prost-build.
2/// Relationship specifies how a resource relates to a subject. Relationships
3/// form the data for the graph over which all permissions questions are
4/// answered.
5#[allow(clippy::derive_partial_eq_without_eq)]
6#[derive(Clone, PartialEq, ::prost::Message)]
7pub struct Relationship {
8    /// resource is the resource to which the subject is related, in some manner
9    #[prost(message, optional, tag = "1")]
10    pub resource: ::core::option::Option<ObjectReference>,
11    /// relation is how the resource and subject are related.
12    #[prost(string, tag = "2")]
13    pub relation: ::prost::alloc::string::String,
14    /// subject is the subject to which the resource is related, in some manner.
15    #[prost(message, optional, tag = "3")]
16    pub subject: ::core::option::Option<SubjectReference>,
17    /// optional_caveat is a reference to a the caveat that must be enforced over the relationship
18    #[prost(message, optional, tag = "4")]
19    pub optional_caveat: ::core::option::Option<ContextualizedCaveat>,
20}
21/// ContextualizedCaveat represents a reference to a caveat to be used by caveated relationships.
22/// The context consists of key-value pairs that will be injected at evaluation time.
23/// The keys must match the arguments defined on the caveat in the schema.
24#[allow(clippy::derive_partial_eq_without_eq)]
25#[derive(Clone, PartialEq, ::prost::Message)]
26pub struct ContextualizedCaveat {
27    /// caveat_name is the name of the caveat expression to use, as defined in the schema
28    #[prost(string, tag = "1")]
29    pub caveat_name: ::prost::alloc::string::String,
30    /// context consists of any named values that are defined at write time for the caveat expression
31    #[prost(message, optional, tag = "2")]
32    pub context: ::core::option::Option<::prost_types::Struct>,
33}
34/// SubjectReference is used for referring to the subject portion of a
35/// Relationship. The relation component is optional and is used for defining a
36/// sub-relation on the subject, e.g. group:123#members
37#[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/// ObjectReference is used to refer to a specific object in the system.
46#[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/// ZedToken is used to provide causality metadata between Write and Check
55/// requests.
56///
57/// See the authzed.api.v1.Consistency message for more information.
58#[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/// Cursor is used to provide resumption of listing between calls to APIs
65/// such as LookupResources.
66#[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/// RelationshipUpdate is used for mutating a single relationship within the
73/// service.
74///
75/// CREATE will create the relationship only if it doesn't exist, and error
76/// otherwise.
77///
78/// TOUCH will upsert the relationship, and will not error if it
79/// already exists.
80///
81/// DELETE will delete the relationship. If the relationship does not exist,
82/// this operation will no-op.
83#[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}
91/// Nested message and enum types in `RelationshipUpdate`.
92pub 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        /// String value of the enum field names used in the ProtoBuf definition.
113        ///
114        /// The values are not transformed in any way and thus are considered stable
115        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
116        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        /// Creates an enum from field names used in the ProtoBuf definition.
125        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/// PermissionRelationshipTree is used for representing a tree of a resource and
137/// its permission relationships with other objects.
138#[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}
148/// Nested message and enum types in `PermissionRelationshipTree`.
149pub 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/// AlgebraicSubjectSet is a subject set which is computed based on applying the
160/// specified operation to the operands according to the algebra of sets.
161///
162/// UNION is a logical set containing the subject members from all operands.
163///
164/// INTERSECTION is a logical set containing only the subject members which are
165/// present in all operands.
166///
167/// EXCLUSION is a logical set containing only the subject members which are
168/// present in the first operand, and none of the other operands.
169#[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}
177/// Nested message and enum types in `AlgebraicSubjectSet`.
178pub 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        /// String value of the enum field names used in the ProtoBuf definition.
199        ///
200        /// The values are not transformed in any way and thus are considered stable
201        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
202        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        /// Creates an enum from field names used in the ProtoBuf definition.
211        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/// DirectSubjectSet is a subject set which is simply a collection of subjects.
223#[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/// PartialCaveatInfo carries information necessary for the client to take action
230/// in the event a response contains a partially evaluated caveat
231#[allow(clippy::derive_partial_eq_without_eq)]
232#[derive(Clone, PartialEq, ::prost::Message)]
233pub struct PartialCaveatInfo {
234    /// missing_required_context is a list of one or more fields that were missing and prevented caveats
235    /// from being fully evaluated
236    #[prost(string, repeated, tag = "1")]
237    pub missing_required_context: ::prost::alloc::vec::Vec<
238        ::prost::alloc::string::String,
239    >,
240}
241/// DebugInformation defines debug information returned by an API call in a footer when
242/// requested with a specific debugging header.
243///
244/// The specific debug information returned will depend on the type of the API call made.
245///
246/// See the github.com/authzed/authzed-go project for the specific header and footer names.
247#[allow(clippy::derive_partial_eq_without_eq)]
248#[derive(Clone, PartialEq, ::prost::Message)]
249pub struct DebugInformation {
250    /// check holds debug information about a check request.
251    #[prost(message, optional, tag = "1")]
252    pub check: ::core::option::Option<CheckDebugTrace>,
253    /// schema_used holds the schema used for the request.
254    #[prost(string, tag = "2")]
255    pub schema_used: ::prost::alloc::string::String,
256}
257/// CheckDebugTrace is a recursive trace of the requests made for resolving a CheckPermission
258/// API call.
259#[allow(clippy::derive_partial_eq_without_eq)]
260#[derive(Clone, PartialEq, ::prost::Message)]
261pub struct CheckDebugTrace {
262    /// resource holds the resource on which the Check was performed.
263    #[prost(message, optional, tag = "1")]
264    pub resource: ::core::option::Option<ObjectReference>,
265    /// permission holds the name of the permission or relation on which the Check was performed.
266    #[prost(string, tag = "2")]
267    pub permission: ::prost::alloc::string::String,
268    /// permission_type holds information indicating whether it was a permission or relation.
269    #[prost(enumeration = "check_debug_trace::PermissionType", tag = "3")]
270    pub permission_type: i32,
271    /// subject holds the subject on which the Check was performed. This will be static across all calls within
272    /// the same Check tree.
273    #[prost(message, optional, tag = "4")]
274    pub subject: ::core::option::Option<SubjectReference>,
275    /// result holds the result of the Check call.
276    #[prost(enumeration = "check_debug_trace::Permissionship", tag = "5")]
277    pub result: i32,
278    /// caveat_evaluation_info holds information about the caveat evaluated for this step of the trace.
279    #[prost(message, optional, tag = "8")]
280    pub caveat_evaluation_info: ::core::option::Option<CaveatEvalInfo>,
281    /// duration holds the time spent executing this Check operation.
282    #[prost(message, optional, tag = "9")]
283    pub duration: ::core::option::Option<::prost_types::Duration>,
284    /// resolution holds information about how the problem was resolved.
285    #[prost(oneof = "check_debug_trace::Resolution", tags = "6, 7")]
286    pub resolution: ::core::option::Option<check_debug_trace::Resolution>,
287}
288/// Nested message and enum types in `CheckDebugTrace`.
289pub 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        /// String value of the enum field names used in the ProtoBuf definition.
315        ///
316        /// The values are not transformed in any way and thus are considered stable
317        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
318        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        /// Creates an enum from field names used in the ProtoBuf definition.
326        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        /// String value of the enum field names used in the ProtoBuf definition.
355        ///
356        /// The values are not transformed in any way and thus are considered stable
357        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
358        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        /// Creates an enum from field names used in the ProtoBuf definition.
369        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    /// resolution holds information about how the problem was resolved.
382    #[allow(clippy::derive_partial_eq_without_eq)]
383    #[derive(Clone, PartialEq, ::prost::Oneof)]
384    pub enum Resolution {
385        /// was_cached_result, if true, indicates that the result was found in the cache and returned directly.
386        #[prost(bool, tag = "6")]
387        WasCachedResult(bool),
388        /// sub_problems holds the sub problems that were executed to resolve the answer to this Check. An empty list
389        /// and a permissionship of PERMISSIONSHIP_HAS_PERMISSION indicates the subject was found within this relation.
390        #[prost(message, tag = "7")]
391        SubProblems(SubProblems),
392    }
393}
394/// CaveatEvalInfo holds information about a caveat expression that was evaluated.
395#[allow(clippy::derive_partial_eq_without_eq)]
396#[derive(Clone, PartialEq, ::prost::Message)]
397pub struct CaveatEvalInfo {
398    /// expression is the expression that was evaluated.
399    #[prost(string, tag = "1")]
400    pub expression: ::prost::alloc::string::String,
401    /// result is the result of the evaluation.
402    #[prost(enumeration = "caveat_eval_info::Result", tag = "2")]
403    pub result: i32,
404    /// context consists of any named values that were used for evaluating the caveat expression.
405    #[prost(message, optional, tag = "3")]
406    pub context: ::core::option::Option<::prost_types::Struct>,
407    /// partial_caveat_info holds information of a partially-evaluated caveated response, if applicable.
408    #[prost(message, optional, tag = "4")]
409    pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
410    /// caveat_name is the name of the caveat that was executed, if applicable.
411    #[prost(string, tag = "5")]
412    pub caveat_name: ::prost::alloc::string::String,
413}
414/// Nested message and enum types in `CaveatEvalInfo`.
415pub 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        /// String value of the enum field names used in the ProtoBuf definition.
437        ///
438        /// The values are not transformed in any way and thus are considered stable
439        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
440        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        /// Creates an enum from field names used in the ProtoBuf definition.
450        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/// Consistency will define how a request is handled by the backend.
463/// By defining a consistency requirement, and a token at which those
464/// requirements should be applied, where applicable.
465#[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}
471/// Nested message and enum types in `Consistency`.
472pub mod consistency {
473    #[allow(clippy::derive_partial_eq_without_eq)]
474    #[derive(Clone, PartialEq, ::prost::Oneof)]
475    pub enum Requirement {
476        /// minimize_latency indicates that the latency for the call should be
477        /// minimized by having the system select the fastest snapshot available.
478        #[prost(bool, tag = "1")]
479        MinimizeLatency(bool),
480        /// at_least_as_fresh indicates that all data used in the API call must be
481        /// *at least as fresh* as that found in the ZedToken; more recent data might
482        /// be used if available or faster.
483        #[prost(message, tag = "2")]
484        AtLeastAsFresh(super::ZedToken),
485        /// at_exact_snapshot indicates that all data used in the API call must be
486        /// *at the given* snapshot in time; if the snapshot is no longer available,
487        /// an error will be returned to the caller.
488        #[prost(message, tag = "3")]
489        AtExactSnapshot(super::ZedToken),
490        /// fully_consistent indicates that all data used in the API call *must* be
491        /// at the most recent snapshot found.
492        ///
493        /// NOTE: using this method can be *quite slow*, so unless there is a need to
494        /// do so, it is recommended to use `at_least_as_fresh` with a stored
495        /// ZedToken.
496        #[prost(bool, tag = "4")]
497        FullyConsistent(bool),
498    }
499}
500/// RelationshipFilter is a collection of filters which when applied to a
501/// relationship will return relationships that have exactly matching fields.
502///
503/// All fields are optional and if left unspecified will not filter relationships,
504/// but at least one field must be specified.
505///
506/// NOTE: The performance of the API will be affected by the selection of fields
507/// on which to filter. If a field is not indexed, the performance of the API
508/// can be significantly slower.
509#[allow(clippy::derive_partial_eq_without_eq)]
510#[derive(Clone, PartialEq, ::prost::Message)]
511pub struct RelationshipFilter {
512    /// resource_type is the *optional* resource type of the relationship.
513    /// NOTE: It is not prefixed with "optional_" for legacy compatibility.
514    #[prost(string, tag = "1")]
515    pub resource_type: ::prost::alloc::string::String,
516    /// optional_resource_id is the *optional* resource ID of the relationship.
517    /// If specified, optional_resource_id_prefix cannot be specified.
518    #[prost(string, tag = "2")]
519    pub optional_resource_id: ::prost::alloc::string::String,
520    /// optional_resource_id_prefix is the *optional* prefix for the resource ID of the relationship.
521    /// If specified, optional_resource_id cannot be specified.
522    #[prost(string, tag = "5")]
523    pub optional_resource_id_prefix: ::prost::alloc::string::String,
524    /// relation is the *optional* relation of the relationship.
525    #[prost(string, tag = "3")]
526    pub optional_relation: ::prost::alloc::string::String,
527    /// optional_subject_filter is the optional filter for the subjects of the relationships.
528    #[prost(message, optional, tag = "4")]
529    pub optional_subject_filter: ::core::option::Option<SubjectFilter>,
530}
531/// SubjectFilter specifies a filter on the subject of a relationship.
532///
533/// subject_type is required and all other fields are optional, and will not
534/// impose any additional requirements if left unspecified.
535#[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}
545/// Nested message and enum types in `SubjectFilter`.
546pub 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/// ReadRelationshipsRequest specifies one or more filters used to read matching
555/// relationships within the system.
556#[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    /// relationship_filter defines the filter to be applied to the relationships
562    /// to be returned.
563    #[prost(message, optional, tag = "2")]
564    pub relationship_filter: ::core::option::Option<RelationshipFilter>,
565    /// optional_limit, if non-zero, specifies the limit on the number of relationships to return
566    /// before the stream is closed on the server side. By default, the stream will continue
567    /// resolving relationships until exhausted or the stream is closed due to the client or a
568    /// network issue.
569    #[prost(uint32, tag = "3")]
570    pub optional_limit: u32,
571    /// optional_cursor, if specified, indicates the cursor after which results should resume being returned.
572    /// The cursor can be found on the ReadRelationshipsResponse object.
573    #[prost(message, optional, tag = "4")]
574    pub optional_cursor: ::core::option::Option<Cursor>,
575}
576/// ReadRelationshipsResponse contains a Relationship found that matches the
577/// specified relationship filter(s). A instance of this response message will
578/// be streamed to the client for each relationship found.
579#[allow(clippy::derive_partial_eq_without_eq)]
580#[derive(Clone, PartialEq, ::prost::Message)]
581pub struct ReadRelationshipsResponse {
582    /// read_at is the ZedToken at which the relationship was found.
583    #[prost(message, optional, tag = "1")]
584    pub read_at: ::core::option::Option<ZedToken>,
585    /// relationship is the found relationship.
586    #[prost(message, optional, tag = "2")]
587    pub relationship: ::core::option::Option<Relationship>,
588    /// after_result_cursor holds a cursor that can be used to resume the ReadRelationships stream after this
589    /// result.
590    #[prost(message, optional, tag = "3")]
591    pub after_result_cursor: ::core::option::Option<Cursor>,
592}
593/// Precondition specifies how and the existence or absence of certain
594/// relationships as expressed through the accompanying filter should affect
595/// whether or not the operation proceeds.
596///
597/// MUST_NOT_MATCH will fail the parent request if any relationships match the
598/// relationships filter.
599/// MUST_MATCH will fail the parent request if there are no
600/// relationships that match the filter.
601#[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}
609/// Nested message and enum types in `Precondition`.
610pub 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        /// String value of the enum field names used in the ProtoBuf definition.
630        ///
631        /// The values are not transformed in any way and thus are considered stable
632        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
633        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        /// Creates an enum from field names used in the ProtoBuf definition.
641        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/// WriteRelationshipsRequest contains a list of Relationship mutations that
652/// should be applied to the service. If the optional_preconditions parameter
653/// is included, all of the specified preconditions must also be satisfied before
654/// the write will be committed.
655#[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    /// To be bounded by configuration
661    #[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/// DeleteRelationshipsRequest specifies which Relationships should be deleted,
671/// requesting the delete of *ALL* relationships that match the specified
672/// filters. If the optional_preconditions parameter is included, all of the
673/// specified preconditions must also be satisfied before the delete will be
674/// executed.
675#[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    /// To be bounded by configuration
681    #[prost(message, repeated, tag = "2")]
682    pub optional_preconditions: ::prost::alloc::vec::Vec<Precondition>,
683    /// optional_limit, if non-zero, specifies the limit on the number of relationships to be deleted.
684    /// If there are more matching relationships found to be deleted than the limit specified here,
685    /// the deletion call will fail with an error to prevent partial deletion. If partial deletion
686    /// is needed, specify below that partial deletion is allowed. Partial deletions can be used
687    /// in a loop to delete large amounts of relationships in a *non-transactional* manner.
688    #[prost(uint32, tag = "3")]
689    pub optional_limit: u32,
690    /// optional_allow_partial_deletions, if true and a limit is specified, will delete matching found
691    /// relationships up to the count specified in optional_limit, and no more.
692    #[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    /// deleted_at is the revision at which the relationships were deleted.
699    #[prost(message, optional, tag = "1")]
700    pub deleted_at: ::core::option::Option<ZedToken>,
701    /// deletion_progress is an enumeration of the possible outcomes that occurred when attempting to delete the specified relationships.
702    #[prost(enumeration = "delete_relationships_response::DeletionProgress", tag = "2")]
703    pub deletion_progress: i32,
704}
705/// Nested message and enum types in `DeleteRelationshipsResponse`.
706pub 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        /// DELETION_PROGRESS_COMPLETE indicates that all remaining relationships matching the filter
722        /// were deleted. Will be returned even if no relationships were deleted.
723        Complete = 1,
724        /// DELETION_PROGRESS_PARTIAL indicates that a subset of the relationships matching the filter
725        /// were deleted. Only returned if optional_allow_partial_deletions was true, an optional_limit was
726        /// specified, and there existed more relationships matching the filter than optional_limit would allow.
727        /// Once all remaining relationships have been deleted, DELETION_PROGRESS_COMPLETE will be returned.
728        Partial = 2,
729    }
730    impl DeletionProgress {
731        /// String value of the enum field names used in the ProtoBuf definition.
732        ///
733        /// The values are not transformed in any way and thus are considered stable
734        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
735        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        /// Creates an enum from field names used in the ProtoBuf definition.
743        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/// CheckPermissionRequest issues a check on whether a subject has a permission
754/// or is a member of a relation, on a specific resource.
755#[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    /// resource is the resource on which to check the permission or relation.
761    #[prost(message, optional, tag = "2")]
762    pub resource: ::core::option::Option<ObjectReference>,
763    /// permission is the name of the permission (or relation) on which to execute
764    /// the check.
765    #[prost(string, tag = "3")]
766    pub permission: ::prost::alloc::string::String,
767    /// subject is the subject that will be checked for the permission or relation.
768    #[prost(message, optional, tag = "4")]
769    pub subject: ::core::option::Option<SubjectReference>,
770    /// context consists of named values that are injected into the caveat evaluation context
771    #[prost(message, optional, tag = "5")]
772    pub context: ::core::option::Option<::prost_types::Struct>,
773    /// with_tracing, if true, indicates that the response should include a debug trace.
774    /// This can be useful for debugging and performance analysis, but adds a small amount
775    /// of compute overhead to the request.
776    #[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    /// Permissionship communicates whether or not the subject has the requested
785    /// permission or has a relationship with the given resource, over the given
786    /// relation.
787    ///
788    /// This value will be authzed.api.v1.PERMISSIONSHIP_HAS_PERMISSION if the
789    /// requested subject is a member of the computed permission set or there
790    /// exists a relationship with the requested relation from the given resource
791    /// to the given subject.
792    #[prost(enumeration = "check_permission_response::Permissionship", tag = "2")]
793    pub permissionship: i32,
794    /// partial_caveat_info holds information of a partially-evaluated caveated response
795    #[prost(message, optional, tag = "3")]
796    pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
797    /// debug_trace is the debugging trace of this check, if requested.
798    #[prost(message, optional, tag = "4")]
799    pub debug_trace: ::core::option::Option<DebugInformation>,
800}
801/// Nested message and enum types in `CheckPermissionResponse`.
802pub 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        /// String value of the enum field names used in the ProtoBuf definition.
823        ///
824        /// The values are not transformed in any way and thus are considered stable
825        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
826        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        /// Creates an enum from field names used in the ProtoBuf definition.
837        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/// CheckBulkPermissionsRequest issues a check on whether a subject has permission
851/// or is a member of a relation on a specific resource for each item in the list.
852///
853/// The ordering of the items in the response is maintained in the response.
854/// Checks with the same subject/permission will automatically be batched for performance optimization.
855#[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}
891/// Nested message and enum types in `CheckBulkPermissionsPair`.
892pub 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/// ExpandPermissionTreeRequest returns a tree representing the expansion of all
911/// relationships found accessible from a permission or relation on a particular
912/// resource.
913///
914/// ExpandPermissionTreeRequest is typically used to determine the full set of
915/// subjects with a permission, along with the relationships that grant said
916/// access.
917#[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    /// resource is the resource over which to run the expansion.
923    #[prost(message, optional, tag = "2")]
924    pub resource: ::core::option::Option<ObjectReference>,
925    /// permission is the name of the permission or relation over which to run the
926    /// expansion for the resource.
927    #[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    /// tree_root is a tree structure whose leaf nodes are subjects, and
936    /// intermediate nodes represent the various operations (union, intersection,
937    /// exclusion) to reach those subjects.
938    #[prost(message, optional, tag = "2")]
939    pub tree_root: ::core::option::Option<PermissionRelationshipTree>,
940}
941/// LookupResourcesRequest performs a lookup of all resources of a particular
942/// kind on which the subject has the specified permission or the relation in
943/// which the subject exists, streaming back the IDs of those resources.
944#[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    /// resource_object_type is the type of resource object for which the IDs will
950    /// be returned.
951    #[prost(string, tag = "2")]
952    pub resource_object_type: ::prost::alloc::string::String,
953    /// permission is the name of the permission or relation for which the subject
954    /// must Check.
955    #[prost(string, tag = "3")]
956    pub permission: ::prost::alloc::string::String,
957    /// subject is the subject with access to the resources.
958    #[prost(message, optional, tag = "4")]
959    pub subject: ::core::option::Option<SubjectReference>,
960    /// context consists of named values that are injected into the caveat evaluation context
961    #[prost(message, optional, tag = "5")]
962    pub context: ::core::option::Option<::prost_types::Struct>,
963    /// optional_limit, if non-zero, specifies the limit on the number of resources to return
964    /// before the stream is closed on the server side. By default, the stream will continue
965    /// resolving resources until exhausted or the stream is closed due to the client or a
966    /// network issue.
967    #[prost(uint32, tag = "6")]
968    pub optional_limit: u32,
969    /// optional_cursor, if specified, indicates the cursor after which results should resume being returned.
970    /// The cursor can be found on the LookupResourcesResponse object.
971    #[prost(message, optional, tag = "7")]
972    pub optional_cursor: ::core::option::Option<Cursor>,
973}
974/// LookupResourcesResponse contains a single matching resource object ID for the
975/// requested object type, permission, and subject.
976#[allow(clippy::derive_partial_eq_without_eq)]
977#[derive(Clone, PartialEq, ::prost::Message)]
978pub struct LookupResourcesResponse {
979    /// looked_up_at is the ZedToken at which the resource was found.
980    #[prost(message, optional, tag = "1")]
981    pub looked_up_at: ::core::option::Option<ZedToken>,
982    /// resource_object_id is the object ID of the found resource.
983    #[prost(string, tag = "2")]
984    pub resource_object_id: ::prost::alloc::string::String,
985    /// permissionship indicates whether the response was partially evaluated or not
986    #[prost(enumeration = "LookupPermissionship", tag = "3")]
987    pub permissionship: i32,
988    /// partial_caveat_info holds information of a partially-evaluated caveated response
989    #[prost(message, optional, tag = "4")]
990    pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
991    /// after_result_cursor holds a cursor that can be used to resume the LookupResources stream after this
992    /// result.
993    #[prost(message, optional, tag = "5")]
994    pub after_result_cursor: ::core::option::Option<Cursor>,
995}
996/// LookupSubjectsRequest performs a lookup of all subjects of a particular
997/// kind for which the subject has the specified permission or the relation in
998/// which the subject exists, streaming back the IDs of those subjects.
999#[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    /// resource is the resource for which all matching subjects for the permission
1005    /// or relation will be returned.
1006    #[prost(message, optional, tag = "2")]
1007    pub resource: ::core::option::Option<ObjectReference>,
1008    /// permission is the name of the permission (or relation) for which to find
1009    /// the subjects.
1010    #[prost(string, tag = "3")]
1011    pub permission: ::prost::alloc::string::String,
1012    /// subject_object_type is the type of subject object for which the IDs will
1013    /// be returned.
1014    #[prost(string, tag = "4")]
1015    pub subject_object_type: ::prost::alloc::string::String,
1016    /// optional_subject_relation is the optional relation for the subject.
1017    #[prost(string, tag = "5")]
1018    pub optional_subject_relation: ::prost::alloc::string::String,
1019    /// context consists of named values that are injected into the caveat evaluation context
1020    #[prost(message, optional, tag = "6")]
1021    pub context: ::core::option::Option<::prost_types::Struct>,
1022    /// optional_concrete_limit, if non-zero, specifies the limit on the number of
1023    /// *concrete* (non-wildcard) subjects to return before the stream is closed on the
1024    /// server side. With the default value of zero, the stream will continue resolving
1025    /// concrete subjects until exhausted or the stream is closed due to the client or
1026    /// a network issue.
1027    ///
1028    /// NOTE: Wildcard subjects ("*") have special treatment when cursors and limits are used. Because
1029    /// wildcards can apply to *any* concrete subjects, if a wildcard subject is found within the dataset,
1030    /// a wildcard subject can be returned for *all* LookupSubjects calls, regardless of the cursor or
1031    /// limit.
1032    ///
1033    /// For example, if wildcards are requested, a wildcard subject exists, there is a specified limit
1034    /// of 10 concrete subjects, and at least 10 concrete subjects exist, the API will return 11 subjects
1035    /// in total: the 10 concrete + the wildcard
1036    ///
1037    /// Furthermore, if a wildcard has a set of exclusions generated by the dataset,
1038    /// the exclusions *will respect the cursor* and only a *partial* set of exclusions will be returned
1039    /// for each invocation of the API.
1040    ///
1041    /// ***IT IS UP TO THE CALLER IN THIS CASE TO COMBINE THE EXCLUSIONS IF DESIRED***
1042    #[prost(uint32, tag = "7")]
1043    pub optional_concrete_limit: u32,
1044    /// optional_cursor, if specified, indicates the cursor after which results should resume being returned.
1045    /// The cursor can be found on the LookupSubjectsResponse object.
1046    ///
1047    /// NOTE: See above for notes about how cursors interact with wildcard subjects.
1048    #[prost(message, optional, tag = "8")]
1049    pub optional_cursor: ::core::option::Option<Cursor>,
1050    /// wildcard_option specifies whether wildcards should be returned by LookupSubjects.
1051    /// For backwards compatibility, defaults to WILDCARD_OPTION_INCLUDE_WILDCARDS if unspecified.
1052    #[prost(enumeration = "lookup_subjects_request::WildcardOption", tag = "9")]
1053    pub wildcard_option: i32,
1054}
1055/// Nested message and enum types in `LookupSubjectsRequest`.
1056pub 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        /// String value of the enum field names used in the ProtoBuf definition.
1076        ///
1077        /// The values are not transformed in any way and thus are considered stable
1078        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1079        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        /// Creates an enum from field names used in the ProtoBuf definition.
1087        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/// LookupSubjectsResponse contains a single matching subject object ID for the
1098/// requested subject object type on the permission or relation.
1099#[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    /// subject_object_id is the Object ID of the subject found. May be a `*` if
1105    /// a wildcard was found.
1106    /// deprecated: use `subject`
1107    #[deprecated]
1108    #[prost(string, tag = "2")]
1109    pub subject_object_id: ::prost::alloc::string::String,
1110    /// excluded_subject_ids are the Object IDs of the subjects excluded. This list
1111    /// will only contain object IDs if `subject_object_id` is a wildcard (`*`) and
1112    /// will only be populated if exclusions exist from the wildcard.
1113    /// deprecated: use `excluded_subjects`
1114    #[deprecated]
1115    #[prost(string, repeated, tag = "3")]
1116    pub excluded_subject_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1117    /// permissionship indicates whether the response was partially evaluated or not
1118    /// deprecated: use `subject.permissionship`
1119    #[deprecated]
1120    #[prost(enumeration = "LookupPermissionship", tag = "4")]
1121    pub permissionship: i32,
1122    /// partial_caveat_info holds information of a partially-evaluated caveated response
1123    /// deprecated: use `subject.partial_caveat_info`
1124    #[deprecated]
1125    #[prost(message, optional, tag = "5")]
1126    pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
1127    /// subject is the subject found, along with its permissionship.
1128    #[prost(message, optional, tag = "6")]
1129    pub subject: ::core::option::Option<ResolvedSubject>,
1130    /// excluded_subjects are the subjects excluded. This list
1131    /// will only contain subjects if `subject.subject_object_id` is a wildcard (`*`) and
1132    /// will only be populated if exclusions exist from the wildcard.
1133    #[prost(message, repeated, tag = "7")]
1134    pub excluded_subjects: ::prost::alloc::vec::Vec<ResolvedSubject>,
1135    /// after_result_cursor holds a cursor that can be used to resume the LookupSubjects stream after this
1136    /// result.
1137    #[prost(message, optional, tag = "8")]
1138    pub after_result_cursor: ::core::option::Option<Cursor>,
1139}
1140/// ResolvedSubject is a single subject resolved within LookupSubjects.
1141#[allow(clippy::derive_partial_eq_without_eq)]
1142#[derive(Clone, PartialEq, ::prost::Message)]
1143pub struct ResolvedSubject {
1144    /// subject_object_id is the Object ID of the subject found. May be a `*` if
1145    /// a wildcard was found.
1146    #[prost(string, tag = "1")]
1147    pub subject_object_id: ::prost::alloc::string::String,
1148    /// permissionship indicates whether the response was partially evaluated or not
1149    #[prost(enumeration = "LookupPermissionship", tag = "2")]
1150    pub permissionship: i32,
1151    /// partial_caveat_info holds information of a partially-evaluated caveated response
1152    #[prost(message, optional, tag = "3")]
1153    pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
1154}
1155/// LookupPermissionship represents whether a Lookup response was partially evaluated or not
1156#[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    /// String value of the enum field names used in the ProtoBuf definition.
1165    ///
1166    /// The values are not transformed in any way and thus are considered stable
1167    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1168    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    /// Creates an enum from field names used in the ProtoBuf definition.
1178    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}
1189/// Generated client implementations.
1190pub 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    /// PermissionsService implements a set of RPCs that perform operations on
1195    /// relationships and permissions.
1196    #[derive(Debug, Clone)]
1197    pub struct PermissionsServiceClient<T> {
1198        inner: tonic::client::Grpc<T>,
1199    }
1200    impl PermissionsServiceClient<tonic::transport::Channel> {
1201        /// Attempt to create a new client by connecting to a given endpoint.
1202        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        /// Compress requests with the given encoding.
1246        ///
1247        /// This requires the server to support it otherwise it might respond with an
1248        /// error.
1249        #[must_use]
1250        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1251            self.inner = self.inner.send_compressed(encoding);
1252            self
1253        }
1254        /// Enable decompressing responses.
1255        #[must_use]
1256        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1257            self.inner = self.inner.accept_compressed(encoding);
1258            self
1259        }
1260        /// Limits the maximum size of a decoded message.
1261        ///
1262        /// Default: `4MB`
1263        #[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        /// Limits the maximum size of an encoded message.
1269        ///
1270        /// Default: `usize::MAX`
1271        #[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        /// ReadRelationships reads a set of the relationships matching one or more
1277        /// filters.
1278        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        /// WriteRelationships atomically writes and/or deletes a set of specified
1309        /// relationships. An optional set of preconditions can be provided that must
1310        /// be satisfied for the operation to commit.
1311        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        /// DeleteRelationships atomically bulk deletes all relationships matching the
1342        /// provided filter. If no relationships match, none will be deleted and the
1343        /// operation will succeed. An optional set of preconditions can be provided that must
1344        /// be satisfied for the operation to commit.
1345        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        /// CheckPermission determines for a given resource whether a subject computes
1376        /// to having a permission or is a direct member of a particular relation.
1377        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        /// CheckBulkPermissions evaluates the given list of permission checks
1408        /// and returns the list of results.
1409        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        /// ExpandPermissionTree reveals the graph structure for a resource's
1440        /// permission or relation. This RPC does not recurse infinitely deep and may
1441        /// require multiple calls to fully unnest a deeply nested graph.
1442        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        /// LookupResources returns all the resources of a given type that a subject
1473        /// can access whether via a computed permission or relation membership.
1474        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        /// LookupSubjects returns all the subjects of a given type that
1505        /// have access whether via a computed permission or relation membership.
1506        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/// ReadSchemaRequest returns the schema from the database.
1539#[allow(clippy::derive_partial_eq_without_eq)]
1540#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1541pub struct ReadSchemaRequest {}
1542/// ReadSchemaResponse is the resulting data after having read the Object
1543/// Definitions from a Schema.
1544#[allow(clippy::derive_partial_eq_without_eq)]
1545#[derive(Clone, PartialEq, ::prost::Message)]
1546pub struct ReadSchemaResponse {
1547    /// schema_text is the textual form of the current schema in the system
1548    #[prost(string, tag = "1")]
1549    pub schema_text: ::prost::alloc::string::String,
1550    /// read_at is the ZedToken at which the schema was read.
1551    #[prost(message, optional, tag = "2")]
1552    pub read_at: ::core::option::Option<ZedToken>,
1553}
1554/// WriteSchemaRequest is the required data used to "upsert" the Schema of a
1555/// Permissions System.
1556#[allow(clippy::derive_partial_eq_without_eq)]
1557#[derive(Clone, PartialEq, ::prost::Message)]
1558pub struct WriteSchemaRequest {
1559    /// The Schema containing one or more Object Definitions that will be written
1560    /// to the Permissions System.
1561    ///
1562    /// 4MiB
1563    #[prost(string, tag = "1")]
1564    pub schema: ::prost::alloc::string::String,
1565}
1566/// WriteSchemaResponse is the resulting data after having written a Schema to
1567/// a Permissions System.
1568#[allow(clippy::derive_partial_eq_without_eq)]
1569#[derive(Clone, PartialEq, ::prost::Message)]
1570pub struct WriteSchemaResponse {
1571    /// written_at is the ZedToken at which the schema was written.
1572    #[prost(message, optional, tag = "1")]
1573    pub written_at: ::core::option::Option<ZedToken>,
1574}
1575/// Generated client implementations.
1576pub 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    /// SchemaService implements operations on a Permissions System's Schema.
1581    #[derive(Debug, Clone)]
1582    pub struct SchemaServiceClient<T> {
1583        inner: tonic::client::Grpc<T>,
1584    }
1585    impl SchemaServiceClient<tonic::transport::Channel> {
1586        /// Attempt to create a new client by connecting to a given endpoint.
1587        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        /// Compress requests with the given encoding.
1631        ///
1632        /// This requires the server to support it otherwise it might respond with an
1633        /// error.
1634        #[must_use]
1635        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1636            self.inner = self.inner.send_compressed(encoding);
1637            self
1638        }
1639        /// Enable decompressing responses.
1640        #[must_use]
1641        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1642            self.inner = self.inner.accept_compressed(encoding);
1643            self
1644        }
1645        /// Limits the maximum size of a decoded message.
1646        ///
1647        /// Default: `4MB`
1648        #[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        /// Limits the maximum size of an encoded message.
1654        ///
1655        /// Default: `usize::MAX`
1656        #[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        /// Read returns the current Object Definitions for a Permissions System.
1662        ///
1663        /// Errors include:
1664        /// - INVALID_ARGUMENT: a provided value has failed to semantically validate
1665        /// - NOT_FOUND: no schema has been defined
1666        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        /// Write overwrites the current Object Definitions for a Permissions System.
1692        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/// WatchRequest specifies the object definitions for which we want to start
1720/// watching mutations, and an optional start snapshot for when to start
1721/// watching.
1722#[allow(clippy::derive_partial_eq_without_eq)]
1723#[derive(Clone, PartialEq, ::prost::Message)]
1724pub struct WatchRequest {
1725    /// optional_object_types is a filter of resource object types to watch for changes.
1726    /// If specified, only changes to the specified object types will be returned and
1727    /// optional_relationship_filters cannot be used.
1728    #[prost(string, repeated, tag = "1")]
1729    pub optional_object_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1730    /// optional_start_cursor is the ZedToken holding the point-in-time at
1731    /// which to start watching for changes.
1732    /// If not specified, the watch will begin at the current head revision
1733    /// of the datastore, returning any updates that occur after the caller
1734    /// makes the request.
1735    /// Note that if this cursor references a point-in-time containing data
1736    /// that has been garbage collected, an error will be returned.
1737    #[prost(message, optional, tag = "2")]
1738    pub optional_start_cursor: ::core::option::Option<ZedToken>,
1739    /// optional_relationship_filters, if specified, indicates the
1740    /// filter(s) to apply to each relationship to be returned by watch.
1741    /// The relationship will be returned as long as at least one filter matches,
1742    /// this allows clients to match relationships on multiple filters on a single watch call.
1743    /// If specified, optional_object_types cannot be used.
1744    #[prost(message, repeated, tag = "3")]
1745    pub optional_relationship_filters: ::prost::alloc::vec::Vec<RelationshipFilter>,
1746}
1747/// WatchResponse contains all tuple modification events in ascending
1748/// timestamp order, from the requested start snapshot to a snapshot
1749/// encoded in the watch response. The client can use the snapshot to resume
1750/// watching where the previous watch response left off.
1751#[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}
1759/// Generated client implementations.
1760pub 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        /// Attempt to create a new client by connecting to a given endpoint.
1770        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        /// Compress requests with the given encoding.
1814        ///
1815        /// This requires the server to support it otherwise it might respond with an
1816        /// error.
1817        #[must_use]
1818        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1819            self.inner = self.inner.send_compressed(encoding);
1820            self
1821        }
1822        /// Enable decompressing responses.
1823        #[must_use]
1824        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1825            self.inner = self.inner.accept_compressed(encoding);
1826            self
1827        }
1828        /// Limits the maximum size of a decoded message.
1829        ///
1830        /// Default: `4MB`
1831        #[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        /// Limits the maximum size of an encoded message.
1837        ///
1838        /// Default: `usize::MAX`
1839        #[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}