Skip to main content

typedb_protocol/
typedb.protocol.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct Concept {
4    #[prost(oneof = "concept::Concept", tags = "1, 2, 3, 4, 5, 6, 7")]
5    pub concept: ::core::option::Option<concept::Concept>,
6}
7/// Nested message and enum types in `Concept`.
8pub mod concept {
9    #[derive(Clone, PartialEq, ::prost::Oneof)]
10    pub enum Concept {
11        #[prost(message, tag = "1")]
12        EntityType(super::EntityType),
13        #[prost(message, tag = "2")]
14        RelationType(super::RelationType),
15        #[prost(message, tag = "3")]
16        AttributeType(super::AttributeType),
17        #[prost(message, tag = "4")]
18        RoleType(super::RoleType),
19        #[prost(message, tag = "5")]
20        Entity(super::Entity),
21        #[prost(message, tag = "6")]
22        Relation(super::Relation),
23        #[prost(message, tag = "7")]
24        Attribute(super::Attribute),
25    }
26}
27#[derive(Clone, PartialEq, ::prost::Message)]
28pub struct Thing {
29    #[prost(oneof = "thing::Thing", tags = "1, 2, 3")]
30    pub thing: ::core::option::Option<thing::Thing>,
31}
32/// Nested message and enum types in `Thing`.
33pub mod thing {
34    #[derive(Clone, PartialEq, ::prost::Oneof)]
35    pub enum Thing {
36        #[prost(message, tag = "1")]
37        Entity(super::Entity),
38        #[prost(message, tag = "2")]
39        Relation(super::Relation),
40        #[prost(message, tag = "3")]
41        Attribute(super::Attribute),
42    }
43}
44#[derive(Clone, PartialEq, ::prost::Message)]
45pub struct Entity {
46    #[prost(bytes = "vec", tag = "1")]
47    pub iid: ::prost::alloc::vec::Vec<u8>,
48    #[prost(message, optional, tag = "2")]
49    pub entity_type: ::core::option::Option<EntityType>,
50}
51#[derive(Clone, PartialEq, ::prost::Message)]
52pub struct Relation {
53    #[prost(bytes = "vec", tag = "1")]
54    pub iid: ::prost::alloc::vec::Vec<u8>,
55    #[prost(message, optional, tag = "2")]
56    pub relation_type: ::core::option::Option<RelationType>,
57}
58#[derive(Clone, PartialEq, ::prost::Message)]
59pub struct Attribute {
60    #[prost(bytes = "vec", tag = "1")]
61    pub iid: ::prost::alloc::vec::Vec<u8>,
62    #[prost(message, optional, tag = "2")]
63    pub attribute_type: ::core::option::Option<AttributeType>,
64    #[prost(message, optional, tag = "3")]
65    pub value: ::core::option::Option<Value>,
66}
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct Value {
69    #[prost(oneof = "value::Value", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10")]
70    pub value: ::core::option::Option<value::Value>,
71}
72/// Nested message and enum types in `Value`.
73pub mod value {
74    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
75    pub struct Decimal {
76        #[prost(sint64, tag = "1")]
77        pub integer: i64,
78        #[prost(uint64, tag = "2")]
79        pub fractional: u64,
80    }
81    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
82    pub struct Date {
83        /// days since January 1, 0001 as day 1 in the Gregorian Calendar (following Rust conventions)
84        #[prost(sint32, tag = "1")]
85        pub num_days_since_ce: i32,
86    }
87    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
88    pub struct Datetime {
89        /// seconds since epoch
90        #[prost(sint64, tag = "1")]
91        pub seconds: i64,
92        #[prost(uint32, tag = "2")]
93        pub nanos: u32,
94    }
95    #[derive(Clone, PartialEq, ::prost::Message)]
96    pub struct DatetimeTz {
97        #[prost(message, optional, tag = "1")]
98        pub datetime: ::core::option::Option<Datetime>,
99        #[prost(oneof = "datetime_tz::Timezone", tags = "2, 3")]
100        pub timezone: ::core::option::Option<datetime_tz::Timezone>,
101    }
102    /// Nested message and enum types in `Datetime_TZ`.
103    pub mod datetime_tz {
104        #[derive(Clone, PartialEq, ::prost::Oneof)]
105        pub enum Timezone {
106            #[prost(string, tag = "2")]
107            Named(::prost::alloc::string::String),
108            /// offset in seconds
109            #[prost(sint32, tag = "3")]
110            Offset(i32),
111        }
112    }
113    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
114    pub struct Duration {
115        #[prost(uint32, tag = "1")]
116        pub months: u32,
117        #[prost(uint32, tag = "2")]
118        pub days: u32,
119        #[prost(uint64, tag = "3")]
120        pub nanos: u64,
121    }
122    #[derive(Clone, PartialEq, ::prost::Message)]
123    pub struct Struct {
124        #[prost(string, tag = "1")]
125        pub struct_type_name: ::prost::alloc::string::String,
126    }
127    #[derive(Clone, PartialEq, ::prost::Oneof)]
128    pub enum Value {
129        #[prost(bool, tag = "1")]
130        Boolean(bool),
131        #[prost(sint64, tag = "2")]
132        Integer(i64),
133        #[prost(double, tag = "3")]
134        Double(f64),
135        #[prost(message, tag = "4")]
136        Decimal(Decimal),
137        #[prost(string, tag = "5")]
138        String(::prost::alloc::string::String),
139        #[prost(message, tag = "6")]
140        Date(Date),
141        #[prost(message, tag = "7")]
142        Datetime(Datetime),
143        #[prost(message, tag = "8")]
144        DatetimeTz(DatetimeTz),
145        #[prost(message, tag = "9")]
146        Duration(Duration),
147        #[prost(message, tag = "10")]
148        Struct(Struct),
149    }
150}
151#[derive(Clone, PartialEq, ::prost::Message)]
152pub struct Type {
153    #[prost(oneof = "r#type::Type", tags = "1, 2, 3, 4")]
154    pub r#type: ::core::option::Option<r#type::Type>,
155}
156/// Nested message and enum types in `Type`.
157pub mod r#type {
158    #[derive(Clone, PartialEq, ::prost::Oneof)]
159    pub enum Type {
160        #[prost(message, tag = "1")]
161        EntityType(super::EntityType),
162        #[prost(message, tag = "2")]
163        RelationType(super::RelationType),
164        #[prost(message, tag = "3")]
165        AttributeType(super::AttributeType),
166        #[prost(message, tag = "4")]
167        RoleType(super::RoleType),
168    }
169}
170#[derive(Clone, PartialEq, ::prost::Message)]
171pub struct RoleType {
172    #[prost(string, tag = "1")]
173    pub label: ::prost::alloc::string::String,
174}
175#[derive(Clone, PartialEq, ::prost::Message)]
176pub struct EntityType {
177    #[prost(string, tag = "1")]
178    pub label: ::prost::alloc::string::String,
179}
180#[derive(Clone, PartialEq, ::prost::Message)]
181pub struct RelationType {
182    #[prost(string, tag = "1")]
183    pub label: ::prost::alloc::string::String,
184}
185#[derive(Clone, PartialEq, ::prost::Message)]
186pub struct AttributeType {
187    #[prost(string, tag = "1")]
188    pub label: ::prost::alloc::string::String,
189    #[prost(message, optional, tag = "2")]
190    pub value_type: ::core::option::Option<ValueType>,
191}
192#[derive(Clone, PartialEq, ::prost::Message)]
193pub struct ValueType {
194    #[prost(oneof = "value_type::ValueType", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10")]
195    pub value_type: ::core::option::Option<value_type::ValueType>,
196}
197/// Nested message and enum types in `ValueType`.
198pub mod value_type {
199    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
200    pub struct Boolean {}
201    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
202    pub struct Integer {}
203    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
204    pub struct Double {}
205    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
206    pub struct Decimal {}
207    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
208    pub struct String {}
209    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
210    pub struct Date {}
211    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
212    pub struct DateTime {}
213    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
214    pub struct DateTimeTz {}
215    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
216    pub struct Duration {}
217    #[derive(Clone, PartialEq, ::prost::Message)]
218    pub struct Struct {
219        #[prost(string, tag = "1")]
220        pub name: ::prost::alloc::string::String,
221    }
222    #[derive(Clone, PartialEq, ::prost::Oneof)]
223    pub enum ValueType {
224        #[prost(message, tag = "1")]
225        Boolean(Boolean),
226        #[prost(message, tag = "2")]
227        Integer(Integer),
228        #[prost(message, tag = "3")]
229        Double(Double),
230        #[prost(message, tag = "4")]
231        Decimal(Decimal),
232        #[prost(message, tag = "5")]
233        String(String),
234        #[prost(message, tag = "6")]
235        Date(Date),
236        #[prost(message, tag = "7")]
237        Datetime(DateTime),
238        #[prost(message, tag = "8")]
239        DatetimeTz(DateTimeTz),
240        #[prost(message, tag = "9")]
241        Duration(Duration),
242        #[prost(message, tag = "10")]
243        Struct(Struct),
244    }
245}
246#[derive(Clone, PartialEq, ::prost::Message)]
247pub struct ConceptRow {
248    #[prost(message, repeated, tag = "1")]
249    pub row: ::prost::alloc::vec::Vec<RowEntry>,
250    #[prost(bytes = "vec", optional, tag = "2")]
251    pub involved_blocks: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
252}
253#[derive(Clone, PartialEq, ::prost::Message)]
254pub struct RowEntry {
255    #[prost(oneof = "row_entry::Entry", tags = "1, 2, 3, 4, 5")]
256    pub entry: ::core::option::Option<row_entry::Entry>,
257}
258/// Nested message and enum types in `RowEntry`.
259pub mod row_entry {
260    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
261    pub struct Empty {}
262    #[derive(Clone, PartialEq, ::prost::Message)]
263    pub struct ConceptList {
264        #[prost(message, repeated, tag = "1")]
265        pub concepts: ::prost::alloc::vec::Vec<super::Concept>,
266    }
267    #[derive(Clone, PartialEq, ::prost::Message)]
268    pub struct ValueList {
269        #[prost(message, repeated, tag = "1")]
270        pub values: ::prost::alloc::vec::Vec<super::Value>,
271    }
272    #[derive(Clone, PartialEq, ::prost::Oneof)]
273    pub enum Entry {
274        #[prost(message, tag = "1")]
275        Empty(Empty),
276        #[prost(message, tag = "2")]
277        Concept(super::Concept),
278        #[prost(message, tag = "3")]
279        Value(super::Value),
280        #[prost(message, tag = "4")]
281        ConceptList(ConceptList),
282        #[prost(message, tag = "5")]
283        ValueList(ValueList),
284    }
285}
286#[derive(Clone, PartialEq, ::prost::Message)]
287pub struct ConceptDocument {
288    #[prost(message, optional, tag = "1")]
289    pub root: ::core::option::Option<concept_document::Node>,
290}
291/// Nested message and enum types in `ConceptDocument`.
292pub mod concept_document {
293    #[derive(Clone, PartialEq, ::prost::Message)]
294    pub struct Node {
295        #[prost(oneof = "node::Node", tags = "1, 2, 3")]
296        pub node: ::core::option::Option<node::Node>,
297    }
298    /// Nested message and enum types in `Node`.
299    pub mod node {
300        #[derive(Clone, PartialEq, ::prost::Message)]
301        pub struct Map {
302            #[prost(map = "string, message", tag = "1")]
303            pub map: ::std::collections::HashMap<
304                ::prost::alloc::string::String,
305                super::Node,
306            >,
307        }
308        #[derive(Clone, PartialEq, ::prost::Message)]
309        pub struct List {
310            #[prost(message, repeated, tag = "1")]
311            pub list: ::prost::alloc::vec::Vec<super::Node>,
312        }
313        #[derive(Clone, PartialEq, ::prost::Message)]
314        pub struct Leaf {
315            #[prost(oneof = "leaf::Leaf", tags = "1, 10, 11, 12, 13, 15, 20, 21, 30")]
316            pub leaf: ::core::option::Option<leaf::Leaf>,
317        }
318        /// Nested message and enum types in `Leaf`.
319        pub mod leaf {
320            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
321            pub struct Empty {}
322            #[derive(
323                Clone,
324                Copy,
325                Debug,
326                PartialEq,
327                Eq,
328                Hash,
329                PartialOrd,
330                Ord,
331                ::prost::Enumeration
332            )]
333            #[repr(i32)]
334            pub enum Kind {
335                Entity = 0,
336                Relation = 1,
337                Attribute = 3,
338                Role = 4,
339            }
340            impl Kind {
341                /// String value of the enum field names used in the ProtoBuf definition.
342                ///
343                /// The values are not transformed in any way and thus are considered stable
344                /// (if the ProtoBuf definition does not change) and safe for programmatic use.
345                pub fn as_str_name(&self) -> &'static str {
346                    match self {
347                        Self::Entity => "Entity",
348                        Self::Relation => "Relation",
349                        Self::Attribute => "Attribute",
350                        Self::Role => "Role",
351                    }
352                }
353                /// Creates an enum from field names used in the ProtoBuf definition.
354                pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
355                    match value {
356                        "Entity" => Some(Self::Entity),
357                        "Relation" => Some(Self::Relation),
358                        "Attribute" => Some(Self::Attribute),
359                        "Role" => Some(Self::Role),
360                        _ => None,
361                    }
362                }
363            }
364            #[derive(Clone, PartialEq, ::prost::Oneof)]
365            pub enum Leaf {
366                #[prost(message, tag = "1")]
367                Empty(Empty),
368                #[prost(message, tag = "10")]
369                EntityType(super::super::super::EntityType),
370                #[prost(message, tag = "11")]
371                RelationType(super::super::super::RelationType),
372                #[prost(message, tag = "12")]
373                AttributeType(super::super::super::AttributeType),
374                #[prost(message, tag = "13")]
375                RoleType(super::super::super::RoleType),
376                #[prost(message, tag = "15")]
377                ValueType(super::super::super::ValueType),
378                #[prost(message, tag = "20")]
379                Attribute(super::super::super::Attribute),
380                #[prost(message, tag = "21")]
381                Value(super::super::super::Value),
382                #[prost(enumeration = "Kind", tag = "30")]
383                Kind(i32),
384            }
385        }
386        #[derive(Clone, PartialEq, ::prost::Oneof)]
387        pub enum Node {
388            #[prost(message, tag = "1")]
389            Map(Map),
390            #[prost(message, tag = "2")]
391            List(List),
392            #[prost(message, tag = "3")]
393            Leaf(Leaf),
394        }
395    }
396}
397#[derive(Clone, PartialEq, ::prost::Message)]
398pub struct AnalyzedConjunction {
399    #[prost(message, repeated, tag = "1")]
400    pub constraints: ::prost::alloc::vec::Vec<analyzed_conjunction::Constraint>,
401    #[prost(map = "uint32, message", tag = "2")]
402    pub variable_annotations: ::std::collections::HashMap<
403        u32,
404        analyzed_conjunction::VariableAnnotations,
405    >,
406}
407/// Nested message and enum types in `AnalyzedConjunction`.
408pub mod analyzed_conjunction {
409    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
410    pub struct Variable {
411        #[prost(uint32, tag = "1")]
412        pub id: u32,
413    }
414    #[derive(Clone, PartialEq, ::prost::Message)]
415    pub struct ConstraintVertex {
416        #[prost(oneof = "constraint_vertex::Vertex", tags = "1, 2, 3, 4")]
417        pub vertex: ::core::option::Option<constraint_vertex::Vertex>,
418    }
419    /// Nested message and enum types in `ConstraintVertex`.
420    pub mod constraint_vertex {
421        #[derive(Clone, PartialEq, ::prost::Message)]
422        pub struct NamedRole {
423            #[prost(message, optional, tag = "1")]
424            pub variable: ::core::option::Option<super::Variable>,
425            #[prost(string, tag = "2")]
426            pub name: ::prost::alloc::string::String,
427        }
428        #[derive(Clone, PartialEq, ::prost::Oneof)]
429        pub enum Vertex {
430            #[prost(message, tag = "1")]
431            Variable(super::Variable),
432            #[prost(message, tag = "2")]
433            Label(super::super::Type),
434            #[prost(message, tag = "3")]
435            Value(super::super::Value),
436            #[prost(message, tag = "4")]
437            NamedRole(NamedRole),
438        }
439    }
440    #[derive(Clone, PartialEq, ::prost::Message)]
441    pub struct Constraint {
442        #[prost(message, optional, tag = "1")]
443        pub span: ::core::option::Option<constraint::ConstraintSpan>,
444        #[prost(
445            oneof = "constraint::Constraint",
446            tags = "2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19"
447        )]
448        pub constraint: ::core::option::Option<constraint::Constraint>,
449    }
450    /// Nested message and enum types in `Constraint`.
451    pub mod constraint {
452        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
453        pub struct ConstraintSpan {
454            #[prost(uint64, tag = "1")]
455            pub begin: u64,
456            #[prost(uint64, tag = "2")]
457            pub end: u64,
458        }
459        /// Nested
460        #[derive(Clone, PartialEq, ::prost::Message)]
461        pub struct Or {
462            #[prost(uint32, repeated, tag = "1")]
463            pub branches: ::prost::alloc::vec::Vec<u32>,
464        }
465        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
466        pub struct Not {
467            #[prost(uint32, tag = "1")]
468            pub conjunction: u32,
469        }
470        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
471        pub struct Try {
472            #[prost(uint32, tag = "1")]
473            pub conjunction: u32,
474        }
475        /// Edges
476        #[derive(Clone, PartialEq, ::prost::Message)]
477        pub struct Isa {
478            #[prost(message, optional, tag = "1")]
479            pub instance: ::core::option::Option<super::ConstraintVertex>,
480            #[prost(message, optional, tag = "2")]
481            pub r#type: ::core::option::Option<super::ConstraintVertex>,
482            #[prost(enumeration = "ConstraintExactness", tag = "3")]
483            pub exactness: i32,
484        }
485        #[derive(Clone, PartialEq, ::prost::Message)]
486        pub struct Has {
487            #[prost(message, optional, tag = "1")]
488            pub owner: ::core::option::Option<super::ConstraintVertex>,
489            #[prost(message, optional, tag = "2")]
490            pub attribute: ::core::option::Option<super::ConstraintVertex>,
491            #[prost(enumeration = "ConstraintExactness", tag = "3")]
492            pub exactness: i32,
493        }
494        #[derive(Clone, PartialEq, ::prost::Message)]
495        pub struct Links {
496            #[prost(message, optional, tag = "1")]
497            pub relation: ::core::option::Option<super::ConstraintVertex>,
498            #[prost(message, optional, tag = "2")]
499            pub player: ::core::option::Option<super::ConstraintVertex>,
500            #[prost(message, optional, tag = "3")]
501            pub role: ::core::option::Option<super::ConstraintVertex>,
502            #[prost(enumeration = "ConstraintExactness", tag = "4")]
503            pub exactness: i32,
504        }
505        /// Type
506        #[derive(Clone, PartialEq, ::prost::Message)]
507        pub struct Kind {
508            #[prost(
509                enumeration = "super::super::concept_document::node::leaf::Kind",
510                tag = "1"
511            )]
512            pub kind: i32,
513            #[prost(message, optional, tag = "2")]
514            pub r#type: ::core::option::Option<super::ConstraintVertex>,
515        }
516        #[derive(Clone, PartialEq, ::prost::Message)]
517        pub struct Sub {
518            #[prost(message, optional, tag = "1")]
519            pub subtype: ::core::option::Option<super::ConstraintVertex>,
520            #[prost(message, optional, tag = "2")]
521            pub supertype: ::core::option::Option<super::ConstraintVertex>,
522            #[prost(enumeration = "ConstraintExactness", tag = "3")]
523            pub exactness: i32,
524        }
525        #[derive(Clone, PartialEq, ::prost::Message)]
526        pub struct Owns {
527            #[prost(message, optional, tag = "1")]
528            pub owner: ::core::option::Option<super::ConstraintVertex>,
529            #[prost(message, optional, tag = "2")]
530            pub attribute: ::core::option::Option<super::ConstraintVertex>,
531            #[prost(enumeration = "ConstraintExactness", tag = "3")]
532            pub exactness: i32,
533        }
534        #[derive(Clone, PartialEq, ::prost::Message)]
535        pub struct Relates {
536            #[prost(message, optional, tag = "1")]
537            pub relation: ::core::option::Option<super::ConstraintVertex>,
538            #[prost(message, optional, tag = "2")]
539            pub role: ::core::option::Option<super::ConstraintVertex>,
540            #[prost(enumeration = "ConstraintExactness", tag = "3")]
541            pub exactness: i32,
542        }
543        #[derive(Clone, PartialEq, ::prost::Message)]
544        pub struct Plays {
545            #[prost(message, optional, tag = "1")]
546            pub player: ::core::option::Option<super::ConstraintVertex>,
547            #[prost(message, optional, tag = "2")]
548            pub role: ::core::option::Option<super::ConstraintVertex>,
549            #[prost(enumeration = "ConstraintExactness", tag = "3")]
550            pub exactness: i32,
551        }
552        #[derive(Clone, PartialEq, ::prost::Message)]
553        pub struct Label {
554            #[prost(message, optional, tag = "1")]
555            pub r#type: ::core::option::Option<super::ConstraintVertex>,
556            #[prost(string, tag = "2")]
557            pub label: ::prost::alloc::string::String,
558        }
559        #[derive(Clone, PartialEq, ::prost::Message)]
560        pub struct Value {
561            #[prost(message, optional, tag = "1")]
562            pub attribute_type: ::core::option::Option<super::ConstraintVertex>,
563            #[prost(message, optional, tag = "2")]
564            pub value_type: ::core::option::Option<super::super::ValueType>,
565        }
566        /// Function
567        #[derive(Clone, PartialEq, ::prost::Message)]
568        pub struct Comparison {
569            #[prost(message, optional, tag = "1")]
570            pub lhs: ::core::option::Option<super::ConstraintVertex>,
571            #[prost(message, optional, tag = "2")]
572            pub rhs: ::core::option::Option<super::ConstraintVertex>,
573            #[prost(enumeration = "comparison::Comparator", tag = "3")]
574            pub comparator: i32,
575        }
576        /// Nested message and enum types in `Comparison`.
577        pub mod comparison {
578            #[derive(
579                Clone,
580                Copy,
581                Debug,
582                PartialEq,
583                Eq,
584                Hash,
585                PartialOrd,
586                Ord,
587                ::prost::Enumeration
588            )]
589            #[repr(i32)]
590            pub enum Comparator {
591                Equal = 0,
592                NotEqual = 1,
593                Less = 2,
594                Greater = 3,
595                LessOrEqual = 4,
596                GreaterOrEqual = 5,
597                Like = 6,
598                Contains = 7,
599            }
600            impl Comparator {
601                /// String value of the enum field names used in the ProtoBuf definition.
602                ///
603                /// The values are not transformed in any way and thus are considered stable
604                /// (if the ProtoBuf definition does not change) and safe for programmatic use.
605                pub fn as_str_name(&self) -> &'static str {
606                    match self {
607                        Self::Equal => "EQUAL",
608                        Self::NotEqual => "NOT_EQUAL",
609                        Self::Less => "LESS",
610                        Self::Greater => "GREATER",
611                        Self::LessOrEqual => "LESS_OR_EQUAL",
612                        Self::GreaterOrEqual => "GREATER_OR_EQUAL",
613                        Self::Like => "LIKE",
614                        Self::Contains => "CONTAINS",
615                    }
616                }
617                /// Creates an enum from field names used in the ProtoBuf definition.
618                pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
619                    match value {
620                        "EQUAL" => Some(Self::Equal),
621                        "NOT_EQUAL" => Some(Self::NotEqual),
622                        "LESS" => Some(Self::Less),
623                        "GREATER" => Some(Self::Greater),
624                        "LESS_OR_EQUAL" => Some(Self::LessOrEqual),
625                        "GREATER_OR_EQUAL" => Some(Self::GreaterOrEqual),
626                        "LIKE" => Some(Self::Like),
627                        "CONTAINS" => Some(Self::Contains),
628                        _ => None,
629                    }
630                }
631            }
632        }
633        #[derive(Clone, PartialEq, ::prost::Message)]
634        pub struct Expression {
635            #[prost(string, tag = "1")]
636            pub text: ::prost::alloc::string::String,
637            #[prost(message, optional, tag = "2")]
638            pub assigned: ::core::option::Option<super::ConstraintVertex>,
639            /// Treats constants as part of the text.
640            #[prost(message, repeated, tag = "3")]
641            pub arguments: ::prost::alloc::vec::Vec<super::ConstraintVertex>,
642        }
643        #[derive(Clone, PartialEq, ::prost::Message)]
644        pub struct FunctionCall {
645            #[prost(string, tag = "1")]
646            pub name: ::prost::alloc::string::String,
647            #[prost(message, repeated, tag = "2")]
648            pub assigned: ::prost::alloc::vec::Vec<super::ConstraintVertex>,
649            /// Include constants, since variables are schema-objects
650            #[prost(message, repeated, tag = "3")]
651            pub arguments: ::prost::alloc::vec::Vec<super::ConstraintVertex>,
652        }
653        /// Special
654        #[derive(Clone, PartialEq, ::prost::Message)]
655        pub struct Is {
656            #[prost(message, optional, tag = "1")]
657            pub lhs: ::core::option::Option<super::ConstraintVertex>,
658            #[prost(message, optional, tag = "2")]
659            pub rhs: ::core::option::Option<super::ConstraintVertex>,
660        }
661        #[derive(Clone, PartialEq, ::prost::Message)]
662        pub struct Iid {
663            #[prost(message, optional, tag = "1")]
664            pub concept: ::core::option::Option<super::ConstraintVertex>,
665            #[prost(bytes = "vec", tag = "2")]
666            pub iid: ::prost::alloc::vec::Vec<u8>,
667        }
668        #[derive(
669            Clone,
670            Copy,
671            Debug,
672            PartialEq,
673            Eq,
674            Hash,
675            PartialOrd,
676            Ord,
677            ::prost::Enumeration
678        )]
679        #[repr(i32)]
680        pub enum ConstraintExactness {
681            Exact = 0,
682            Subtypes = 1,
683        }
684        impl ConstraintExactness {
685            /// String value of the enum field names used in the ProtoBuf definition.
686            ///
687            /// The values are not transformed in any way and thus are considered stable
688            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
689            pub fn as_str_name(&self) -> &'static str {
690                match self {
691                    Self::Exact => "EXACT",
692                    Self::Subtypes => "SUBTYPES",
693                }
694            }
695            /// Creates an enum from field names used in the ProtoBuf definition.
696            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
697                match value {
698                    "EXACT" => Some(Self::Exact),
699                    "SUBTYPES" => Some(Self::Subtypes),
700                    _ => None,
701                }
702            }
703        }
704        #[derive(Clone, PartialEq, ::prost::Oneof)]
705        pub enum Constraint {
706            #[prost(message, tag = "2")]
707            Or(Or),
708            #[prost(message, tag = "3")]
709            Not(Not),
710            #[prost(message, tag = "4")]
711            Try(Try),
712            /// Data
713            #[prost(message, tag = "5")]
714            Isa(Isa),
715            #[prost(message, tag = "6")]
716            Has(Has),
717            #[prost(message, tag = "7")]
718            Links(Links),
719            /// Schema
720            #[prost(message, tag = "8")]
721            Kind(Kind),
722            #[prost(message, tag = "9")]
723            Sub(Sub),
724            #[prost(message, tag = "10")]
725            Owns(Owns),
726            #[prost(message, tag = "11")]
727            Relates(Relates),
728            #[prost(message, tag = "12")]
729            Plays(Plays),
730            #[prost(message, tag = "13")]
731            Value(Value),
732            #[prost(message, tag = "14")]
733            Label(Label),
734            /// Function
735            #[prost(message, tag = "15")]
736            Comparison(Comparison),
737            #[prost(message, tag = "16")]
738            Expression(Expression),
739            #[prost(message, tag = "17")]
740            FunctionCall(FunctionCall),
741            /// Special
742            #[prost(message, tag = "18")]
743            Is(Is),
744            #[prost(message, tag = "19")]
745            Iid(Iid),
746        }
747    }
748    #[derive(Clone, PartialEq, ::prost::Message)]
749    pub struct VariableAnnotations {
750        #[prost(bool, tag = "4")]
751        pub is_optional: bool,
752        #[prost(oneof = "variable_annotations::Annotations", tags = "1, 2, 3")]
753        pub annotations: ::core::option::Option<variable_annotations::Annotations>,
754    }
755    /// Nested message and enum types in `VariableAnnotations`.
756    pub mod variable_annotations {
757        #[derive(Clone, PartialEq, ::prost::Message)]
758        pub struct ConceptVariableAnnotations {
759            #[prost(message, repeated, tag = "1")]
760            pub types: ::prost::alloc::vec::Vec<super::super::Type>,
761        }
762        #[derive(Clone, PartialEq, ::prost::Oneof)]
763        pub enum Annotations {
764            #[prost(message, tag = "1")]
765            Instance(ConceptVariableAnnotations),
766            #[prost(message, tag = "2")]
767            Type(ConceptVariableAnnotations),
768            #[prost(message, tag = "3")]
769            ValueAnnotations(super::super::ValueType),
770        }
771    }
772}
773/// This is an emulation of the google ErrorDetails message. Generally, ErrorDetails are submitted via the GRPC error
774/// mechanism, but a manual error sending is useful to differentiate error levels in streams
775#[derive(Clone, PartialEq, ::prost::Message)]
776pub struct Error {
777    #[prost(string, tag = "1")]
778    pub error_code: ::prost::alloc::string::String,
779    #[prost(string, tag = "2")]
780    pub domain: ::prost::alloc::string::String,
781    #[prost(string, repeated, tag = "3")]
782    pub stack_trace: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
783}
784#[derive(Clone, Copy, PartialEq, ::prost::Message)]
785pub struct Options {}
786/// Nested message and enum types in `Options`.
787pub mod options {
788    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
789    pub struct Transaction {
790        #[prost(bool, optional, tag = "1")]
791        pub parallel: ::core::option::Option<bool>,
792        #[prost(uint64, optional, tag = "2")]
793        pub transaction_timeout_millis: ::core::option::Option<u64>,
794        #[prost(uint64, optional, tag = "3")]
795        pub schema_lock_acquire_timeout_millis: ::core::option::Option<u64>,
796    }
797    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
798    pub struct Query {
799        #[prost(bool, optional, tag = "1")]
800        pub include_instance_types: ::core::option::Option<bool>,
801        #[prost(uint64, optional, tag = "2")]
802        pub prefetch_size: ::core::option::Option<u64>,
803        #[prost(bool, optional, tag = "3")]
804        pub include_query_structure: ::core::option::Option<bool>,
805    }
806    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
807    pub struct Analyze {
808        #[prost(bool, optional, tag = "1")]
809        pub include_plan: ::core::option::Option<bool>,
810    }
811}
812#[derive(Clone, Copy, PartialEq, ::prost::Message)]
813pub struct Analyze {}
814/// Nested message and enum types in `Analyze`.
815pub mod analyze {
816    #[derive(Clone, PartialEq, ::prost::Message)]
817    pub struct Req {
818        #[prost(message, optional, tag = "1")]
819        pub options: ::core::option::Option<super::options::Analyze>,
820        #[prost(string, tag = "2")]
821        pub query: ::prost::alloc::string::String,
822    }
823    #[derive(Clone, PartialEq, ::prost::Message)]
824    pub struct Res {
825        #[prost(oneof = "res::Result", tags = "1, 2")]
826        pub result: ::core::option::Option<res::Result>,
827    }
828    /// Nested message and enum types in `Res`.
829    pub mod res {
830        #[derive(Clone, PartialEq, ::prost::Message)]
831        pub struct AnalyzedQuery {
832            #[prost(string, tag = "1")]
833            pub source: ::prost::alloc::string::String,
834            #[prost(message, optional, tag = "2")]
835            pub query: ::core::option::Option<analyzed_query::Pipeline>,
836            #[prost(message, repeated, tag = "3")]
837            pub preamble: ::prost::alloc::vec::Vec<analyzed_query::Function>,
838            #[prost(message, optional, tag = "4")]
839            pub fetch: ::core::option::Option<analyzed_query::Fetch>,
840        }
841        /// Nested message and enum types in `AnalyzedQuery`.
842        pub mod analyzed_query {
843            #[derive(Clone, PartialEq, ::prost::Message)]
844            pub struct Function {
845                #[prost(message, optional, tag = "1")]
846                pub body: ::core::option::Option<Pipeline>,
847                #[prost(message, repeated, tag = "2")]
848                pub arguments: ::prost::alloc::vec::Vec<
849                    super::super::super::analyzed_conjunction::Variable,
850                >,
851                #[prost(message, repeated, tag = "3")]
852                pub arguments_annotations: ::prost::alloc::vec::Vec<
853                    super::super::super::analyzed_conjunction::VariableAnnotations,
854                >,
855                #[prost(message, repeated, tag = "4")]
856                pub return_annotations: ::prost::alloc::vec::Vec<
857                    super::super::super::analyzed_conjunction::VariableAnnotations,
858                >,
859                #[prost(message, optional, tag = "5")]
860                pub return_operation: ::core::option::Option<function::ReturnOperation>,
861            }
862            /// Nested message and enum types in `Function`.
863            pub mod function {
864                #[derive(Clone, PartialEq, ::prost::Message)]
865                pub struct ReturnOperation {
866                    #[prost(
867                        oneof = "return_operation::ReturnOperation",
868                        tags = "1, 2, 3, 4"
869                    )]
870                    pub return_operation: ::core::option::Option<
871                        return_operation::ReturnOperation,
872                    >,
873                }
874                /// Nested message and enum types in `ReturnOperation`.
875                pub mod return_operation {
876                    #[derive(Clone, PartialEq, ::prost::Message)]
877                    pub struct ReturnOpStream {
878                        #[prost(message, repeated, tag = "1")]
879                        pub variables: ::prost::alloc::vec::Vec<
880                            super::super::super::super::super::analyzed_conjunction::Variable,
881                        >,
882                    }
883                    #[derive(Clone, PartialEq, ::prost::Message)]
884                    pub struct ReturnOpSingle {
885                        #[prost(string, tag = "1")]
886                        pub selector: ::prost::alloc::string::String,
887                        #[prost(message, repeated, tag = "2")]
888                        pub variables: ::prost::alloc::vec::Vec<
889                            super::super::super::super::super::analyzed_conjunction::Variable,
890                        >,
891                    }
892                    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
893                    pub struct ReturnOpCheck {}
894                    #[derive(Clone, PartialEq, ::prost::Message)]
895                    pub struct ReturnOpReduce {
896                        #[prost(message, repeated, tag = "1")]
897                        pub reducers: ::prost::alloc::vec::Vec<super::super::Reducer>,
898                    }
899                    #[derive(Clone, PartialEq, ::prost::Oneof)]
900                    pub enum ReturnOperation {
901                        #[prost(message, tag = "1")]
902                        Stream(ReturnOpStream),
903                        #[prost(message, tag = "2")]
904                        Single(ReturnOpSingle),
905                        #[prost(message, tag = "3")]
906                        Check(ReturnOpCheck),
907                        #[prost(message, tag = "4")]
908                        Reduce(ReturnOpReduce),
909                    }
910                }
911            }
912            #[derive(Clone, PartialEq, ::prost::Message)]
913            pub struct Pipeline {
914                #[prost(message, repeated, tag = "1")]
915                pub conjunctions: ::prost::alloc::vec::Vec<
916                    super::super::super::AnalyzedConjunction,
917                >,
918                #[prost(message, repeated, tag = "2")]
919                pub stages: ::prost::alloc::vec::Vec<pipeline::PipelineStage>,
920                #[prost(map = "uint32, message", tag = "3")]
921                pub variable_info: ::std::collections::HashMap<
922                    u32,
923                    pipeline::VariableInfo,
924                >,
925                #[prost(message, repeated, tag = "4")]
926                pub outputs: ::prost::alloc::vec::Vec<
927                    super::super::super::analyzed_conjunction::Variable,
928                >,
929            }
930            /// Nested message and enum types in `Pipeline`.
931            pub mod pipeline {
932                #[derive(Clone, PartialEq, ::prost::Message)]
933                pub struct VariableInfo {
934                    #[prost(string, tag = "1")]
935                    pub name: ::prost::alloc::string::String,
936                }
937                #[derive(Clone, PartialEq, ::prost::Message)]
938                pub struct PipelineStage {
939                    #[prost(
940                        oneof = "pipeline_stage::Stage",
941                        tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12"
942                    )]
943                    pub stage: ::core::option::Option<pipeline_stage::Stage>,
944                }
945                /// Nested message and enum types in `PipelineStage`.
946                pub mod pipeline_stage {
947                    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
948                    pub struct Match {
949                        #[prost(uint32, tag = "1")]
950                        pub block: u32,
951                    }
952                    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
953                    pub struct Insert {
954                        #[prost(uint32, tag = "1")]
955                        pub block: u32,
956                    }
957                    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
958                    pub struct Put {
959                        #[prost(uint32, tag = "1")]
960                        pub block: u32,
961                    }
962                    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
963                    pub struct Update {
964                        #[prost(uint32, tag = "1")]
965                        pub block: u32,
966                    }
967                    #[derive(Clone, PartialEq, ::prost::Message)]
968                    pub struct Delete {
969                        #[prost(uint32, tag = "1")]
970                        pub block: u32,
971                        #[prost(message, repeated, tag = "2")]
972                        pub deleted_variables: ::prost::alloc::vec::Vec<
973                            super::super::super::super::super::analyzed_conjunction::Variable,
974                        >,
975                    }
976                    #[derive(Clone, PartialEq, ::prost::Message)]
977                    pub struct Select {
978                        #[prost(message, repeated, tag = "1")]
979                        pub variables: ::prost::alloc::vec::Vec<
980                            super::super::super::super::super::analyzed_conjunction::Variable,
981                        >,
982                    }
983                    #[derive(Clone, PartialEq, ::prost::Message)]
984                    pub struct Sort {
985                        #[prost(message, repeated, tag = "1")]
986                        pub sort_variables: ::prost::alloc::vec::Vec<sort::SortVariable>,
987                    }
988                    /// Nested message and enum types in `Sort`.
989                    pub mod sort {
990                        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
991                        pub struct SortVariable {
992                            #[prost(message, optional, tag = "1")]
993                            pub variable: ::core::option::Option<
994                                super::super::super::super::super::super::analyzed_conjunction::Variable,
995                            >,
996                            #[prost(
997                                enumeration = "sort_variable::SortDirection",
998                                tag = "2"
999                            )]
1000                            pub direction: i32,
1001                        }
1002                        /// Nested message and enum types in `SortVariable`.
1003                        pub mod sort_variable {
1004                            #[derive(
1005                                Clone,
1006                                Copy,
1007                                Debug,
1008                                PartialEq,
1009                                Eq,
1010                                Hash,
1011                                PartialOrd,
1012                                Ord,
1013                                ::prost::Enumeration
1014                            )]
1015                            #[repr(i32)]
1016                            pub enum SortDirection {
1017                                Asc = 0,
1018                                Desc = 1,
1019                            }
1020                            impl SortDirection {
1021                                /// String value of the enum field names used in the ProtoBuf definition.
1022                                ///
1023                                /// The values are not transformed in any way and thus are considered stable
1024                                /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1025                                pub fn as_str_name(&self) -> &'static str {
1026                                    match self {
1027                                        Self::Asc => "ASC",
1028                                        Self::Desc => "DESC",
1029                                    }
1030                                }
1031                                /// Creates an enum from field names used in the ProtoBuf definition.
1032                                pub fn from_str_name(
1033                                    value: &str,
1034                                ) -> ::core::option::Option<Self> {
1035                                    match value {
1036                                        "ASC" => Some(Self::Asc),
1037                                        "DESC" => Some(Self::Desc),
1038                                        _ => None,
1039                                    }
1040                                }
1041                            }
1042                        }
1043                    }
1044                    #[derive(Clone, PartialEq, ::prost::Message)]
1045                    pub struct Require {
1046                        #[prost(message, repeated, tag = "1")]
1047                        pub variables: ::prost::alloc::vec::Vec<
1048                            super::super::super::super::super::analyzed_conjunction::Variable,
1049                        >,
1050                    }
1051                    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1052                    pub struct Offset {
1053                        #[prost(uint64, tag = "1")]
1054                        pub offset: u64,
1055                    }
1056                    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1057                    pub struct Limit {
1058                        #[prost(uint64, tag = "1")]
1059                        pub limit: u64,
1060                    }
1061                    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1062                    pub struct Distinct {}
1063                    #[derive(Clone, PartialEq, ::prost::Message)]
1064                    pub struct Reduce {
1065                        #[prost(message, repeated, tag = "1")]
1066                        pub reducers: ::prost::alloc::vec::Vec<reduce::ReduceAssign>,
1067                        #[prost(message, repeated, tag = "2")]
1068                        pub groupby: ::prost::alloc::vec::Vec<
1069                            super::super::super::super::super::analyzed_conjunction::Variable,
1070                        >,
1071                    }
1072                    /// Nested message and enum types in `Reduce`.
1073                    pub mod reduce {
1074                        #[derive(Clone, PartialEq, ::prost::Message)]
1075                        pub struct ReduceAssign {
1076                            #[prost(message, optional, tag = "1")]
1077                            pub assigned: ::core::option::Option<
1078                                super::super::super::super::super::super::analyzed_conjunction::Variable,
1079                            >,
1080                            #[prost(message, optional, tag = "2")]
1081                            pub reducer: ::core::option::Option<
1082                                super::super::super::Reducer,
1083                            >,
1084                        }
1085                    }
1086                    #[derive(Clone, PartialEq, ::prost::Oneof)]
1087                    pub enum Stage {
1088                        #[prost(message, tag = "1")]
1089                        Match(Match),
1090                        #[prost(message, tag = "2")]
1091                        Insert(Insert),
1092                        #[prost(message, tag = "3")]
1093                        Put(Put),
1094                        #[prost(message, tag = "4")]
1095                        Update(Update),
1096                        #[prost(message, tag = "5")]
1097                        Delete(Delete),
1098                        #[prost(message, tag = "6")]
1099                        Select(Select),
1100                        #[prost(message, tag = "7")]
1101                        Sort(Sort),
1102                        #[prost(message, tag = "8")]
1103                        Require(Require),
1104                        #[prost(message, tag = "9")]
1105                        Offset(Offset),
1106                        #[prost(message, tag = "10")]
1107                        Limit(Limit),
1108                        #[prost(message, tag = "11")]
1109                        Distinct(Distinct),
1110                        #[prost(message, tag = "12")]
1111                        Reduce(Reduce),
1112                    }
1113                }
1114            }
1115            #[derive(Clone, PartialEq, ::prost::Message)]
1116            pub struct Reducer {
1117                #[prost(string, tag = "1")]
1118                pub reducer: ::prost::alloc::string::String,
1119                #[prost(message, repeated, tag = "2")]
1120                pub variables: ::prost::alloc::vec::Vec<
1121                    super::super::super::analyzed_conjunction::Variable,
1122                >,
1123            }
1124            #[derive(Clone, PartialEq, ::prost::Message)]
1125            pub struct Fetch {
1126                #[prost(oneof = "fetch::Node", tags = "1, 2, 3")]
1127                pub node: ::core::option::Option<fetch::Node>,
1128            }
1129            /// Nested message and enum types in `Fetch`.
1130            pub mod fetch {
1131                #[derive(Clone, PartialEq, ::prost::Message)]
1132                pub struct Object {
1133                    #[prost(map = "string, message", tag = "1")]
1134                    pub fetch: ::std::collections::HashMap<
1135                        ::prost::alloc::string::String,
1136                        super::Fetch,
1137                    >,
1138                }
1139                #[derive(Clone, PartialEq, ::prost::Message)]
1140                pub struct Leaf {
1141                    #[prost(message, repeated, tag = "1")]
1142                    pub annotations: ::prost::alloc::vec::Vec<
1143                        super::super::super::super::ValueType,
1144                    >,
1145                }
1146                #[derive(Clone, PartialEq, ::prost::Oneof)]
1147                pub enum Node {
1148                    #[prost(message, tag = "1")]
1149                    Object(Object),
1150                    #[prost(message, tag = "2")]
1151                    List(::prost::alloc::boxed::Box<super::Fetch>),
1152                    #[prost(message, tag = "3")]
1153                    Leaf(Leaf),
1154                }
1155            }
1156        }
1157        #[derive(Clone, PartialEq, ::prost::Oneof)]
1158        pub enum Result {
1159            #[prost(message, tag = "1")]
1160            Err(super::super::Error),
1161            #[prost(message, tag = "2")]
1162            Ok(AnalyzedQuery),
1163        }
1164    }
1165}
1166#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1167pub struct Authentication {}
1168/// Nested message and enum types in `Authentication`.
1169pub mod authentication {
1170    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1171    pub struct Token {}
1172    /// Nested message and enum types in `Token`.
1173    pub mod token {
1174        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1175        pub struct Create {}
1176        /// Nested message and enum types in `Create`.
1177        pub mod create {
1178            #[derive(Clone, PartialEq, ::prost::Message)]
1179            pub struct Req {
1180                #[prost(oneof = "req::Credentials", tags = "1")]
1181                pub credentials: ::core::option::Option<req::Credentials>,
1182            }
1183            /// Nested message and enum types in `Req`.
1184            pub mod req {
1185                #[derive(Clone, PartialEq, ::prost::Message)]
1186                pub struct Password {
1187                    #[prost(string, tag = "1")]
1188                    pub username: ::prost::alloc::string::String,
1189                    #[prost(string, tag = "2")]
1190                    pub password: ::prost::alloc::string::String,
1191                }
1192                #[derive(Clone, PartialEq, ::prost::Oneof)]
1193                pub enum Credentials {
1194                    /// extend by other credential kinds
1195                    #[prost(message, tag = "1")]
1196                    Password(Password),
1197                }
1198            }
1199            #[derive(Clone, PartialEq, ::prost::Message)]
1200            pub struct Res {
1201                #[prost(string, tag = "1")]
1202                pub token: ::prost::alloc::string::String,
1203            }
1204        }
1205    }
1206}
1207#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1208pub struct Migration {}
1209/// Nested message and enum types in `Migration`.
1210pub mod migration {
1211    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1212    pub struct Export {}
1213    /// Nested message and enum types in `Export`.
1214    pub mod export {
1215        #[derive(Clone, PartialEq, ::prost::Message)]
1216        pub struct Req {
1217            #[prost(string, tag = "1")]
1218            pub name: ::prost::alloc::string::String,
1219        }
1220        #[derive(Clone, PartialEq, ::prost::Message)]
1221        pub struct Server {
1222            #[prost(oneof = "server::Server", tags = "1, 2, 3")]
1223            pub server: ::core::option::Option<server::Server>,
1224        }
1225        /// Nested message and enum types in `Server`.
1226        pub mod server {
1227            #[derive(Clone, PartialEq, ::prost::Oneof)]
1228            pub enum Server {
1229                #[prost(message, tag = "1")]
1230                InitialRes(super::InitialRes),
1231                #[prost(message, tag = "2")]
1232                ResPart(super::ResPart),
1233                #[prost(message, tag = "3")]
1234                Done(super::Done),
1235            }
1236        }
1237        #[derive(Clone, PartialEq, ::prost::Message)]
1238        pub struct InitialRes {
1239            #[prost(string, tag = "1")]
1240            pub schema: ::prost::alloc::string::String,
1241        }
1242        #[derive(Clone, PartialEq, ::prost::Message)]
1243        pub struct ResPart {
1244            #[prost(message, repeated, tag = "1")]
1245            pub items: ::prost::alloc::vec::Vec<super::Item>,
1246        }
1247        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1248        pub struct Done {}
1249    }
1250    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1251    pub struct Import {}
1252    /// Nested message and enum types in `Import`.
1253    pub mod import {
1254        #[derive(Clone, PartialEq, ::prost::Message)]
1255        pub struct Client {
1256            #[prost(oneof = "client::Client", tags = "1, 2, 3")]
1257            pub client: ::core::option::Option<client::Client>,
1258        }
1259        /// Nested message and enum types in `Client`.
1260        pub mod client {
1261            #[derive(Clone, PartialEq, ::prost::Message)]
1262            pub struct InitialReq {
1263                #[prost(string, tag = "1")]
1264                pub name: ::prost::alloc::string::String,
1265                #[prost(string, tag = "2")]
1266                pub schema: ::prost::alloc::string::String,
1267            }
1268            #[derive(Clone, PartialEq, ::prost::Message)]
1269            pub struct ReqPart {
1270                #[prost(message, repeated, tag = "1")]
1271                pub items: ::prost::alloc::vec::Vec<super::super::Item>,
1272            }
1273            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1274            pub struct Done {}
1275            #[derive(Clone, PartialEq, ::prost::Oneof)]
1276            pub enum Client {
1277                #[prost(message, tag = "1")]
1278                InitialReq(InitialReq),
1279                #[prost(message, tag = "2")]
1280                ReqPart(ReqPart),
1281                #[prost(message, tag = "3")]
1282                Done(Done),
1283            }
1284        }
1285        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1286        pub struct Server {
1287            #[prost(message, optional, tag = "1")]
1288            pub done: ::core::option::Option<server::Done>,
1289        }
1290        /// Nested message and enum types in `Server`.
1291        pub mod server {
1292            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1293            pub struct Done {}
1294        }
1295    }
1296    #[derive(Clone, PartialEq, ::prost::Message)]
1297    pub struct Item {
1298        #[prost(oneof = "item::Item", tags = "1, 2, 3, 15, 16")]
1299        pub item: ::core::option::Option<item::Item>,
1300    }
1301    /// Nested message and enum types in `Item`.
1302    pub mod item {
1303        #[derive(Clone, PartialEq, ::prost::Message)]
1304        pub struct Entity {
1305            #[prost(string, tag = "1")]
1306            pub id: ::prost::alloc::string::String,
1307            #[prost(string, tag = "2")]
1308            pub label: ::prost::alloc::string::String,
1309            #[prost(message, repeated, tag = "3")]
1310            pub attributes: ::prost::alloc::vec::Vec<OwnedAttribute>,
1311        }
1312        #[derive(Clone, PartialEq, ::prost::Message)]
1313        pub struct Attribute {
1314            #[prost(string, tag = "1")]
1315            pub id: ::prost::alloc::string::String,
1316            #[prost(string, tag = "2")]
1317            pub label: ::prost::alloc::string::String,
1318            /// empty in 3.x, used for backwards compatibility
1319            #[prost(message, repeated, tag = "3")]
1320            pub attributes: ::prost::alloc::vec::Vec<OwnedAttribute>,
1321            #[prost(message, optional, tag = "4")]
1322            pub value: ::core::option::Option<super::MigrationValue>,
1323        }
1324        #[derive(Clone, PartialEq, ::prost::Message)]
1325        pub struct Relation {
1326            #[prost(string, tag = "1")]
1327            pub id: ::prost::alloc::string::String,
1328            #[prost(string, tag = "2")]
1329            pub label: ::prost::alloc::string::String,
1330            #[prost(message, repeated, tag = "3")]
1331            pub attributes: ::prost::alloc::vec::Vec<OwnedAttribute>,
1332            #[prost(message, repeated, tag = "4")]
1333            pub roles: ::prost::alloc::vec::Vec<relation::Role>,
1334        }
1335        /// Nested message and enum types in `Relation`.
1336        pub mod relation {
1337            #[derive(Clone, PartialEq, ::prost::Message)]
1338            pub struct Role {
1339                #[prost(string, tag = "1")]
1340                pub label: ::prost::alloc::string::String,
1341                #[prost(message, repeated, tag = "2")]
1342                pub players: ::prost::alloc::vec::Vec<role::Player>,
1343            }
1344            /// Nested message and enum types in `Role`.
1345            pub mod role {
1346                #[derive(Clone, PartialEq, ::prost::Message)]
1347                pub struct Player {
1348                    #[prost(string, tag = "1")]
1349                    pub id: ::prost::alloc::string::String,
1350                }
1351            }
1352        }
1353        #[derive(Clone, PartialEq, ::prost::Message)]
1354        pub struct OwnedAttribute {
1355            #[prost(string, tag = "1")]
1356            pub id: ::prost::alloc::string::String,
1357        }
1358        #[derive(Clone, PartialEq, ::prost::Message)]
1359        pub struct Header {
1360            #[prost(string, tag = "1")]
1361            pub typedb_version: ::prost::alloc::string::String,
1362            #[prost(string, tag = "2")]
1363            pub original_database: ::prost::alloc::string::String,
1364        }
1365        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1366        pub struct Checksums {
1367            #[prost(int64, tag = "1")]
1368            pub entity_count: i64,
1369            #[prost(int64, tag = "2")]
1370            pub attribute_count: i64,
1371            #[prost(int64, tag = "3")]
1372            pub relation_count: i64,
1373            #[prost(int64, tag = "4")]
1374            pub role_count: i64,
1375            #[prost(int64, tag = "5")]
1376            pub ownership_count: i64,
1377        }
1378        #[derive(Clone, PartialEq, ::prost::Oneof)]
1379        pub enum Item {
1380            #[prost(message, tag = "1")]
1381            Attribute(Attribute),
1382            #[prost(message, tag = "2")]
1383            Entity(Entity),
1384            #[prost(message, tag = "3")]
1385            Relation(Relation),
1386            #[prost(message, tag = "15")]
1387            Header(Header),
1388            #[prost(message, tag = "16")]
1389            Checksums(Checksums),
1390        }
1391    }
1392    #[derive(Clone, PartialEq, ::prost::Message)]
1393    pub struct MigrationValue {
1394        #[prost(
1395            oneof = "migration_value::Value",
1396            tags = "1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12"
1397        )]
1398        pub value: ::core::option::Option<migration_value::Value>,
1399    }
1400    /// Nested message and enum types in `MigrationValue`.
1401    pub mod migration_value {
1402        #[derive(Clone, PartialEq, ::prost::Oneof)]
1403        pub enum Value {
1404            #[prost(string, tag = "1")]
1405            String(::prost::alloc::string::String),
1406            #[prost(bool, tag = "2")]
1407            Boolean(bool),
1408            #[prost(int64, tag = "3")]
1409            Integer(i64),
1410            #[prost(double, tag = "4")]
1411            Double(f64),
1412            /// compatibility with 2.x, milliseconds since epoch
1413            #[prost(int64, tag = "5")]
1414            DatetimeMillis(i64),
1415            #[prost(message, tag = "6")]
1416            Decimal(super::super::value::Decimal),
1417            #[prost(message, tag = "8")]
1418            Date(super::super::value::Date),
1419            #[prost(message, tag = "9")]
1420            Datetime(super::super::value::Datetime),
1421            #[prost(message, tag = "10")]
1422            DatetimeTz(super::super::value::DatetimeTz),
1423            #[prost(message, tag = "11")]
1424            Duration(super::super::value::Duration),
1425            #[prost(message, tag = "12")]
1426            Struct(super::super::value::Struct),
1427        }
1428    }
1429}
1430#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1431pub struct DatabaseManager {}
1432/// Nested message and enum types in `DatabaseManager`.
1433pub mod database_manager {
1434    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1435    pub struct Get {}
1436    /// Nested message and enum types in `Get`.
1437    pub mod get {
1438        #[derive(Clone, PartialEq, ::prost::Message)]
1439        pub struct Req {
1440            #[prost(string, tag = "1")]
1441            pub name: ::prost::alloc::string::String,
1442        }
1443        #[derive(Clone, PartialEq, ::prost::Message)]
1444        pub struct Res {
1445            #[prost(message, optional, tag = "1")]
1446            pub database: ::core::option::Option<super::super::Database>,
1447        }
1448    }
1449    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1450    pub struct All {}
1451    /// Nested message and enum types in `All`.
1452    pub mod all {
1453        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1454        pub struct Req {}
1455        #[derive(Clone, PartialEq, ::prost::Message)]
1456        pub struct Res {
1457            #[prost(message, repeated, tag = "1")]
1458            pub databases: ::prost::alloc::vec::Vec<super::super::Database>,
1459        }
1460    }
1461    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1462    pub struct Contains {}
1463    /// Nested message and enum types in `Contains`.
1464    pub mod contains {
1465        #[derive(Clone, PartialEq, ::prost::Message)]
1466        pub struct Req {
1467            #[prost(string, tag = "1")]
1468            pub name: ::prost::alloc::string::String,
1469        }
1470        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1471        pub struct Res {
1472            #[prost(bool, tag = "1")]
1473            pub contains: bool,
1474        }
1475    }
1476    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1477    pub struct Create {}
1478    /// Nested message and enum types in `Create`.
1479    pub mod create {
1480        #[derive(Clone, PartialEq, ::prost::Message)]
1481        pub struct Req {
1482            #[prost(string, tag = "1")]
1483            pub name: ::prost::alloc::string::String,
1484        }
1485        #[derive(Clone, PartialEq, ::prost::Message)]
1486        pub struct Res {
1487            #[prost(message, optional, tag = "1")]
1488            pub database: ::core::option::Option<super::super::Database>,
1489        }
1490    }
1491    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1492    pub struct Import {}
1493    /// Nested message and enum types in `Import`.
1494    pub mod import {
1495        #[derive(Clone, PartialEq, ::prost::Message)]
1496        pub struct Client {
1497            #[prost(message, optional, tag = "1")]
1498            pub client: ::core::option::Option<super::super::migration::import::Client>,
1499        }
1500        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1501        pub struct Server {
1502            #[prost(message, optional, tag = "1")]
1503            pub server: ::core::option::Option<super::super::migration::import::Server>,
1504        }
1505    }
1506}
1507#[derive(Clone, PartialEq, ::prost::Message)]
1508pub struct Database {
1509    #[prost(string, tag = "1")]
1510    pub name: ::prost::alloc::string::String,
1511}
1512/// Nested message and enum types in `Database`.
1513pub mod database {
1514    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1515    pub struct Schema {}
1516    /// Nested message and enum types in `Schema`.
1517    pub mod schema {
1518        #[derive(Clone, PartialEq, ::prost::Message)]
1519        pub struct Req {
1520            #[prost(string, tag = "1")]
1521            pub name: ::prost::alloc::string::String,
1522        }
1523        #[derive(Clone, PartialEq, ::prost::Message)]
1524        pub struct Res {
1525            #[prost(string, tag = "1")]
1526            pub schema: ::prost::alloc::string::String,
1527        }
1528    }
1529    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1530    pub struct TypeSchema {}
1531    /// Nested message and enum types in `TypeSchema`.
1532    pub mod type_schema {
1533        #[derive(Clone, PartialEq, ::prost::Message)]
1534        pub struct Req {
1535            #[prost(string, tag = "1")]
1536            pub name: ::prost::alloc::string::String,
1537        }
1538        #[derive(Clone, PartialEq, ::prost::Message)]
1539        pub struct Res {
1540            #[prost(string, tag = "1")]
1541            pub schema: ::prost::alloc::string::String,
1542        }
1543    }
1544    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1545    pub struct Export {}
1546    /// Nested message and enum types in `Export`.
1547    pub mod export {
1548        #[derive(Clone, PartialEq, ::prost::Message)]
1549        pub struct Req {
1550            #[prost(message, optional, tag = "1")]
1551            pub req: ::core::option::Option<super::super::migration::export::Req>,
1552        }
1553        #[derive(Clone, PartialEq, ::prost::Message)]
1554        pub struct Server {
1555            #[prost(message, optional, tag = "1")]
1556            pub server: ::core::option::Option<super::super::migration::export::Server>,
1557        }
1558    }
1559    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1560    pub struct Delete {}
1561    /// Nested message and enum types in `Delete`.
1562    pub mod delete {
1563        #[derive(Clone, PartialEq, ::prost::Message)]
1564        pub struct Req {
1565            #[prost(string, tag = "1")]
1566            pub name: ::prost::alloc::string::String,
1567        }
1568        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1569        pub struct Res {}
1570    }
1571}
1572#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1573pub struct ServerManager {}
1574/// Nested message and enum types in `ServerManager`.
1575pub mod server_manager {
1576    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1577    pub struct All {}
1578    /// Nested message and enum types in `All`.
1579    pub mod all {
1580        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1581        pub struct Req {}
1582        #[derive(Clone, PartialEq, ::prost::Message)]
1583        pub struct Res {
1584            #[prost(message, repeated, tag = "1")]
1585            pub servers: ::prost::alloc::vec::Vec<super::super::Server>,
1586        }
1587    }
1588    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1589    pub struct Get {}
1590    /// Nested message and enum types in `Get`.
1591    pub mod get {
1592        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1593        pub struct Req {}
1594        #[derive(Clone, PartialEq, ::prost::Message)]
1595        pub struct Res {
1596            #[prost(message, optional, tag = "1")]
1597            pub server: ::core::option::Option<super::super::Server>,
1598        }
1599    }
1600}
1601#[derive(Clone, PartialEq, ::prost::Message)]
1602pub struct Server {
1603    #[prost(string, optional, tag = "1")]
1604    pub address: ::core::option::Option<::prost::alloc::string::String>,
1605    #[prost(message, optional, tag = "2")]
1606    pub replication_status: ::core::option::Option<server::ReplicationStatus>,
1607}
1608/// Nested message and enum types in `Server`.
1609pub mod server {
1610    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1611    pub struct ReplicationStatus {
1612        #[prost(uint64, tag = "1")]
1613        pub id: u64,
1614        #[prost(enumeration = "replication_status::Role", optional, tag = "2")]
1615        pub role: ::core::option::Option<i32>,
1616        #[prost(uint64, optional, tag = "3")]
1617        pub term: ::core::option::Option<u64>,
1618    }
1619    /// Nested message and enum types in `ReplicationStatus`.
1620    pub mod replication_status {
1621        #[derive(
1622            Clone,
1623            Copy,
1624            Debug,
1625            PartialEq,
1626            Eq,
1627            Hash,
1628            PartialOrd,
1629            Ord,
1630            ::prost::Enumeration
1631        )]
1632        #[repr(i32)]
1633        pub enum Role {
1634            Primary = 0,
1635            Candidate = 1,
1636            Secondary = 2,
1637        }
1638        impl Role {
1639            /// String value of the enum field names used in the ProtoBuf definition.
1640            ///
1641            /// The values are not transformed in any way and thus are considered stable
1642            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1643            pub fn as_str_name(&self) -> &'static str {
1644                match self {
1645                    Self::Primary => "Primary",
1646                    Self::Candidate => "Candidate",
1647                    Self::Secondary => "Secondary",
1648                }
1649            }
1650            /// Creates an enum from field names used in the ProtoBuf definition.
1651            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1652                match value {
1653                    "Primary" => Some(Self::Primary),
1654                    "Candidate" => Some(Self::Candidate),
1655                    "Secondary" => Some(Self::Secondary),
1656                    _ => None,
1657                }
1658            }
1659        }
1660    }
1661    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1662    pub struct Version {}
1663    /// Nested message and enum types in `Version`.
1664    pub mod version {
1665        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1666        pub struct Req {}
1667        #[derive(Clone, PartialEq, ::prost::Message)]
1668        pub struct Res {
1669            #[prost(string, tag = "1")]
1670            pub distribution: ::prost::alloc::string::String,
1671            #[prost(string, tag = "2")]
1672            pub version: ::prost::alloc::string::String,
1673        }
1674    }
1675}
1676#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1677#[repr(i32)]
1678pub enum Version {
1679    Unspecified = 0,
1680    Version = 8,
1681}
1682impl Version {
1683    /// String value of the enum field names used in the ProtoBuf definition.
1684    ///
1685    /// The values are not transformed in any way and thus are considered stable
1686    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1687    pub fn as_str_name(&self) -> &'static str {
1688        match self {
1689            Self::Unspecified => "UNSPECIFIED",
1690            Self::Version => "VERSION",
1691        }
1692    }
1693    /// Creates an enum from field names used in the ProtoBuf definition.
1694    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1695        match value {
1696            "UNSPECIFIED" => Some(Self::Unspecified),
1697            "VERSION" => Some(Self::Version),
1698            _ => None,
1699        }
1700    }
1701}
1702#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1703#[repr(i32)]
1704pub enum ExtensionVersion {
1705    UnspecifiedExtension = 0,
1706    /// Reserving makes little sense here.
1707    Extension = 1,
1708}
1709impl ExtensionVersion {
1710    /// String value of the enum field names used in the ProtoBuf definition.
1711    ///
1712    /// The values are not transformed in any way and thus are considered stable
1713    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1714    pub fn as_str_name(&self) -> &'static str {
1715        match self {
1716            Self::UnspecifiedExtension => "UNSPECIFIED_EXTENSION",
1717            Self::Extension => "EXTENSION",
1718        }
1719    }
1720    /// Creates an enum from field names used in the ProtoBuf definition.
1721    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1722        match value {
1723            "UNSPECIFIED_EXTENSION" => Some(Self::UnspecifiedExtension),
1724            "EXTENSION" => Some(Self::Extension),
1725            _ => None,
1726        }
1727    }
1728}
1729#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1730pub struct Connection {}
1731/// Nested message and enum types in `Connection`.
1732pub mod connection {
1733    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1734    pub struct Open {}
1735    /// Nested message and enum types in `Open`.
1736    pub mod open {
1737        #[derive(Clone, PartialEq, ::prost::Message)]
1738        pub struct Req {
1739            #[prost(enumeration = "super::super::Version", tag = "1")]
1740            pub version: i32,
1741            #[prost(enumeration = "super::super::ExtensionVersion", tag = "5")]
1742            pub extension_version: i32,
1743            #[prost(string, tag = "2")]
1744            pub driver_lang: ::prost::alloc::string::String,
1745            #[prost(string, tag = "3")]
1746            pub driver_version: ::prost::alloc::string::String,
1747            #[prost(message, optional, tag = "4")]
1748            pub authentication: ::core::option::Option<
1749                super::super::authentication::token::create::Req,
1750            >,
1751        }
1752        #[derive(Clone, PartialEq, ::prost::Message)]
1753        pub struct Res {
1754            #[prost(uint64, tag = "1")]
1755            pub server_duration_millis: u64,
1756            #[prost(message, optional, tag = "2")]
1757            pub connection_id: ::core::option::Option<super::super::ConnectionId>,
1758            #[prost(message, optional, tag = "3")]
1759            pub servers_all: ::core::option::Option<
1760                super::super::server_manager::all::Res,
1761            >,
1762            #[prost(message, optional, tag = "4")]
1763            pub authentication: ::core::option::Option<
1764                super::super::authentication::token::create::Res,
1765            >,
1766        }
1767    }
1768}
1769#[derive(Clone, PartialEq, ::prost::Message)]
1770pub struct ConnectionId {
1771    #[prost(bytes = "vec", tag = "1")]
1772    pub id: ::prost::alloc::vec::Vec<u8>,
1773}
1774#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1775pub struct Query {}
1776/// Nested message and enum types in `Query`.
1777pub mod query {
1778    #[derive(Clone, PartialEq, ::prost::Message)]
1779    pub struct Req {
1780        #[prost(message, optional, tag = "1")]
1781        pub options: ::core::option::Option<super::options::Query>,
1782        #[prost(string, tag = "2")]
1783        pub query: ::prost::alloc::string::String,
1784    }
1785    #[derive(Clone, PartialEq, ::prost::Message)]
1786    pub struct InitialRes {
1787        #[prost(oneof = "initial_res::Res", tags = "1, 2")]
1788        pub res: ::core::option::Option<initial_res::Res>,
1789    }
1790    /// Nested message and enum types in `InitialRes`.
1791    pub mod initial_res {
1792        #[derive(Clone, PartialEq, ::prost::Message)]
1793        pub struct Ok {
1794            #[prost(oneof = "ok::Ok", tags = "1, 3, 4")]
1795            pub ok: ::core::option::Option<ok::Ok>,
1796        }
1797        /// Nested message and enum types in `Ok`.
1798        pub mod ok {
1799            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1800            pub struct Done {
1801                #[prost(enumeration = "super::super::Type", tag = "1")]
1802                pub query_type: i32,
1803            }
1804            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1805            pub struct ConceptDocumentStream {
1806                /// note: we could use this first response to record debug info, type annotations, warnings, etc
1807                /// TODO: network optimisation: replace keys with IDs, sending keys in the header to rebuild the document on the client side
1808                /// TODO: network optimisation: replace types (== mostly constant strings) with a IDs, sending types in the header to rebuild on the client side
1809                #[prost(enumeration = "super::super::Type", tag = "2")]
1810                pub query_type: i32,
1811            }
1812            #[derive(Clone, PartialEq, ::prost::Message)]
1813            pub struct ConceptRowStream {
1814                /// TODO: network optimisation: replace types (== mostly constant strings) with a IDs, sending types in the header to rebuild on the client side
1815                #[prost(string, repeated, tag = "1")]
1816                pub column_variable_names: ::prost::alloc::vec::Vec<
1817                    ::prost::alloc::string::String,
1818                >,
1819                #[prost(enumeration = "super::super::Type", tag = "2")]
1820                pub query_type: i32,
1821                #[prost(message, optional, tag = "3")]
1822                pub query_structure: ::core::option::Option<
1823                    super::super::super::analyze::res::analyzed_query::Pipeline,
1824                >,
1825            }
1826            #[derive(Clone, PartialEq, ::prost::Oneof)]
1827            pub enum Ok {
1828                #[prost(message, tag = "1")]
1829                Done(Done),
1830                #[prost(message, tag = "3")]
1831                ConceptDocumentStream(ConceptDocumentStream),
1832                #[prost(message, tag = "4")]
1833                ConceptRowStream(ConceptRowStream),
1834            }
1835        }
1836        #[derive(Clone, PartialEq, ::prost::Oneof)]
1837        pub enum Res {
1838            #[prost(message, tag = "1")]
1839            Error(super::super::Error),
1840            #[prost(message, tag = "2")]
1841            Ok(Ok),
1842        }
1843    }
1844    #[derive(Clone, PartialEq, ::prost::Message)]
1845    pub struct ResPart {
1846        #[prost(oneof = "res_part::Res", tags = "1, 2")]
1847        pub res: ::core::option::Option<res_part::Res>,
1848    }
1849    /// Nested message and enum types in `ResPart`.
1850    pub mod res_part {
1851        #[derive(Clone, PartialEq, ::prost::Message)]
1852        pub struct ConceptDocumentsRes {
1853            #[prost(message, repeated, tag = "1")]
1854            pub documents: ::prost::alloc::vec::Vec<super::super::ConceptDocument>,
1855        }
1856        #[derive(Clone, PartialEq, ::prost::Message)]
1857        pub struct ConceptRowsRes {
1858            #[prost(message, repeated, tag = "1")]
1859            pub rows: ::prost::alloc::vec::Vec<super::super::ConceptRow>,
1860        }
1861        #[derive(Clone, PartialEq, ::prost::Oneof)]
1862        pub enum Res {
1863            #[prost(message, tag = "1")]
1864            DocumentsRes(ConceptDocumentsRes),
1865            #[prost(message, tag = "2")]
1866            RowsRes(ConceptRowsRes),
1867        }
1868    }
1869    #[derive(
1870        Clone,
1871        Copy,
1872        Debug,
1873        PartialEq,
1874        Eq,
1875        Hash,
1876        PartialOrd,
1877        Ord,
1878        ::prost::Enumeration
1879    )]
1880    #[repr(i32)]
1881    pub enum Type {
1882        Read = 0,
1883        Write = 1,
1884        Schema = 2,
1885    }
1886    impl Type {
1887        /// String value of the enum field names used in the ProtoBuf definition.
1888        ///
1889        /// The values are not transformed in any way and thus are considered stable
1890        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1891        pub fn as_str_name(&self) -> &'static str {
1892            match self {
1893                Self::Read => "READ",
1894                Self::Write => "WRITE",
1895                Self::Schema => "SCHEMA",
1896            }
1897        }
1898        /// Creates an enum from field names used in the ProtoBuf definition.
1899        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1900            match value {
1901                "READ" => Some(Self::Read),
1902                "WRITE" => Some(Self::Write),
1903                "SCHEMA" => Some(Self::Schema),
1904                _ => None,
1905            }
1906        }
1907    }
1908}
1909#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1910pub struct Transaction {}
1911/// Nested message and enum types in `Transaction`.
1912pub mod transaction {
1913    #[derive(Clone, PartialEq, ::prost::Message)]
1914    pub struct Client {
1915        #[prost(message, repeated, tag = "1")]
1916        pub reqs: ::prost::alloc::vec::Vec<Req>,
1917    }
1918    #[derive(Clone, PartialEq, ::prost::Message)]
1919    pub struct Server {
1920        #[prost(oneof = "server::Server", tags = "1, 2")]
1921        pub server: ::core::option::Option<server::Server>,
1922    }
1923    /// Nested message and enum types in `Server`.
1924    pub mod server {
1925        #[derive(Clone, PartialEq, ::prost::Oneof)]
1926        pub enum Server {
1927            #[prost(message, tag = "1")]
1928            Res(super::Res),
1929            #[prost(message, tag = "2")]
1930            ResPart(super::ResPart),
1931        }
1932    }
1933    #[derive(Clone, PartialEq, ::prost::Message)]
1934    pub struct Req {
1935        #[prost(bytes = "vec", tag = "1")]
1936        pub req_id: ::prost::alloc::vec::Vec<u8>,
1937        #[prost(map = "string, string", tag = "2")]
1938        pub metadata: ::std::collections::HashMap<
1939            ::prost::alloc::string::String,
1940            ::prost::alloc::string::String,
1941        >,
1942        #[prost(oneof = "req::Req", tags = "3, 4, 5, 6, 7, 8, 9")]
1943        pub req: ::core::option::Option<req::Req>,
1944    }
1945    /// Nested message and enum types in `Req`.
1946    pub mod req {
1947        #[derive(Clone, PartialEq, ::prost::Oneof)]
1948        pub enum Req {
1949            #[prost(message, tag = "3")]
1950            OpenReq(super::open::Req),
1951            #[prost(message, tag = "4")]
1952            QueryReq(super::super::query::Req),
1953            #[prost(message, tag = "5")]
1954            StreamReq(super::stream_signal::Req),
1955            #[prost(message, tag = "6")]
1956            CommitReq(super::commit::Req),
1957            #[prost(message, tag = "7")]
1958            RollbackReq(super::rollback::Req),
1959            #[prost(message, tag = "8")]
1960            CloseReq(super::close::Req),
1961            #[prost(message, tag = "9")]
1962            AnalyzeReq(super::super::analyze::Req),
1963        }
1964    }
1965    #[derive(Clone, PartialEq, ::prost::Message)]
1966    pub struct Res {
1967        #[prost(bytes = "vec", tag = "1")]
1968        pub req_id: ::prost::alloc::vec::Vec<u8>,
1969        #[prost(oneof = "res::Res", tags = "2, 3, 5, 6, 9")]
1970        pub res: ::core::option::Option<res::Res>,
1971    }
1972    /// Nested message and enum types in `Res`.
1973    pub mod res {
1974        #[derive(Clone, PartialEq, ::prost::Oneof)]
1975        pub enum Res {
1976            #[prost(message, tag = "2")]
1977            OpenRes(super::open::Res),
1978            #[prost(message, tag = "3")]
1979            QueryInitialRes(super::super::query::InitialRes),
1980            #[prost(message, tag = "5")]
1981            CommitRes(super::commit::Res),
1982            #[prost(message, tag = "6")]
1983            RollbackRes(super::rollback::Res),
1984            #[prost(message, tag = "9")]
1985            AnalyzeRes(super::super::analyze::Res),
1986        }
1987    }
1988    #[derive(Clone, PartialEq, ::prost::Message)]
1989    pub struct ResPart {
1990        #[prost(bytes = "vec", tag = "1")]
1991        pub req_id: ::prost::alloc::vec::Vec<u8>,
1992        #[prost(oneof = "res_part::ResPart", tags = "2, 3")]
1993        pub res_part: ::core::option::Option<res_part::ResPart>,
1994    }
1995    /// Nested message and enum types in `ResPart`.
1996    pub mod res_part {
1997        #[derive(Clone, PartialEq, ::prost::Oneof)]
1998        pub enum ResPart {
1999            #[prost(message, tag = "2")]
2000            QueryRes(super::super::query::ResPart),
2001            #[prost(message, tag = "3")]
2002            StreamRes(super::stream_signal::ResPart),
2003        }
2004    }
2005    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2006    pub struct Open {}
2007    /// Nested message and enum types in `Open`.
2008    pub mod open {
2009        #[derive(Clone, PartialEq, ::prost::Message)]
2010        pub struct Req {
2011            #[prost(string, tag = "1")]
2012            pub database: ::prost::alloc::string::String,
2013            #[prost(enumeration = "super::Type", tag = "2")]
2014            pub r#type: i32,
2015            #[prost(message, optional, tag = "3")]
2016            pub options: ::core::option::Option<super::super::options::Transaction>,
2017            #[prost(uint64, tag = "4")]
2018            pub network_latency_millis: u64,
2019        }
2020        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2021        pub struct Res {
2022            #[prost(uint64, tag = "2")]
2023            pub server_duration_millis: u64,
2024        }
2025    }
2026    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2027    pub struct Commit {}
2028    /// Nested message and enum types in `Commit`.
2029    pub mod commit {
2030        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2031        pub struct Req {}
2032        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2033        pub struct Res {}
2034    }
2035    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2036    pub struct Rollback {}
2037    /// Nested message and enum types in `Rollback`.
2038    pub mod rollback {
2039        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2040        pub struct Req {}
2041        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2042        pub struct Res {}
2043    }
2044    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2045    pub struct Close {}
2046    /// Nested message and enum types in `Close`.
2047    pub mod close {
2048        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2049        pub struct Req {}
2050        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2051        pub struct Res {}
2052    }
2053    /// TODO: When actually used, should be probably merged with Error from error.proto
2054    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2055    pub struct GetSchemaExceptions {}
2056    /// Nested message and enum types in `GetSchemaExceptions`.
2057    pub mod get_schema_exceptions {
2058        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2059        pub struct Req {}
2060        #[derive(Clone, PartialEq, ::prost::Message)]
2061        pub struct Res {
2062            #[prost(message, repeated, tag = "1")]
2063            pub exceptions: ::prost::alloc::vec::Vec<super::SchemaException>,
2064        }
2065    }
2066    #[derive(Clone, PartialEq, ::prost::Message)]
2067    pub struct SchemaException {
2068        #[prost(string, tag = "1")]
2069        pub code: ::prost::alloc::string::String,
2070        #[prost(string, tag = "2")]
2071        pub message: ::prost::alloc::string::String,
2072    }
2073    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2074    pub struct StreamSignal {}
2075    /// Nested message and enum types in `StreamSignal`.
2076    pub mod stream_signal {
2077        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2078        pub struct Req {}
2079        #[derive(Clone, PartialEq, ::prost::Message)]
2080        pub struct ResPart {
2081            #[prost(oneof = "res_part::State", tags = "1, 2, 3")]
2082            pub state: ::core::option::Option<res_part::State>,
2083        }
2084        /// Nested message and enum types in `ResPart`.
2085        pub mod res_part {
2086            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2087            pub struct Continue {}
2088            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2089            pub struct Done {}
2090            #[derive(Clone, PartialEq, ::prost::Oneof)]
2091            pub enum State {
2092                #[prost(message, tag = "1")]
2093                Continue(Continue),
2094                #[prost(message, tag = "2")]
2095                Done(Done),
2096                #[prost(message, tag = "3")]
2097                Error(super::super::super::Error),
2098            }
2099        }
2100    }
2101    #[derive(
2102        Clone,
2103        Copy,
2104        Debug,
2105        PartialEq,
2106        Eq,
2107        Hash,
2108        PartialOrd,
2109        Ord,
2110        ::prost::Enumeration
2111    )]
2112    #[repr(i32)]
2113    pub enum Type {
2114        Read = 0,
2115        Write = 1,
2116        Schema = 2,
2117    }
2118    impl Type {
2119        /// String value of the enum field names used in the ProtoBuf definition.
2120        ///
2121        /// The values are not transformed in any way and thus are considered stable
2122        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2123        pub fn as_str_name(&self) -> &'static str {
2124            match self {
2125                Self::Read => "READ",
2126                Self::Write => "WRITE",
2127                Self::Schema => "SCHEMA",
2128            }
2129        }
2130        /// Creates an enum from field names used in the ProtoBuf definition.
2131        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2132            match value {
2133                "READ" => Some(Self::Read),
2134                "WRITE" => Some(Self::Write),
2135                "SCHEMA" => Some(Self::Schema),
2136                _ => None,
2137            }
2138        }
2139    }
2140}
2141#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2142pub struct UserManager {}
2143/// Nested message and enum types in `UserManager`.
2144pub mod user_manager {
2145    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2146    pub struct All {}
2147    /// Nested message and enum types in `All`.
2148    pub mod all {
2149        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2150        pub struct Req {}
2151        #[derive(Clone, PartialEq, ::prost::Message)]
2152        pub struct Res {
2153            #[prost(message, repeated, tag = "1")]
2154            pub users: ::prost::alloc::vec::Vec<super::super::User>,
2155        }
2156    }
2157    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2158    pub struct Contains {}
2159    /// Nested message and enum types in `Contains`.
2160    pub mod contains {
2161        #[derive(Clone, PartialEq, ::prost::Message)]
2162        pub struct Req {
2163            #[prost(string, tag = "1")]
2164            pub name: ::prost::alloc::string::String,
2165        }
2166        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2167        pub struct Res {
2168            #[prost(bool, tag = "1")]
2169            pub contains: bool,
2170        }
2171    }
2172    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2173    pub struct Get {}
2174    /// Nested message and enum types in `Get`.
2175    pub mod get {
2176        #[derive(Clone, PartialEq, ::prost::Message)]
2177        pub struct Req {
2178            #[prost(string, tag = "1")]
2179            pub name: ::prost::alloc::string::String,
2180        }
2181        #[derive(Clone, PartialEq, ::prost::Message)]
2182        pub struct Res {
2183            #[prost(message, optional, tag = "1")]
2184            pub user: ::core::option::Option<super::super::User>,
2185        }
2186    }
2187    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2188    pub struct Create {}
2189    /// Nested message and enum types in `Create`.
2190    pub mod create {
2191        #[derive(Clone, PartialEq, ::prost::Message)]
2192        pub struct Req {
2193            #[prost(message, optional, tag = "1")]
2194            pub user: ::core::option::Option<super::super::User>,
2195        }
2196        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2197        pub struct Res {}
2198    }
2199}
2200#[derive(Clone, PartialEq, ::prost::Message)]
2201pub struct User {
2202    #[prost(string, tag = "1")]
2203    pub name: ::prost::alloc::string::String,
2204    #[prost(string, optional, tag = "2")]
2205    pub password: ::core::option::Option<::prost::alloc::string::String>,
2206}
2207/// Nested message and enum types in `User`.
2208pub mod user {
2209    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2210    pub struct Update {}
2211    /// Nested message and enum types in `Update`.
2212    pub mod update {
2213        #[derive(Clone, PartialEq, ::prost::Message)]
2214        pub struct Req {
2215            #[prost(string, tag = "1")]
2216            pub name: ::prost::alloc::string::String,
2217            #[prost(message, optional, tag = "2")]
2218            pub user: ::core::option::Option<super::super::User>,
2219        }
2220        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2221        pub struct Res {}
2222    }
2223    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2224    pub struct Delete {}
2225    /// Nested message and enum types in `Delete`.
2226    pub mod delete {
2227        #[derive(Clone, PartialEq, ::prost::Message)]
2228        pub struct Req {
2229            #[prost(string, tag = "1")]
2230            pub name: ::prost::alloc::string::String,
2231        }
2232        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2233        pub struct Res {}
2234    }
2235}
2236/// Generated client implementations.
2237#[allow(non_camel_case_types)]
2238pub mod type_db_client {
2239    #![allow(
2240        unused_variables,
2241        dead_code,
2242        missing_docs,
2243        clippy::wildcard_imports,
2244        clippy::let_unit_value,
2245    )]
2246    use tonic::codegen::*;
2247    use tonic::codegen::http::Uri;
2248    #[derive(Debug, Clone)]
2249    pub struct TypeDbClient<T> {
2250        inner: tonic::client::Grpc<T>,
2251    }
2252    impl TypeDbClient<tonic::transport::Channel> {
2253        /// Attempt to create a new client by connecting to a given endpoint.
2254        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2255        where
2256            D: TryInto<tonic::transport::Endpoint>,
2257            D::Error: Into<StdError>,
2258        {
2259            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2260            Ok(Self::new(conn))
2261        }
2262    }
2263    impl<T> TypeDbClient<T>
2264    where
2265        T: tonic::client::GrpcService<tonic::body::BoxBody>,
2266        T::Error: Into<StdError>,
2267        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2268        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2269    {
2270        pub fn new(inner: T) -> Self {
2271            let inner = tonic::client::Grpc::new(inner);
2272            Self { inner }
2273        }
2274        pub fn with_origin(inner: T, origin: Uri) -> Self {
2275            let inner = tonic::client::Grpc::with_origin(inner, origin);
2276            Self { inner }
2277        }
2278        pub fn with_interceptor<F>(
2279            inner: T,
2280            interceptor: F,
2281        ) -> TypeDbClient<InterceptedService<T, F>>
2282        where
2283            F: tonic::service::Interceptor,
2284            T::ResponseBody: Default,
2285            T: tonic::codegen::Service<
2286                http::Request<tonic::body::BoxBody>,
2287                Response = http::Response<
2288                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
2289                >,
2290            >,
2291            <T as tonic::codegen::Service<
2292                http::Request<tonic::body::BoxBody>,
2293            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2294        {
2295            TypeDbClient::new(InterceptedService::new(inner, interceptor))
2296        }
2297        /// Compress requests with the given encoding.
2298        ///
2299        /// This requires the server to support it otherwise it might respond with an
2300        /// error.
2301        #[must_use]
2302        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2303            self.inner = self.inner.send_compressed(encoding);
2304            self
2305        }
2306        /// Enable decompressing responses.
2307        #[must_use]
2308        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2309            self.inner = self.inner.accept_compressed(encoding);
2310            self
2311        }
2312        /// Limits the maximum size of a decoded message.
2313        ///
2314        /// Default: `4MB`
2315        #[must_use]
2316        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2317            self.inner = self.inner.max_decoding_message_size(limit);
2318            self
2319        }
2320        /// Limits the maximum size of an encoded message.
2321        ///
2322        /// Default: `usize::MAX`
2323        #[must_use]
2324        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2325            self.inner = self.inner.max_encoding_message_size(limit);
2326            self
2327        }
2328        /// Connection API
2329        pub async fn connection_open(
2330            &mut self,
2331            request: impl tonic::IntoRequest<super::connection::open::Req>,
2332        ) -> std::result::Result<
2333            tonic::Response<super::connection::open::Res>,
2334            tonic::Status,
2335        > {
2336            self.inner
2337                .ready()
2338                .await
2339                .map_err(|e| {
2340                    tonic::Status::unknown(
2341                        format!("Service was not ready: {}", e.into()),
2342                    )
2343                })?;
2344            let codec = tonic::codec::ProstCodec::default();
2345            let path = http::uri::PathAndQuery::from_static(
2346                "/typedb.protocol.TypeDB/connection_open",
2347            );
2348            let mut req = request.into_request();
2349            req.extensions_mut()
2350                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "connection_open"));
2351            self.inner.unary(req, path, codec).await
2352        }
2353        /// Authentication API
2354        pub async fn authentication_token_create(
2355            &mut self,
2356            request: impl tonic::IntoRequest<super::authentication::token::create::Req>,
2357        ) -> std::result::Result<
2358            tonic::Response<super::authentication::token::create::Res>,
2359            tonic::Status,
2360        > {
2361            self.inner
2362                .ready()
2363                .await
2364                .map_err(|e| {
2365                    tonic::Status::unknown(
2366                        format!("Service was not ready: {}", e.into()),
2367                    )
2368                })?;
2369            let codec = tonic::codec::ProstCodec::default();
2370            let path = http::uri::PathAndQuery::from_static(
2371                "/typedb.protocol.TypeDB/authentication_token_create",
2372            );
2373            let mut req = request.into_request();
2374            req.extensions_mut()
2375                .insert(
2376                    GrpcMethod::new(
2377                        "typedb.protocol.TypeDB",
2378                        "authentication_token_create",
2379                    ),
2380                );
2381            self.inner.unary(req, path, codec).await
2382        }
2383        /// Server Manager API
2384        pub async fn servers_all(
2385            &mut self,
2386            request: impl tonic::IntoRequest<super::server_manager::all::Req>,
2387        ) -> std::result::Result<
2388            tonic::Response<super::server_manager::all::Res>,
2389            tonic::Status,
2390        > {
2391            self.inner
2392                .ready()
2393                .await
2394                .map_err(|e| {
2395                    tonic::Status::unknown(
2396                        format!("Service was not ready: {}", e.into()),
2397                    )
2398                })?;
2399            let codec = tonic::codec::ProstCodec::default();
2400            let path = http::uri::PathAndQuery::from_static(
2401                "/typedb.protocol.TypeDB/servers_all",
2402            );
2403            let mut req = request.into_request();
2404            req.extensions_mut()
2405                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "servers_all"));
2406            self.inner.unary(req, path, codec).await
2407        }
2408        pub async fn servers_get(
2409            &mut self,
2410            request: impl tonic::IntoRequest<super::server_manager::get::Req>,
2411        ) -> std::result::Result<
2412            tonic::Response<super::server_manager::get::Res>,
2413            tonic::Status,
2414        > {
2415            self.inner
2416                .ready()
2417                .await
2418                .map_err(|e| {
2419                    tonic::Status::unknown(
2420                        format!("Service was not ready: {}", e.into()),
2421                    )
2422                })?;
2423            let codec = tonic::codec::ProstCodec::default();
2424            let path = http::uri::PathAndQuery::from_static(
2425                "/typedb.protocol.TypeDB/servers_get",
2426            );
2427            let mut req = request.into_request();
2428            req.extensions_mut()
2429                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "servers_get"));
2430            self.inner.unary(req, path, codec).await
2431        }
2432        /// Server API
2433        pub async fn server_version(
2434            &mut self,
2435            request: impl tonic::IntoRequest<super::server::version::Req>,
2436        ) -> std::result::Result<
2437            tonic::Response<super::server::version::Res>,
2438            tonic::Status,
2439        > {
2440            self.inner
2441                .ready()
2442                .await
2443                .map_err(|e| {
2444                    tonic::Status::unknown(
2445                        format!("Service was not ready: {}", e.into()),
2446                    )
2447                })?;
2448            let codec = tonic::codec::ProstCodec::default();
2449            let path = http::uri::PathAndQuery::from_static(
2450                "/typedb.protocol.TypeDB/server_version",
2451            );
2452            let mut req = request.into_request();
2453            req.extensions_mut()
2454                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "server_version"));
2455            self.inner.unary(req, path, codec).await
2456        }
2457        /// User Manager API
2458        pub async fn users_get(
2459            &mut self,
2460            request: impl tonic::IntoRequest<super::user_manager::get::Req>,
2461        ) -> std::result::Result<
2462            tonic::Response<super::user_manager::get::Res>,
2463            tonic::Status,
2464        > {
2465            self.inner
2466                .ready()
2467                .await
2468                .map_err(|e| {
2469                    tonic::Status::unknown(
2470                        format!("Service was not ready: {}", e.into()),
2471                    )
2472                })?;
2473            let codec = tonic::codec::ProstCodec::default();
2474            let path = http::uri::PathAndQuery::from_static(
2475                "/typedb.protocol.TypeDB/users_get",
2476            );
2477            let mut req = request.into_request();
2478            req.extensions_mut()
2479                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "users_get"));
2480            self.inner.unary(req, path, codec).await
2481        }
2482        pub async fn users_all(
2483            &mut self,
2484            request: impl tonic::IntoRequest<super::user_manager::all::Req>,
2485        ) -> std::result::Result<
2486            tonic::Response<super::user_manager::all::Res>,
2487            tonic::Status,
2488        > {
2489            self.inner
2490                .ready()
2491                .await
2492                .map_err(|e| {
2493                    tonic::Status::unknown(
2494                        format!("Service was not ready: {}", e.into()),
2495                    )
2496                })?;
2497            let codec = tonic::codec::ProstCodec::default();
2498            let path = http::uri::PathAndQuery::from_static(
2499                "/typedb.protocol.TypeDB/users_all",
2500            );
2501            let mut req = request.into_request();
2502            req.extensions_mut()
2503                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "users_all"));
2504            self.inner.unary(req, path, codec).await
2505        }
2506        pub async fn users_contains(
2507            &mut self,
2508            request: impl tonic::IntoRequest<super::user_manager::contains::Req>,
2509        ) -> std::result::Result<
2510            tonic::Response<super::user_manager::contains::Res>,
2511            tonic::Status,
2512        > {
2513            self.inner
2514                .ready()
2515                .await
2516                .map_err(|e| {
2517                    tonic::Status::unknown(
2518                        format!("Service was not ready: {}", e.into()),
2519                    )
2520                })?;
2521            let codec = tonic::codec::ProstCodec::default();
2522            let path = http::uri::PathAndQuery::from_static(
2523                "/typedb.protocol.TypeDB/users_contains",
2524            );
2525            let mut req = request.into_request();
2526            req.extensions_mut()
2527                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "users_contains"));
2528            self.inner.unary(req, path, codec).await
2529        }
2530        pub async fn users_create(
2531            &mut self,
2532            request: impl tonic::IntoRequest<super::user_manager::create::Req>,
2533        ) -> std::result::Result<
2534            tonic::Response<super::user_manager::create::Res>,
2535            tonic::Status,
2536        > {
2537            self.inner
2538                .ready()
2539                .await
2540                .map_err(|e| {
2541                    tonic::Status::unknown(
2542                        format!("Service was not ready: {}", e.into()),
2543                    )
2544                })?;
2545            let codec = tonic::codec::ProstCodec::default();
2546            let path = http::uri::PathAndQuery::from_static(
2547                "/typedb.protocol.TypeDB/users_create",
2548            );
2549            let mut req = request.into_request();
2550            req.extensions_mut()
2551                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "users_create"));
2552            self.inner.unary(req, path, codec).await
2553        }
2554        /// User API
2555        pub async fn users_update(
2556            &mut self,
2557            request: impl tonic::IntoRequest<super::user::update::Req>,
2558        ) -> std::result::Result<
2559            tonic::Response<super::user::update::Res>,
2560            tonic::Status,
2561        > {
2562            self.inner
2563                .ready()
2564                .await
2565                .map_err(|e| {
2566                    tonic::Status::unknown(
2567                        format!("Service was not ready: {}", e.into()),
2568                    )
2569                })?;
2570            let codec = tonic::codec::ProstCodec::default();
2571            let path = http::uri::PathAndQuery::from_static(
2572                "/typedb.protocol.TypeDB/users_update",
2573            );
2574            let mut req = request.into_request();
2575            req.extensions_mut()
2576                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "users_update"));
2577            self.inner.unary(req, path, codec).await
2578        }
2579        pub async fn users_delete(
2580            &mut self,
2581            request: impl tonic::IntoRequest<super::user::delete::Req>,
2582        ) -> std::result::Result<
2583            tonic::Response<super::user::delete::Res>,
2584            tonic::Status,
2585        > {
2586            self.inner
2587                .ready()
2588                .await
2589                .map_err(|e| {
2590                    tonic::Status::unknown(
2591                        format!("Service was not ready: {}", e.into()),
2592                    )
2593                })?;
2594            let codec = tonic::codec::ProstCodec::default();
2595            let path = http::uri::PathAndQuery::from_static(
2596                "/typedb.protocol.TypeDB/users_delete",
2597            );
2598            let mut req = request.into_request();
2599            req.extensions_mut()
2600                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "users_delete"));
2601            self.inner.unary(req, path, codec).await
2602        }
2603        /// Database Manager API
2604        pub async fn databases_get(
2605            &mut self,
2606            request: impl tonic::IntoRequest<super::database_manager::get::Req>,
2607        ) -> std::result::Result<
2608            tonic::Response<super::database_manager::get::Res>,
2609            tonic::Status,
2610        > {
2611            self.inner
2612                .ready()
2613                .await
2614                .map_err(|e| {
2615                    tonic::Status::unknown(
2616                        format!("Service was not ready: {}", e.into()),
2617                    )
2618                })?;
2619            let codec = tonic::codec::ProstCodec::default();
2620            let path = http::uri::PathAndQuery::from_static(
2621                "/typedb.protocol.TypeDB/databases_get",
2622            );
2623            let mut req = request.into_request();
2624            req.extensions_mut()
2625                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "databases_get"));
2626            self.inner.unary(req, path, codec).await
2627        }
2628        pub async fn databases_all(
2629            &mut self,
2630            request: impl tonic::IntoRequest<super::database_manager::all::Req>,
2631        ) -> std::result::Result<
2632            tonic::Response<super::database_manager::all::Res>,
2633            tonic::Status,
2634        > {
2635            self.inner
2636                .ready()
2637                .await
2638                .map_err(|e| {
2639                    tonic::Status::unknown(
2640                        format!("Service was not ready: {}", e.into()),
2641                    )
2642                })?;
2643            let codec = tonic::codec::ProstCodec::default();
2644            let path = http::uri::PathAndQuery::from_static(
2645                "/typedb.protocol.TypeDB/databases_all",
2646            );
2647            let mut req = request.into_request();
2648            req.extensions_mut()
2649                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "databases_all"));
2650            self.inner.unary(req, path, codec).await
2651        }
2652        pub async fn databases_contains(
2653            &mut self,
2654            request: impl tonic::IntoRequest<super::database_manager::contains::Req>,
2655        ) -> std::result::Result<
2656            tonic::Response<super::database_manager::contains::Res>,
2657            tonic::Status,
2658        > {
2659            self.inner
2660                .ready()
2661                .await
2662                .map_err(|e| {
2663                    tonic::Status::unknown(
2664                        format!("Service was not ready: {}", e.into()),
2665                    )
2666                })?;
2667            let codec = tonic::codec::ProstCodec::default();
2668            let path = http::uri::PathAndQuery::from_static(
2669                "/typedb.protocol.TypeDB/databases_contains",
2670            );
2671            let mut req = request.into_request();
2672            req.extensions_mut()
2673                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "databases_contains"));
2674            self.inner.unary(req, path, codec).await
2675        }
2676        pub async fn databases_create(
2677            &mut self,
2678            request: impl tonic::IntoRequest<super::database_manager::create::Req>,
2679        ) -> std::result::Result<
2680            tonic::Response<super::database_manager::create::Res>,
2681            tonic::Status,
2682        > {
2683            self.inner
2684                .ready()
2685                .await
2686                .map_err(|e| {
2687                    tonic::Status::unknown(
2688                        format!("Service was not ready: {}", e.into()),
2689                    )
2690                })?;
2691            let codec = tonic::codec::ProstCodec::default();
2692            let path = http::uri::PathAndQuery::from_static(
2693                "/typedb.protocol.TypeDB/databases_create",
2694            );
2695            let mut req = request.into_request();
2696            req.extensions_mut()
2697                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "databases_create"));
2698            self.inner.unary(req, path, codec).await
2699        }
2700        pub async fn databases_import(
2701            &mut self,
2702            request: impl tonic::IntoStreamingRequest<
2703                Message = super::database_manager::import::Client,
2704            >,
2705        ) -> std::result::Result<
2706            tonic::Response<
2707                tonic::codec::Streaming<super::database_manager::import::Server>,
2708            >,
2709            tonic::Status,
2710        > {
2711            self.inner
2712                .ready()
2713                .await
2714                .map_err(|e| {
2715                    tonic::Status::unknown(
2716                        format!("Service was not ready: {}", e.into()),
2717                    )
2718                })?;
2719            let codec = tonic::codec::ProstCodec::default();
2720            let path = http::uri::PathAndQuery::from_static(
2721                "/typedb.protocol.TypeDB/databases_import",
2722            );
2723            let mut req = request.into_streaming_request();
2724            req.extensions_mut()
2725                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "databases_import"));
2726            self.inner.streaming(req, path, codec).await
2727        }
2728        /// Database API
2729        pub async fn database_schema(
2730            &mut self,
2731            request: impl tonic::IntoRequest<super::database::schema::Req>,
2732        ) -> std::result::Result<
2733            tonic::Response<super::database::schema::Res>,
2734            tonic::Status,
2735        > {
2736            self.inner
2737                .ready()
2738                .await
2739                .map_err(|e| {
2740                    tonic::Status::unknown(
2741                        format!("Service was not ready: {}", e.into()),
2742                    )
2743                })?;
2744            let codec = tonic::codec::ProstCodec::default();
2745            let path = http::uri::PathAndQuery::from_static(
2746                "/typedb.protocol.TypeDB/database_schema",
2747            );
2748            let mut req = request.into_request();
2749            req.extensions_mut()
2750                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "database_schema"));
2751            self.inner.unary(req, path, codec).await
2752        }
2753        pub async fn database_type_schema(
2754            &mut self,
2755            request: impl tonic::IntoRequest<super::database::type_schema::Req>,
2756        ) -> std::result::Result<
2757            tonic::Response<super::database::type_schema::Res>,
2758            tonic::Status,
2759        > {
2760            self.inner
2761                .ready()
2762                .await
2763                .map_err(|e| {
2764                    tonic::Status::unknown(
2765                        format!("Service was not ready: {}", e.into()),
2766                    )
2767                })?;
2768            let codec = tonic::codec::ProstCodec::default();
2769            let path = http::uri::PathAndQuery::from_static(
2770                "/typedb.protocol.TypeDB/database_type_schema",
2771            );
2772            let mut req = request.into_request();
2773            req.extensions_mut()
2774                .insert(
2775                    GrpcMethod::new("typedb.protocol.TypeDB", "database_type_schema"),
2776                );
2777            self.inner.unary(req, path, codec).await
2778        }
2779        pub async fn database_delete(
2780            &mut self,
2781            request: impl tonic::IntoRequest<super::database::delete::Req>,
2782        ) -> std::result::Result<
2783            tonic::Response<super::database::delete::Res>,
2784            tonic::Status,
2785        > {
2786            self.inner
2787                .ready()
2788                .await
2789                .map_err(|e| {
2790                    tonic::Status::unknown(
2791                        format!("Service was not ready: {}", e.into()),
2792                    )
2793                })?;
2794            let codec = tonic::codec::ProstCodec::default();
2795            let path = http::uri::PathAndQuery::from_static(
2796                "/typedb.protocol.TypeDB/database_delete",
2797            );
2798            let mut req = request.into_request();
2799            req.extensions_mut()
2800                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "database_delete"));
2801            self.inner.unary(req, path, codec).await
2802        }
2803        pub async fn database_export(
2804            &mut self,
2805            request: impl tonic::IntoRequest<super::database::export::Req>,
2806        ) -> std::result::Result<
2807            tonic::Response<tonic::codec::Streaming<super::database::export::Server>>,
2808            tonic::Status,
2809        > {
2810            self.inner
2811                .ready()
2812                .await
2813                .map_err(|e| {
2814                    tonic::Status::unknown(
2815                        format!("Service was not ready: {}", e.into()),
2816                    )
2817                })?;
2818            let codec = tonic::codec::ProstCodec::default();
2819            let path = http::uri::PathAndQuery::from_static(
2820                "/typedb.protocol.TypeDB/database_export",
2821            );
2822            let mut req = request.into_request();
2823            req.extensions_mut()
2824                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "database_export"));
2825            self.inner.server_streaming(req, path, codec).await
2826        }
2827        /// Transaction Streaming API
2828        /// Opens a bi-directional stream representing a stateful transaction, streaming
2829        /// requests and responses back-and-forth. The first transaction client message must
2830        /// be {Transaction.Open.Req}. Closing the stream closes the transaction.
2831        pub async fn transaction(
2832            &mut self,
2833            request: impl tonic::IntoStreamingRequest<
2834                Message = super::transaction::Client,
2835            >,
2836        ) -> std::result::Result<
2837            tonic::Response<tonic::codec::Streaming<super::transaction::Server>>,
2838            tonic::Status,
2839        > {
2840            self.inner
2841                .ready()
2842                .await
2843                .map_err(|e| {
2844                    tonic::Status::unknown(
2845                        format!("Service was not ready: {}", e.into()),
2846                    )
2847                })?;
2848            let codec = tonic::codec::ProstCodec::default();
2849            let path = http::uri::PathAndQuery::from_static(
2850                "/typedb.protocol.TypeDB/transaction",
2851            );
2852            let mut req = request.into_streaming_request();
2853            req.extensions_mut()
2854                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "transaction"));
2855            self.inner.streaming(req, path, codec).await
2856        }
2857    }
2858}
2859/// Generated server implementations.
2860#[allow(non_camel_case_types)]
2861pub mod type_db_server {
2862    #![allow(
2863        unused_variables,
2864        dead_code,
2865        missing_docs,
2866        clippy::wildcard_imports,
2867        clippy::let_unit_value,
2868    )]
2869    use tonic::codegen::*;
2870    /// Generated trait containing gRPC methods that should be implemented for use with TypeDbServer.
2871    #[async_trait]
2872    pub trait TypeDb: std::marker::Send + std::marker::Sync + 'static {
2873        /// Connection API
2874        async fn connection_open(
2875            &self,
2876            request: tonic::Request<super::connection::open::Req>,
2877        ) -> std::result::Result<
2878            tonic::Response<super::connection::open::Res>,
2879            tonic::Status,
2880        >;
2881        /// Authentication API
2882        async fn authentication_token_create(
2883            &self,
2884            request: tonic::Request<super::authentication::token::create::Req>,
2885        ) -> std::result::Result<
2886            tonic::Response<super::authentication::token::create::Res>,
2887            tonic::Status,
2888        >;
2889        /// Server Manager API
2890        async fn servers_all(
2891            &self,
2892            request: tonic::Request<super::server_manager::all::Req>,
2893        ) -> std::result::Result<
2894            tonic::Response<super::server_manager::all::Res>,
2895            tonic::Status,
2896        >;
2897        async fn servers_get(
2898            &self,
2899            request: tonic::Request<super::server_manager::get::Req>,
2900        ) -> std::result::Result<
2901            tonic::Response<super::server_manager::get::Res>,
2902            tonic::Status,
2903        >;
2904        /// Server API
2905        async fn server_version(
2906            &self,
2907            request: tonic::Request<super::server::version::Req>,
2908        ) -> std::result::Result<
2909            tonic::Response<super::server::version::Res>,
2910            tonic::Status,
2911        >;
2912        /// User Manager API
2913        async fn users_get(
2914            &self,
2915            request: tonic::Request<super::user_manager::get::Req>,
2916        ) -> std::result::Result<
2917            tonic::Response<super::user_manager::get::Res>,
2918            tonic::Status,
2919        >;
2920        async fn users_all(
2921            &self,
2922            request: tonic::Request<super::user_manager::all::Req>,
2923        ) -> std::result::Result<
2924            tonic::Response<super::user_manager::all::Res>,
2925            tonic::Status,
2926        >;
2927        async fn users_contains(
2928            &self,
2929            request: tonic::Request<super::user_manager::contains::Req>,
2930        ) -> std::result::Result<
2931            tonic::Response<super::user_manager::contains::Res>,
2932            tonic::Status,
2933        >;
2934        async fn users_create(
2935            &self,
2936            request: tonic::Request<super::user_manager::create::Req>,
2937        ) -> std::result::Result<
2938            tonic::Response<super::user_manager::create::Res>,
2939            tonic::Status,
2940        >;
2941        /// User API
2942        async fn users_update(
2943            &self,
2944            request: tonic::Request<super::user::update::Req>,
2945        ) -> std::result::Result<
2946            tonic::Response<super::user::update::Res>,
2947            tonic::Status,
2948        >;
2949        async fn users_delete(
2950            &self,
2951            request: tonic::Request<super::user::delete::Req>,
2952        ) -> std::result::Result<
2953            tonic::Response<super::user::delete::Res>,
2954            tonic::Status,
2955        >;
2956        /// Database Manager API
2957        async fn databases_get(
2958            &self,
2959            request: tonic::Request<super::database_manager::get::Req>,
2960        ) -> std::result::Result<
2961            tonic::Response<super::database_manager::get::Res>,
2962            tonic::Status,
2963        >;
2964        async fn databases_all(
2965            &self,
2966            request: tonic::Request<super::database_manager::all::Req>,
2967        ) -> std::result::Result<
2968            tonic::Response<super::database_manager::all::Res>,
2969            tonic::Status,
2970        >;
2971        async fn databases_contains(
2972            &self,
2973            request: tonic::Request<super::database_manager::contains::Req>,
2974        ) -> std::result::Result<
2975            tonic::Response<super::database_manager::contains::Res>,
2976            tonic::Status,
2977        >;
2978        async fn databases_create(
2979            &self,
2980            request: tonic::Request<super::database_manager::create::Req>,
2981        ) -> std::result::Result<
2982            tonic::Response<super::database_manager::create::Res>,
2983            tonic::Status,
2984        >;
2985        /// Server streaming response type for the databases_import method.
2986        type databases_importStream: tonic::codegen::tokio_stream::Stream<
2987                Item = std::result::Result<
2988                    super::database_manager::import::Server,
2989                    tonic::Status,
2990                >,
2991            >
2992            + std::marker::Send
2993            + 'static;
2994        async fn databases_import(
2995            &self,
2996            request: tonic::Request<
2997                tonic::Streaming<super::database_manager::import::Client>,
2998            >,
2999        ) -> std::result::Result<
3000            tonic::Response<Self::databases_importStream>,
3001            tonic::Status,
3002        >;
3003        /// Database API
3004        async fn database_schema(
3005            &self,
3006            request: tonic::Request<super::database::schema::Req>,
3007        ) -> std::result::Result<
3008            tonic::Response<super::database::schema::Res>,
3009            tonic::Status,
3010        >;
3011        async fn database_type_schema(
3012            &self,
3013            request: tonic::Request<super::database::type_schema::Req>,
3014        ) -> std::result::Result<
3015            tonic::Response<super::database::type_schema::Res>,
3016            tonic::Status,
3017        >;
3018        async fn database_delete(
3019            &self,
3020            request: tonic::Request<super::database::delete::Req>,
3021        ) -> std::result::Result<
3022            tonic::Response<super::database::delete::Res>,
3023            tonic::Status,
3024        >;
3025        /// Server streaming response type for the database_export method.
3026        type database_exportStream: tonic::codegen::tokio_stream::Stream<
3027                Item = std::result::Result<
3028                    super::database::export::Server,
3029                    tonic::Status,
3030                >,
3031            >
3032            + std::marker::Send
3033            + 'static;
3034        async fn database_export(
3035            &self,
3036            request: tonic::Request<super::database::export::Req>,
3037        ) -> std::result::Result<
3038            tonic::Response<Self::database_exportStream>,
3039            tonic::Status,
3040        >;
3041        /// Server streaming response type for the transaction method.
3042        type transactionStream: tonic::codegen::tokio_stream::Stream<
3043                Item = std::result::Result<super::transaction::Server, tonic::Status>,
3044            >
3045            + std::marker::Send
3046            + 'static;
3047        /// Transaction Streaming API
3048        /// Opens a bi-directional stream representing a stateful transaction, streaming
3049        /// requests and responses back-and-forth. The first transaction client message must
3050        /// be {Transaction.Open.Req}. Closing the stream closes the transaction.
3051        async fn transaction(
3052            &self,
3053            request: tonic::Request<tonic::Streaming<super::transaction::Client>>,
3054        ) -> std::result::Result<
3055            tonic::Response<Self::transactionStream>,
3056            tonic::Status,
3057        >;
3058    }
3059    #[derive(Debug)]
3060    pub struct TypeDbServer<T> {
3061        inner: Arc<T>,
3062        accept_compression_encodings: EnabledCompressionEncodings,
3063        send_compression_encodings: EnabledCompressionEncodings,
3064        max_decoding_message_size: Option<usize>,
3065        max_encoding_message_size: Option<usize>,
3066    }
3067    impl<T> TypeDbServer<T> {
3068        pub fn new(inner: T) -> Self {
3069            Self::from_arc(Arc::new(inner))
3070        }
3071        pub fn from_arc(inner: Arc<T>) -> Self {
3072            Self {
3073                inner,
3074                accept_compression_encodings: Default::default(),
3075                send_compression_encodings: Default::default(),
3076                max_decoding_message_size: None,
3077                max_encoding_message_size: None,
3078            }
3079        }
3080        pub fn with_interceptor<F>(
3081            inner: T,
3082            interceptor: F,
3083        ) -> InterceptedService<Self, F>
3084        where
3085            F: tonic::service::Interceptor,
3086        {
3087            InterceptedService::new(Self::new(inner), interceptor)
3088        }
3089        /// Enable decompressing requests with the given encoding.
3090        #[must_use]
3091        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3092            self.accept_compression_encodings.enable(encoding);
3093            self
3094        }
3095        /// Compress responses with the given encoding, if the client supports it.
3096        #[must_use]
3097        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3098            self.send_compression_encodings.enable(encoding);
3099            self
3100        }
3101        /// Limits the maximum size of a decoded message.
3102        ///
3103        /// Default: `4MB`
3104        #[must_use]
3105        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3106            self.max_decoding_message_size = Some(limit);
3107            self
3108        }
3109        /// Limits the maximum size of an encoded message.
3110        ///
3111        /// Default: `usize::MAX`
3112        #[must_use]
3113        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3114            self.max_encoding_message_size = Some(limit);
3115            self
3116        }
3117    }
3118    impl<T, B> tonic::codegen::Service<http::Request<B>> for TypeDbServer<T>
3119    where
3120        T: TypeDb,
3121        B: Body + std::marker::Send + 'static,
3122        B::Error: Into<StdError> + std::marker::Send + 'static,
3123    {
3124        type Response = http::Response<tonic::body::BoxBody>;
3125        type Error = std::convert::Infallible;
3126        type Future = BoxFuture<Self::Response, Self::Error>;
3127        fn poll_ready(
3128            &mut self,
3129            _cx: &mut Context<'_>,
3130        ) -> Poll<std::result::Result<(), Self::Error>> {
3131            Poll::Ready(Ok(()))
3132        }
3133        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3134            match req.uri().path() {
3135                "/typedb.protocol.TypeDB/connection_open" => {
3136                    #[allow(non_camel_case_types)]
3137                    struct connection_openSvc<T: TypeDb>(pub Arc<T>);
3138                    impl<
3139                        T: TypeDb,
3140                    > tonic::server::UnaryService<super::connection::open::Req>
3141                    for connection_openSvc<T> {
3142                        type Response = super::connection::open::Res;
3143                        type Future = BoxFuture<
3144                            tonic::Response<Self::Response>,
3145                            tonic::Status,
3146                        >;
3147                        fn call(
3148                            &mut self,
3149                            request: tonic::Request<super::connection::open::Req>,
3150                        ) -> Self::Future {
3151                            let inner = Arc::clone(&self.0);
3152                            let fut = async move {
3153                                <T as TypeDb>::connection_open(&inner, request).await
3154                            };
3155                            Box::pin(fut)
3156                        }
3157                    }
3158                    let accept_compression_encodings = self.accept_compression_encodings;
3159                    let send_compression_encodings = self.send_compression_encodings;
3160                    let max_decoding_message_size = self.max_decoding_message_size;
3161                    let max_encoding_message_size = self.max_encoding_message_size;
3162                    let inner = self.inner.clone();
3163                    let fut = async move {
3164                        let method = connection_openSvc(inner);
3165                        let codec = tonic::codec::ProstCodec::default();
3166                        let mut grpc = tonic::server::Grpc::new(codec)
3167                            .apply_compression_config(
3168                                accept_compression_encodings,
3169                                send_compression_encodings,
3170                            )
3171                            .apply_max_message_size_config(
3172                                max_decoding_message_size,
3173                                max_encoding_message_size,
3174                            );
3175                        let res = grpc.unary(method, req).await;
3176                        Ok(res)
3177                    };
3178                    Box::pin(fut)
3179                }
3180                "/typedb.protocol.TypeDB/authentication_token_create" => {
3181                    #[allow(non_camel_case_types)]
3182                    struct authentication_token_createSvc<T: TypeDb>(pub Arc<T>);
3183                    impl<
3184                        T: TypeDb,
3185                    > tonic::server::UnaryService<
3186                        super::authentication::token::create::Req,
3187                    > for authentication_token_createSvc<T> {
3188                        type Response = super::authentication::token::create::Res;
3189                        type Future = BoxFuture<
3190                            tonic::Response<Self::Response>,
3191                            tonic::Status,
3192                        >;
3193                        fn call(
3194                            &mut self,
3195                            request: tonic::Request<
3196                                super::authentication::token::create::Req,
3197                            >,
3198                        ) -> Self::Future {
3199                            let inner = Arc::clone(&self.0);
3200                            let fut = async move {
3201                                <T as TypeDb>::authentication_token_create(&inner, request)
3202                                    .await
3203                            };
3204                            Box::pin(fut)
3205                        }
3206                    }
3207                    let accept_compression_encodings = self.accept_compression_encodings;
3208                    let send_compression_encodings = self.send_compression_encodings;
3209                    let max_decoding_message_size = self.max_decoding_message_size;
3210                    let max_encoding_message_size = self.max_encoding_message_size;
3211                    let inner = self.inner.clone();
3212                    let fut = async move {
3213                        let method = authentication_token_createSvc(inner);
3214                        let codec = tonic::codec::ProstCodec::default();
3215                        let mut grpc = tonic::server::Grpc::new(codec)
3216                            .apply_compression_config(
3217                                accept_compression_encodings,
3218                                send_compression_encodings,
3219                            )
3220                            .apply_max_message_size_config(
3221                                max_decoding_message_size,
3222                                max_encoding_message_size,
3223                            );
3224                        let res = grpc.unary(method, req).await;
3225                        Ok(res)
3226                    };
3227                    Box::pin(fut)
3228                }
3229                "/typedb.protocol.TypeDB/servers_all" => {
3230                    #[allow(non_camel_case_types)]
3231                    struct servers_allSvc<T: TypeDb>(pub Arc<T>);
3232                    impl<
3233                        T: TypeDb,
3234                    > tonic::server::UnaryService<super::server_manager::all::Req>
3235                    for servers_allSvc<T> {
3236                        type Response = super::server_manager::all::Res;
3237                        type Future = BoxFuture<
3238                            tonic::Response<Self::Response>,
3239                            tonic::Status,
3240                        >;
3241                        fn call(
3242                            &mut self,
3243                            request: tonic::Request<super::server_manager::all::Req>,
3244                        ) -> Self::Future {
3245                            let inner = Arc::clone(&self.0);
3246                            let fut = async move {
3247                                <T as TypeDb>::servers_all(&inner, request).await
3248                            };
3249                            Box::pin(fut)
3250                        }
3251                    }
3252                    let accept_compression_encodings = self.accept_compression_encodings;
3253                    let send_compression_encodings = self.send_compression_encodings;
3254                    let max_decoding_message_size = self.max_decoding_message_size;
3255                    let max_encoding_message_size = self.max_encoding_message_size;
3256                    let inner = self.inner.clone();
3257                    let fut = async move {
3258                        let method = servers_allSvc(inner);
3259                        let codec = tonic::codec::ProstCodec::default();
3260                        let mut grpc = tonic::server::Grpc::new(codec)
3261                            .apply_compression_config(
3262                                accept_compression_encodings,
3263                                send_compression_encodings,
3264                            )
3265                            .apply_max_message_size_config(
3266                                max_decoding_message_size,
3267                                max_encoding_message_size,
3268                            );
3269                        let res = grpc.unary(method, req).await;
3270                        Ok(res)
3271                    };
3272                    Box::pin(fut)
3273                }
3274                "/typedb.protocol.TypeDB/servers_get" => {
3275                    #[allow(non_camel_case_types)]
3276                    struct servers_getSvc<T: TypeDb>(pub Arc<T>);
3277                    impl<
3278                        T: TypeDb,
3279                    > tonic::server::UnaryService<super::server_manager::get::Req>
3280                    for servers_getSvc<T> {
3281                        type Response = super::server_manager::get::Res;
3282                        type Future = BoxFuture<
3283                            tonic::Response<Self::Response>,
3284                            tonic::Status,
3285                        >;
3286                        fn call(
3287                            &mut self,
3288                            request: tonic::Request<super::server_manager::get::Req>,
3289                        ) -> Self::Future {
3290                            let inner = Arc::clone(&self.0);
3291                            let fut = async move {
3292                                <T as TypeDb>::servers_get(&inner, request).await
3293                            };
3294                            Box::pin(fut)
3295                        }
3296                    }
3297                    let accept_compression_encodings = self.accept_compression_encodings;
3298                    let send_compression_encodings = self.send_compression_encodings;
3299                    let max_decoding_message_size = self.max_decoding_message_size;
3300                    let max_encoding_message_size = self.max_encoding_message_size;
3301                    let inner = self.inner.clone();
3302                    let fut = async move {
3303                        let method = servers_getSvc(inner);
3304                        let codec = tonic::codec::ProstCodec::default();
3305                        let mut grpc = tonic::server::Grpc::new(codec)
3306                            .apply_compression_config(
3307                                accept_compression_encodings,
3308                                send_compression_encodings,
3309                            )
3310                            .apply_max_message_size_config(
3311                                max_decoding_message_size,
3312                                max_encoding_message_size,
3313                            );
3314                        let res = grpc.unary(method, req).await;
3315                        Ok(res)
3316                    };
3317                    Box::pin(fut)
3318                }
3319                "/typedb.protocol.TypeDB/server_version" => {
3320                    #[allow(non_camel_case_types)]
3321                    struct server_versionSvc<T: TypeDb>(pub Arc<T>);
3322                    impl<
3323                        T: TypeDb,
3324                    > tonic::server::UnaryService<super::server::version::Req>
3325                    for server_versionSvc<T> {
3326                        type Response = super::server::version::Res;
3327                        type Future = BoxFuture<
3328                            tonic::Response<Self::Response>,
3329                            tonic::Status,
3330                        >;
3331                        fn call(
3332                            &mut self,
3333                            request: tonic::Request<super::server::version::Req>,
3334                        ) -> Self::Future {
3335                            let inner = Arc::clone(&self.0);
3336                            let fut = async move {
3337                                <T as TypeDb>::server_version(&inner, request).await
3338                            };
3339                            Box::pin(fut)
3340                        }
3341                    }
3342                    let accept_compression_encodings = self.accept_compression_encodings;
3343                    let send_compression_encodings = self.send_compression_encodings;
3344                    let max_decoding_message_size = self.max_decoding_message_size;
3345                    let max_encoding_message_size = self.max_encoding_message_size;
3346                    let inner = self.inner.clone();
3347                    let fut = async move {
3348                        let method = server_versionSvc(inner);
3349                        let codec = tonic::codec::ProstCodec::default();
3350                        let mut grpc = tonic::server::Grpc::new(codec)
3351                            .apply_compression_config(
3352                                accept_compression_encodings,
3353                                send_compression_encodings,
3354                            )
3355                            .apply_max_message_size_config(
3356                                max_decoding_message_size,
3357                                max_encoding_message_size,
3358                            );
3359                        let res = grpc.unary(method, req).await;
3360                        Ok(res)
3361                    };
3362                    Box::pin(fut)
3363                }
3364                "/typedb.protocol.TypeDB/users_get" => {
3365                    #[allow(non_camel_case_types)]
3366                    struct users_getSvc<T: TypeDb>(pub Arc<T>);
3367                    impl<
3368                        T: TypeDb,
3369                    > tonic::server::UnaryService<super::user_manager::get::Req>
3370                    for users_getSvc<T> {
3371                        type Response = super::user_manager::get::Res;
3372                        type Future = BoxFuture<
3373                            tonic::Response<Self::Response>,
3374                            tonic::Status,
3375                        >;
3376                        fn call(
3377                            &mut self,
3378                            request: tonic::Request<super::user_manager::get::Req>,
3379                        ) -> Self::Future {
3380                            let inner = Arc::clone(&self.0);
3381                            let fut = async move {
3382                                <T as TypeDb>::users_get(&inner, request).await
3383                            };
3384                            Box::pin(fut)
3385                        }
3386                    }
3387                    let accept_compression_encodings = self.accept_compression_encodings;
3388                    let send_compression_encodings = self.send_compression_encodings;
3389                    let max_decoding_message_size = self.max_decoding_message_size;
3390                    let max_encoding_message_size = self.max_encoding_message_size;
3391                    let inner = self.inner.clone();
3392                    let fut = async move {
3393                        let method = users_getSvc(inner);
3394                        let codec = tonic::codec::ProstCodec::default();
3395                        let mut grpc = tonic::server::Grpc::new(codec)
3396                            .apply_compression_config(
3397                                accept_compression_encodings,
3398                                send_compression_encodings,
3399                            )
3400                            .apply_max_message_size_config(
3401                                max_decoding_message_size,
3402                                max_encoding_message_size,
3403                            );
3404                        let res = grpc.unary(method, req).await;
3405                        Ok(res)
3406                    };
3407                    Box::pin(fut)
3408                }
3409                "/typedb.protocol.TypeDB/users_all" => {
3410                    #[allow(non_camel_case_types)]
3411                    struct users_allSvc<T: TypeDb>(pub Arc<T>);
3412                    impl<
3413                        T: TypeDb,
3414                    > tonic::server::UnaryService<super::user_manager::all::Req>
3415                    for users_allSvc<T> {
3416                        type Response = super::user_manager::all::Res;
3417                        type Future = BoxFuture<
3418                            tonic::Response<Self::Response>,
3419                            tonic::Status,
3420                        >;
3421                        fn call(
3422                            &mut self,
3423                            request: tonic::Request<super::user_manager::all::Req>,
3424                        ) -> Self::Future {
3425                            let inner = Arc::clone(&self.0);
3426                            let fut = async move {
3427                                <T as TypeDb>::users_all(&inner, request).await
3428                            };
3429                            Box::pin(fut)
3430                        }
3431                    }
3432                    let accept_compression_encodings = self.accept_compression_encodings;
3433                    let send_compression_encodings = self.send_compression_encodings;
3434                    let max_decoding_message_size = self.max_decoding_message_size;
3435                    let max_encoding_message_size = self.max_encoding_message_size;
3436                    let inner = self.inner.clone();
3437                    let fut = async move {
3438                        let method = users_allSvc(inner);
3439                        let codec = tonic::codec::ProstCodec::default();
3440                        let mut grpc = tonic::server::Grpc::new(codec)
3441                            .apply_compression_config(
3442                                accept_compression_encodings,
3443                                send_compression_encodings,
3444                            )
3445                            .apply_max_message_size_config(
3446                                max_decoding_message_size,
3447                                max_encoding_message_size,
3448                            );
3449                        let res = grpc.unary(method, req).await;
3450                        Ok(res)
3451                    };
3452                    Box::pin(fut)
3453                }
3454                "/typedb.protocol.TypeDB/users_contains" => {
3455                    #[allow(non_camel_case_types)]
3456                    struct users_containsSvc<T: TypeDb>(pub Arc<T>);
3457                    impl<
3458                        T: TypeDb,
3459                    > tonic::server::UnaryService<super::user_manager::contains::Req>
3460                    for users_containsSvc<T> {
3461                        type Response = super::user_manager::contains::Res;
3462                        type Future = BoxFuture<
3463                            tonic::Response<Self::Response>,
3464                            tonic::Status,
3465                        >;
3466                        fn call(
3467                            &mut self,
3468                            request: tonic::Request<super::user_manager::contains::Req>,
3469                        ) -> Self::Future {
3470                            let inner = Arc::clone(&self.0);
3471                            let fut = async move {
3472                                <T as TypeDb>::users_contains(&inner, request).await
3473                            };
3474                            Box::pin(fut)
3475                        }
3476                    }
3477                    let accept_compression_encodings = self.accept_compression_encodings;
3478                    let send_compression_encodings = self.send_compression_encodings;
3479                    let max_decoding_message_size = self.max_decoding_message_size;
3480                    let max_encoding_message_size = self.max_encoding_message_size;
3481                    let inner = self.inner.clone();
3482                    let fut = async move {
3483                        let method = users_containsSvc(inner);
3484                        let codec = tonic::codec::ProstCodec::default();
3485                        let mut grpc = tonic::server::Grpc::new(codec)
3486                            .apply_compression_config(
3487                                accept_compression_encodings,
3488                                send_compression_encodings,
3489                            )
3490                            .apply_max_message_size_config(
3491                                max_decoding_message_size,
3492                                max_encoding_message_size,
3493                            );
3494                        let res = grpc.unary(method, req).await;
3495                        Ok(res)
3496                    };
3497                    Box::pin(fut)
3498                }
3499                "/typedb.protocol.TypeDB/users_create" => {
3500                    #[allow(non_camel_case_types)]
3501                    struct users_createSvc<T: TypeDb>(pub Arc<T>);
3502                    impl<
3503                        T: TypeDb,
3504                    > tonic::server::UnaryService<super::user_manager::create::Req>
3505                    for users_createSvc<T> {
3506                        type Response = super::user_manager::create::Res;
3507                        type Future = BoxFuture<
3508                            tonic::Response<Self::Response>,
3509                            tonic::Status,
3510                        >;
3511                        fn call(
3512                            &mut self,
3513                            request: tonic::Request<super::user_manager::create::Req>,
3514                        ) -> Self::Future {
3515                            let inner = Arc::clone(&self.0);
3516                            let fut = async move {
3517                                <T as TypeDb>::users_create(&inner, request).await
3518                            };
3519                            Box::pin(fut)
3520                        }
3521                    }
3522                    let accept_compression_encodings = self.accept_compression_encodings;
3523                    let send_compression_encodings = self.send_compression_encodings;
3524                    let max_decoding_message_size = self.max_decoding_message_size;
3525                    let max_encoding_message_size = self.max_encoding_message_size;
3526                    let inner = self.inner.clone();
3527                    let fut = async move {
3528                        let method = users_createSvc(inner);
3529                        let codec = tonic::codec::ProstCodec::default();
3530                        let mut grpc = tonic::server::Grpc::new(codec)
3531                            .apply_compression_config(
3532                                accept_compression_encodings,
3533                                send_compression_encodings,
3534                            )
3535                            .apply_max_message_size_config(
3536                                max_decoding_message_size,
3537                                max_encoding_message_size,
3538                            );
3539                        let res = grpc.unary(method, req).await;
3540                        Ok(res)
3541                    };
3542                    Box::pin(fut)
3543                }
3544                "/typedb.protocol.TypeDB/users_update" => {
3545                    #[allow(non_camel_case_types)]
3546                    struct users_updateSvc<T: TypeDb>(pub Arc<T>);
3547                    impl<T: TypeDb> tonic::server::UnaryService<super::user::update::Req>
3548                    for users_updateSvc<T> {
3549                        type Response = super::user::update::Res;
3550                        type Future = BoxFuture<
3551                            tonic::Response<Self::Response>,
3552                            tonic::Status,
3553                        >;
3554                        fn call(
3555                            &mut self,
3556                            request: tonic::Request<super::user::update::Req>,
3557                        ) -> Self::Future {
3558                            let inner = Arc::clone(&self.0);
3559                            let fut = async move {
3560                                <T as TypeDb>::users_update(&inner, request).await
3561                            };
3562                            Box::pin(fut)
3563                        }
3564                    }
3565                    let accept_compression_encodings = self.accept_compression_encodings;
3566                    let send_compression_encodings = self.send_compression_encodings;
3567                    let max_decoding_message_size = self.max_decoding_message_size;
3568                    let max_encoding_message_size = self.max_encoding_message_size;
3569                    let inner = self.inner.clone();
3570                    let fut = async move {
3571                        let method = users_updateSvc(inner);
3572                        let codec = tonic::codec::ProstCodec::default();
3573                        let mut grpc = tonic::server::Grpc::new(codec)
3574                            .apply_compression_config(
3575                                accept_compression_encodings,
3576                                send_compression_encodings,
3577                            )
3578                            .apply_max_message_size_config(
3579                                max_decoding_message_size,
3580                                max_encoding_message_size,
3581                            );
3582                        let res = grpc.unary(method, req).await;
3583                        Ok(res)
3584                    };
3585                    Box::pin(fut)
3586                }
3587                "/typedb.protocol.TypeDB/users_delete" => {
3588                    #[allow(non_camel_case_types)]
3589                    struct users_deleteSvc<T: TypeDb>(pub Arc<T>);
3590                    impl<T: TypeDb> tonic::server::UnaryService<super::user::delete::Req>
3591                    for users_deleteSvc<T> {
3592                        type Response = super::user::delete::Res;
3593                        type Future = BoxFuture<
3594                            tonic::Response<Self::Response>,
3595                            tonic::Status,
3596                        >;
3597                        fn call(
3598                            &mut self,
3599                            request: tonic::Request<super::user::delete::Req>,
3600                        ) -> Self::Future {
3601                            let inner = Arc::clone(&self.0);
3602                            let fut = async move {
3603                                <T as TypeDb>::users_delete(&inner, request).await
3604                            };
3605                            Box::pin(fut)
3606                        }
3607                    }
3608                    let accept_compression_encodings = self.accept_compression_encodings;
3609                    let send_compression_encodings = self.send_compression_encodings;
3610                    let max_decoding_message_size = self.max_decoding_message_size;
3611                    let max_encoding_message_size = self.max_encoding_message_size;
3612                    let inner = self.inner.clone();
3613                    let fut = async move {
3614                        let method = users_deleteSvc(inner);
3615                        let codec = tonic::codec::ProstCodec::default();
3616                        let mut grpc = tonic::server::Grpc::new(codec)
3617                            .apply_compression_config(
3618                                accept_compression_encodings,
3619                                send_compression_encodings,
3620                            )
3621                            .apply_max_message_size_config(
3622                                max_decoding_message_size,
3623                                max_encoding_message_size,
3624                            );
3625                        let res = grpc.unary(method, req).await;
3626                        Ok(res)
3627                    };
3628                    Box::pin(fut)
3629                }
3630                "/typedb.protocol.TypeDB/databases_get" => {
3631                    #[allow(non_camel_case_types)]
3632                    struct databases_getSvc<T: TypeDb>(pub Arc<T>);
3633                    impl<
3634                        T: TypeDb,
3635                    > tonic::server::UnaryService<super::database_manager::get::Req>
3636                    for databases_getSvc<T> {
3637                        type Response = super::database_manager::get::Res;
3638                        type Future = BoxFuture<
3639                            tonic::Response<Self::Response>,
3640                            tonic::Status,
3641                        >;
3642                        fn call(
3643                            &mut self,
3644                            request: tonic::Request<super::database_manager::get::Req>,
3645                        ) -> Self::Future {
3646                            let inner = Arc::clone(&self.0);
3647                            let fut = async move {
3648                                <T as TypeDb>::databases_get(&inner, request).await
3649                            };
3650                            Box::pin(fut)
3651                        }
3652                    }
3653                    let accept_compression_encodings = self.accept_compression_encodings;
3654                    let send_compression_encodings = self.send_compression_encodings;
3655                    let max_decoding_message_size = self.max_decoding_message_size;
3656                    let max_encoding_message_size = self.max_encoding_message_size;
3657                    let inner = self.inner.clone();
3658                    let fut = async move {
3659                        let method = databases_getSvc(inner);
3660                        let codec = tonic::codec::ProstCodec::default();
3661                        let mut grpc = tonic::server::Grpc::new(codec)
3662                            .apply_compression_config(
3663                                accept_compression_encodings,
3664                                send_compression_encodings,
3665                            )
3666                            .apply_max_message_size_config(
3667                                max_decoding_message_size,
3668                                max_encoding_message_size,
3669                            );
3670                        let res = grpc.unary(method, req).await;
3671                        Ok(res)
3672                    };
3673                    Box::pin(fut)
3674                }
3675                "/typedb.protocol.TypeDB/databases_all" => {
3676                    #[allow(non_camel_case_types)]
3677                    struct databases_allSvc<T: TypeDb>(pub Arc<T>);
3678                    impl<
3679                        T: TypeDb,
3680                    > tonic::server::UnaryService<super::database_manager::all::Req>
3681                    for databases_allSvc<T> {
3682                        type Response = super::database_manager::all::Res;
3683                        type Future = BoxFuture<
3684                            tonic::Response<Self::Response>,
3685                            tonic::Status,
3686                        >;
3687                        fn call(
3688                            &mut self,
3689                            request: tonic::Request<super::database_manager::all::Req>,
3690                        ) -> Self::Future {
3691                            let inner = Arc::clone(&self.0);
3692                            let fut = async move {
3693                                <T as TypeDb>::databases_all(&inner, request).await
3694                            };
3695                            Box::pin(fut)
3696                        }
3697                    }
3698                    let accept_compression_encodings = self.accept_compression_encodings;
3699                    let send_compression_encodings = self.send_compression_encodings;
3700                    let max_decoding_message_size = self.max_decoding_message_size;
3701                    let max_encoding_message_size = self.max_encoding_message_size;
3702                    let inner = self.inner.clone();
3703                    let fut = async move {
3704                        let method = databases_allSvc(inner);
3705                        let codec = tonic::codec::ProstCodec::default();
3706                        let mut grpc = tonic::server::Grpc::new(codec)
3707                            .apply_compression_config(
3708                                accept_compression_encodings,
3709                                send_compression_encodings,
3710                            )
3711                            .apply_max_message_size_config(
3712                                max_decoding_message_size,
3713                                max_encoding_message_size,
3714                            );
3715                        let res = grpc.unary(method, req).await;
3716                        Ok(res)
3717                    };
3718                    Box::pin(fut)
3719                }
3720                "/typedb.protocol.TypeDB/databases_contains" => {
3721                    #[allow(non_camel_case_types)]
3722                    struct databases_containsSvc<T: TypeDb>(pub Arc<T>);
3723                    impl<
3724                        T: TypeDb,
3725                    > tonic::server::UnaryService<super::database_manager::contains::Req>
3726                    for databases_containsSvc<T> {
3727                        type Response = super::database_manager::contains::Res;
3728                        type Future = BoxFuture<
3729                            tonic::Response<Self::Response>,
3730                            tonic::Status,
3731                        >;
3732                        fn call(
3733                            &mut self,
3734                            request: tonic::Request<
3735                                super::database_manager::contains::Req,
3736                            >,
3737                        ) -> Self::Future {
3738                            let inner = Arc::clone(&self.0);
3739                            let fut = async move {
3740                                <T as TypeDb>::databases_contains(&inner, request).await
3741                            };
3742                            Box::pin(fut)
3743                        }
3744                    }
3745                    let accept_compression_encodings = self.accept_compression_encodings;
3746                    let send_compression_encodings = self.send_compression_encodings;
3747                    let max_decoding_message_size = self.max_decoding_message_size;
3748                    let max_encoding_message_size = self.max_encoding_message_size;
3749                    let inner = self.inner.clone();
3750                    let fut = async move {
3751                        let method = databases_containsSvc(inner);
3752                        let codec = tonic::codec::ProstCodec::default();
3753                        let mut grpc = tonic::server::Grpc::new(codec)
3754                            .apply_compression_config(
3755                                accept_compression_encodings,
3756                                send_compression_encodings,
3757                            )
3758                            .apply_max_message_size_config(
3759                                max_decoding_message_size,
3760                                max_encoding_message_size,
3761                            );
3762                        let res = grpc.unary(method, req).await;
3763                        Ok(res)
3764                    };
3765                    Box::pin(fut)
3766                }
3767                "/typedb.protocol.TypeDB/databases_create" => {
3768                    #[allow(non_camel_case_types)]
3769                    struct databases_createSvc<T: TypeDb>(pub Arc<T>);
3770                    impl<
3771                        T: TypeDb,
3772                    > tonic::server::UnaryService<super::database_manager::create::Req>
3773                    for databases_createSvc<T> {
3774                        type Response = super::database_manager::create::Res;
3775                        type Future = BoxFuture<
3776                            tonic::Response<Self::Response>,
3777                            tonic::Status,
3778                        >;
3779                        fn call(
3780                            &mut self,
3781                            request: tonic::Request<super::database_manager::create::Req>,
3782                        ) -> Self::Future {
3783                            let inner = Arc::clone(&self.0);
3784                            let fut = async move {
3785                                <T as TypeDb>::databases_create(&inner, request).await
3786                            };
3787                            Box::pin(fut)
3788                        }
3789                    }
3790                    let accept_compression_encodings = self.accept_compression_encodings;
3791                    let send_compression_encodings = self.send_compression_encodings;
3792                    let max_decoding_message_size = self.max_decoding_message_size;
3793                    let max_encoding_message_size = self.max_encoding_message_size;
3794                    let inner = self.inner.clone();
3795                    let fut = async move {
3796                        let method = databases_createSvc(inner);
3797                        let codec = tonic::codec::ProstCodec::default();
3798                        let mut grpc = tonic::server::Grpc::new(codec)
3799                            .apply_compression_config(
3800                                accept_compression_encodings,
3801                                send_compression_encodings,
3802                            )
3803                            .apply_max_message_size_config(
3804                                max_decoding_message_size,
3805                                max_encoding_message_size,
3806                            );
3807                        let res = grpc.unary(method, req).await;
3808                        Ok(res)
3809                    };
3810                    Box::pin(fut)
3811                }
3812                "/typedb.protocol.TypeDB/databases_import" => {
3813                    #[allow(non_camel_case_types)]
3814                    struct databases_importSvc<T: TypeDb>(pub Arc<T>);
3815                    impl<
3816                        T: TypeDb,
3817                    > tonic::server::StreamingService<
3818                        super::database_manager::import::Client,
3819                    > for databases_importSvc<T> {
3820                        type Response = super::database_manager::import::Server;
3821                        type ResponseStream = T::databases_importStream;
3822                        type Future = BoxFuture<
3823                            tonic::Response<Self::ResponseStream>,
3824                            tonic::Status,
3825                        >;
3826                        fn call(
3827                            &mut self,
3828                            request: tonic::Request<
3829                                tonic::Streaming<super::database_manager::import::Client>,
3830                            >,
3831                        ) -> Self::Future {
3832                            let inner = Arc::clone(&self.0);
3833                            let fut = async move {
3834                                <T as TypeDb>::databases_import(&inner, request).await
3835                            };
3836                            Box::pin(fut)
3837                        }
3838                    }
3839                    let accept_compression_encodings = self.accept_compression_encodings;
3840                    let send_compression_encodings = self.send_compression_encodings;
3841                    let max_decoding_message_size = self.max_decoding_message_size;
3842                    let max_encoding_message_size = self.max_encoding_message_size;
3843                    let inner = self.inner.clone();
3844                    let fut = async move {
3845                        let method = databases_importSvc(inner);
3846                        let codec = tonic::codec::ProstCodec::default();
3847                        let mut grpc = tonic::server::Grpc::new(codec)
3848                            .apply_compression_config(
3849                                accept_compression_encodings,
3850                                send_compression_encodings,
3851                            )
3852                            .apply_max_message_size_config(
3853                                max_decoding_message_size,
3854                                max_encoding_message_size,
3855                            );
3856                        let res = grpc.streaming(method, req).await;
3857                        Ok(res)
3858                    };
3859                    Box::pin(fut)
3860                }
3861                "/typedb.protocol.TypeDB/database_schema" => {
3862                    #[allow(non_camel_case_types)]
3863                    struct database_schemaSvc<T: TypeDb>(pub Arc<T>);
3864                    impl<
3865                        T: TypeDb,
3866                    > tonic::server::UnaryService<super::database::schema::Req>
3867                    for database_schemaSvc<T> {
3868                        type Response = super::database::schema::Res;
3869                        type Future = BoxFuture<
3870                            tonic::Response<Self::Response>,
3871                            tonic::Status,
3872                        >;
3873                        fn call(
3874                            &mut self,
3875                            request: tonic::Request<super::database::schema::Req>,
3876                        ) -> Self::Future {
3877                            let inner = Arc::clone(&self.0);
3878                            let fut = async move {
3879                                <T as TypeDb>::database_schema(&inner, request).await
3880                            };
3881                            Box::pin(fut)
3882                        }
3883                    }
3884                    let accept_compression_encodings = self.accept_compression_encodings;
3885                    let send_compression_encodings = self.send_compression_encodings;
3886                    let max_decoding_message_size = self.max_decoding_message_size;
3887                    let max_encoding_message_size = self.max_encoding_message_size;
3888                    let inner = self.inner.clone();
3889                    let fut = async move {
3890                        let method = database_schemaSvc(inner);
3891                        let codec = tonic::codec::ProstCodec::default();
3892                        let mut grpc = tonic::server::Grpc::new(codec)
3893                            .apply_compression_config(
3894                                accept_compression_encodings,
3895                                send_compression_encodings,
3896                            )
3897                            .apply_max_message_size_config(
3898                                max_decoding_message_size,
3899                                max_encoding_message_size,
3900                            );
3901                        let res = grpc.unary(method, req).await;
3902                        Ok(res)
3903                    };
3904                    Box::pin(fut)
3905                }
3906                "/typedb.protocol.TypeDB/database_type_schema" => {
3907                    #[allow(non_camel_case_types)]
3908                    struct database_type_schemaSvc<T: TypeDb>(pub Arc<T>);
3909                    impl<
3910                        T: TypeDb,
3911                    > tonic::server::UnaryService<super::database::type_schema::Req>
3912                    for database_type_schemaSvc<T> {
3913                        type Response = super::database::type_schema::Res;
3914                        type Future = BoxFuture<
3915                            tonic::Response<Self::Response>,
3916                            tonic::Status,
3917                        >;
3918                        fn call(
3919                            &mut self,
3920                            request: tonic::Request<super::database::type_schema::Req>,
3921                        ) -> Self::Future {
3922                            let inner = Arc::clone(&self.0);
3923                            let fut = async move {
3924                                <T as TypeDb>::database_type_schema(&inner, request).await
3925                            };
3926                            Box::pin(fut)
3927                        }
3928                    }
3929                    let accept_compression_encodings = self.accept_compression_encodings;
3930                    let send_compression_encodings = self.send_compression_encodings;
3931                    let max_decoding_message_size = self.max_decoding_message_size;
3932                    let max_encoding_message_size = self.max_encoding_message_size;
3933                    let inner = self.inner.clone();
3934                    let fut = async move {
3935                        let method = database_type_schemaSvc(inner);
3936                        let codec = tonic::codec::ProstCodec::default();
3937                        let mut grpc = tonic::server::Grpc::new(codec)
3938                            .apply_compression_config(
3939                                accept_compression_encodings,
3940                                send_compression_encodings,
3941                            )
3942                            .apply_max_message_size_config(
3943                                max_decoding_message_size,
3944                                max_encoding_message_size,
3945                            );
3946                        let res = grpc.unary(method, req).await;
3947                        Ok(res)
3948                    };
3949                    Box::pin(fut)
3950                }
3951                "/typedb.protocol.TypeDB/database_delete" => {
3952                    #[allow(non_camel_case_types)]
3953                    struct database_deleteSvc<T: TypeDb>(pub Arc<T>);
3954                    impl<
3955                        T: TypeDb,
3956                    > tonic::server::UnaryService<super::database::delete::Req>
3957                    for database_deleteSvc<T> {
3958                        type Response = super::database::delete::Res;
3959                        type Future = BoxFuture<
3960                            tonic::Response<Self::Response>,
3961                            tonic::Status,
3962                        >;
3963                        fn call(
3964                            &mut self,
3965                            request: tonic::Request<super::database::delete::Req>,
3966                        ) -> Self::Future {
3967                            let inner = Arc::clone(&self.0);
3968                            let fut = async move {
3969                                <T as TypeDb>::database_delete(&inner, request).await
3970                            };
3971                            Box::pin(fut)
3972                        }
3973                    }
3974                    let accept_compression_encodings = self.accept_compression_encodings;
3975                    let send_compression_encodings = self.send_compression_encodings;
3976                    let max_decoding_message_size = self.max_decoding_message_size;
3977                    let max_encoding_message_size = self.max_encoding_message_size;
3978                    let inner = self.inner.clone();
3979                    let fut = async move {
3980                        let method = database_deleteSvc(inner);
3981                        let codec = tonic::codec::ProstCodec::default();
3982                        let mut grpc = tonic::server::Grpc::new(codec)
3983                            .apply_compression_config(
3984                                accept_compression_encodings,
3985                                send_compression_encodings,
3986                            )
3987                            .apply_max_message_size_config(
3988                                max_decoding_message_size,
3989                                max_encoding_message_size,
3990                            );
3991                        let res = grpc.unary(method, req).await;
3992                        Ok(res)
3993                    };
3994                    Box::pin(fut)
3995                }
3996                "/typedb.protocol.TypeDB/database_export" => {
3997                    #[allow(non_camel_case_types)]
3998                    struct database_exportSvc<T: TypeDb>(pub Arc<T>);
3999                    impl<
4000                        T: TypeDb,
4001                    > tonic::server::ServerStreamingService<super::database::export::Req>
4002                    for database_exportSvc<T> {
4003                        type Response = super::database::export::Server;
4004                        type ResponseStream = T::database_exportStream;
4005                        type Future = BoxFuture<
4006                            tonic::Response<Self::ResponseStream>,
4007                            tonic::Status,
4008                        >;
4009                        fn call(
4010                            &mut self,
4011                            request: tonic::Request<super::database::export::Req>,
4012                        ) -> Self::Future {
4013                            let inner = Arc::clone(&self.0);
4014                            let fut = async move {
4015                                <T as TypeDb>::database_export(&inner, request).await
4016                            };
4017                            Box::pin(fut)
4018                        }
4019                    }
4020                    let accept_compression_encodings = self.accept_compression_encodings;
4021                    let send_compression_encodings = self.send_compression_encodings;
4022                    let max_decoding_message_size = self.max_decoding_message_size;
4023                    let max_encoding_message_size = self.max_encoding_message_size;
4024                    let inner = self.inner.clone();
4025                    let fut = async move {
4026                        let method = database_exportSvc(inner);
4027                        let codec = tonic::codec::ProstCodec::default();
4028                        let mut grpc = tonic::server::Grpc::new(codec)
4029                            .apply_compression_config(
4030                                accept_compression_encodings,
4031                                send_compression_encodings,
4032                            )
4033                            .apply_max_message_size_config(
4034                                max_decoding_message_size,
4035                                max_encoding_message_size,
4036                            );
4037                        let res = grpc.server_streaming(method, req).await;
4038                        Ok(res)
4039                    };
4040                    Box::pin(fut)
4041                }
4042                "/typedb.protocol.TypeDB/transaction" => {
4043                    #[allow(non_camel_case_types)]
4044                    struct transactionSvc<T: TypeDb>(pub Arc<T>);
4045                    impl<
4046                        T: TypeDb,
4047                    > tonic::server::StreamingService<super::transaction::Client>
4048                    for transactionSvc<T> {
4049                        type Response = super::transaction::Server;
4050                        type ResponseStream = T::transactionStream;
4051                        type Future = BoxFuture<
4052                            tonic::Response<Self::ResponseStream>,
4053                            tonic::Status,
4054                        >;
4055                        fn call(
4056                            &mut self,
4057                            request: tonic::Request<
4058                                tonic::Streaming<super::transaction::Client>,
4059                            >,
4060                        ) -> Self::Future {
4061                            let inner = Arc::clone(&self.0);
4062                            let fut = async move {
4063                                <T as TypeDb>::transaction(&inner, request).await
4064                            };
4065                            Box::pin(fut)
4066                        }
4067                    }
4068                    let accept_compression_encodings = self.accept_compression_encodings;
4069                    let send_compression_encodings = self.send_compression_encodings;
4070                    let max_decoding_message_size = self.max_decoding_message_size;
4071                    let max_encoding_message_size = self.max_encoding_message_size;
4072                    let inner = self.inner.clone();
4073                    let fut = async move {
4074                        let method = transactionSvc(inner);
4075                        let codec = tonic::codec::ProstCodec::default();
4076                        let mut grpc = tonic::server::Grpc::new(codec)
4077                            .apply_compression_config(
4078                                accept_compression_encodings,
4079                                send_compression_encodings,
4080                            )
4081                            .apply_max_message_size_config(
4082                                max_decoding_message_size,
4083                                max_encoding_message_size,
4084                            );
4085                        let res = grpc.streaming(method, req).await;
4086                        Ok(res)
4087                    };
4088                    Box::pin(fut)
4089                }
4090                _ => {
4091                    Box::pin(async move {
4092                        let mut response = http::Response::new(empty_body());
4093                        let headers = response.headers_mut();
4094                        headers
4095                            .insert(
4096                                tonic::Status::GRPC_STATUS,
4097                                (tonic::Code::Unimplemented as i32).into(),
4098                            );
4099                        headers
4100                            .insert(
4101                                http::header::CONTENT_TYPE,
4102                                tonic::metadata::GRPC_CONTENT_TYPE,
4103                            );
4104                        Ok(response)
4105                    })
4106                }
4107            }
4108        }
4109    }
4110    impl<T> Clone for TypeDbServer<T> {
4111        fn clone(&self) -> Self {
4112            let inner = self.inner.clone();
4113            Self {
4114                inner,
4115                accept_compression_encodings: self.accept_compression_encodings,
4116                send_compression_encodings: self.send_compression_encodings,
4117                max_decoding_message_size: self.max_decoding_message_size,
4118                max_encoding_message_size: self.max_encoding_message_size,
4119            }
4120        }
4121    }
4122    /// Generated gRPC service name
4123    pub const SERVICE_NAME: &str = "typedb.protocol.TypeDB";
4124    impl<T> tonic::server::NamedService for TypeDbServer<T> {
4125        const NAME: &'static str = SERVICE_NAME;
4126    }
4127}