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            #[prost(message, optional, tag = "5")]
841            pub given: ::core::option::Option<analyzed_query::AnalyzedGiven>,
842        }
843        /// Nested message and enum types in `AnalyzedQuery`.
844        pub mod analyzed_query {
845            #[derive(Clone, PartialEq, ::prost::Message)]
846            pub struct Function {
847                #[prost(message, optional, tag = "1")]
848                pub body: ::core::option::Option<Pipeline>,
849                #[prost(message, repeated, tag = "2")]
850                pub arguments: ::prost::alloc::vec::Vec<
851                    super::super::super::analyzed_conjunction::Variable,
852                >,
853                #[prost(message, repeated, tag = "3")]
854                pub arguments_annotations: ::prost::alloc::vec::Vec<
855                    super::super::super::analyzed_conjunction::VariableAnnotations,
856                >,
857                #[prost(message, repeated, tag = "4")]
858                pub return_annotations: ::prost::alloc::vec::Vec<
859                    super::super::super::analyzed_conjunction::VariableAnnotations,
860                >,
861                #[prost(message, optional, tag = "5")]
862                pub return_operation: ::core::option::Option<function::ReturnOperation>,
863            }
864            /// Nested message and enum types in `Function`.
865            pub mod function {
866                #[derive(Clone, PartialEq, ::prost::Message)]
867                pub struct ReturnOperation {
868                    #[prost(
869                        oneof = "return_operation::ReturnOperation",
870                        tags = "1, 2, 3, 4"
871                    )]
872                    pub return_operation: ::core::option::Option<
873                        return_operation::ReturnOperation,
874                    >,
875                }
876                /// Nested message and enum types in `ReturnOperation`.
877                pub mod return_operation {
878                    #[derive(Clone, PartialEq, ::prost::Message)]
879                    pub struct ReturnOpStream {
880                        #[prost(message, repeated, tag = "1")]
881                        pub variables: ::prost::alloc::vec::Vec<
882                            super::super::super::super::super::analyzed_conjunction::Variable,
883                        >,
884                    }
885                    #[derive(Clone, PartialEq, ::prost::Message)]
886                    pub struct ReturnOpSingle {
887                        #[prost(string, tag = "1")]
888                        pub selector: ::prost::alloc::string::String,
889                        #[prost(message, repeated, tag = "2")]
890                        pub variables: ::prost::alloc::vec::Vec<
891                            super::super::super::super::super::analyzed_conjunction::Variable,
892                        >,
893                    }
894                    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
895                    pub struct ReturnOpCheck {}
896                    #[derive(Clone, PartialEq, ::prost::Message)]
897                    pub struct ReturnOpReduce {
898                        #[prost(message, repeated, tag = "1")]
899                        pub reducers: ::prost::alloc::vec::Vec<super::super::Reducer>,
900                    }
901                    #[derive(Clone, PartialEq, ::prost::Oneof)]
902                    pub enum ReturnOperation {
903                        #[prost(message, tag = "1")]
904                        Stream(ReturnOpStream),
905                        #[prost(message, tag = "2")]
906                        Single(ReturnOpSingle),
907                        #[prost(message, tag = "3")]
908                        Check(ReturnOpCheck),
909                        #[prost(message, tag = "4")]
910                        Reduce(ReturnOpReduce),
911                    }
912                }
913            }
914            #[derive(Clone, PartialEq, ::prost::Message)]
915            pub struct AnalyzedGiven {
916                #[prost(message, repeated, tag = "1")]
917                pub variables: ::prost::alloc::vec::Vec<
918                    super::super::super::analyzed_conjunction::Variable,
919                >,
920                #[prost(map = "uint32, message", tag = "2")]
921                pub variable_annotations: ::std::collections::HashMap<
922                    u32,
923                    super::super::super::analyzed_conjunction::VariableAnnotations,
924                >,
925            }
926            #[derive(Clone, PartialEq, ::prost::Message)]
927            pub struct Pipeline {
928                #[prost(message, repeated, tag = "1")]
929                pub conjunctions: ::prost::alloc::vec::Vec<
930                    super::super::super::AnalyzedConjunction,
931                >,
932                #[prost(message, repeated, tag = "2")]
933                pub stages: ::prost::alloc::vec::Vec<pipeline::PipelineStage>,
934                #[prost(map = "uint32, message", tag = "3")]
935                pub variable_info: ::std::collections::HashMap<
936                    u32,
937                    pipeline::VariableInfo,
938                >,
939                #[prost(message, repeated, tag = "4")]
940                pub outputs: ::prost::alloc::vec::Vec<
941                    super::super::super::analyzed_conjunction::Variable,
942                >,
943            }
944            /// Nested message and enum types in `Pipeline`.
945            pub mod pipeline {
946                #[derive(Clone, PartialEq, ::prost::Message)]
947                pub struct VariableInfo {
948                    #[prost(string, tag = "1")]
949                    pub name: ::prost::alloc::string::String,
950                }
951                #[derive(Clone, PartialEq, ::prost::Message)]
952                pub struct PipelineStage {
953                    #[prost(
954                        oneof = "pipeline_stage::Stage",
955                        tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12"
956                    )]
957                    pub stage: ::core::option::Option<pipeline_stage::Stage>,
958                }
959                /// Nested message and enum types in `PipelineStage`.
960                pub mod pipeline_stage {
961                    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
962                    pub struct Match {
963                        #[prost(uint32, tag = "1")]
964                        pub block: u32,
965                    }
966                    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
967                    pub struct Insert {
968                        #[prost(uint32, tag = "1")]
969                        pub block: u32,
970                    }
971                    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
972                    pub struct Put {
973                        #[prost(uint32, tag = "1")]
974                        pub block: u32,
975                    }
976                    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
977                    pub struct Update {
978                        #[prost(uint32, tag = "1")]
979                        pub block: u32,
980                    }
981                    #[derive(Clone, PartialEq, ::prost::Message)]
982                    pub struct Delete {
983                        #[prost(uint32, tag = "1")]
984                        pub block: u32,
985                        #[prost(message, repeated, tag = "2")]
986                        pub deleted_variables: ::prost::alloc::vec::Vec<
987                            super::super::super::super::super::analyzed_conjunction::Variable,
988                        >,
989                    }
990                    #[derive(Clone, PartialEq, ::prost::Message)]
991                    pub struct Select {
992                        #[prost(message, repeated, tag = "1")]
993                        pub variables: ::prost::alloc::vec::Vec<
994                            super::super::super::super::super::analyzed_conjunction::Variable,
995                        >,
996                    }
997                    #[derive(Clone, PartialEq, ::prost::Message)]
998                    pub struct Sort {
999                        #[prost(message, repeated, tag = "1")]
1000                        pub sort_variables: ::prost::alloc::vec::Vec<sort::SortVariable>,
1001                    }
1002                    /// Nested message and enum types in `Sort`.
1003                    pub mod sort {
1004                        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1005                        pub struct SortVariable {
1006                            #[prost(message, optional, tag = "1")]
1007                            pub variable: ::core::option::Option<
1008                                super::super::super::super::super::super::analyzed_conjunction::Variable,
1009                            >,
1010                            #[prost(
1011                                enumeration = "sort_variable::SortDirection",
1012                                tag = "2"
1013                            )]
1014                            pub direction: i32,
1015                        }
1016                        /// Nested message and enum types in `SortVariable`.
1017                        pub mod sort_variable {
1018                            #[derive(
1019                                Clone,
1020                                Copy,
1021                                Debug,
1022                                PartialEq,
1023                                Eq,
1024                                Hash,
1025                                PartialOrd,
1026                                Ord,
1027                                ::prost::Enumeration
1028                            )]
1029                            #[repr(i32)]
1030                            pub enum SortDirection {
1031                                Asc = 0,
1032                                Desc = 1,
1033                            }
1034                            impl SortDirection {
1035                                /// String value of the enum field names used in the ProtoBuf definition.
1036                                ///
1037                                /// The values are not transformed in any way and thus are considered stable
1038                                /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1039                                pub fn as_str_name(&self) -> &'static str {
1040                                    match self {
1041                                        Self::Asc => "ASC",
1042                                        Self::Desc => "DESC",
1043                                    }
1044                                }
1045                                /// Creates an enum from field names used in the ProtoBuf definition.
1046                                pub fn from_str_name(
1047                                    value: &str,
1048                                ) -> ::core::option::Option<Self> {
1049                                    match value {
1050                                        "ASC" => Some(Self::Asc),
1051                                        "DESC" => Some(Self::Desc),
1052                                        _ => None,
1053                                    }
1054                                }
1055                            }
1056                        }
1057                    }
1058                    #[derive(Clone, PartialEq, ::prost::Message)]
1059                    pub struct Require {
1060                        #[prost(message, repeated, tag = "1")]
1061                        pub variables: ::prost::alloc::vec::Vec<
1062                            super::super::super::super::super::analyzed_conjunction::Variable,
1063                        >,
1064                    }
1065                    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1066                    pub struct Offset {
1067                        #[prost(uint64, tag = "1")]
1068                        pub offset: u64,
1069                    }
1070                    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1071                    pub struct Limit {
1072                        #[prost(uint64, tag = "1")]
1073                        pub limit: u64,
1074                    }
1075                    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1076                    pub struct Distinct {}
1077                    #[derive(Clone, PartialEq, ::prost::Message)]
1078                    pub struct Reduce {
1079                        #[prost(message, repeated, tag = "1")]
1080                        pub reducers: ::prost::alloc::vec::Vec<reduce::ReduceAssign>,
1081                        #[prost(message, repeated, tag = "2")]
1082                        pub groupby: ::prost::alloc::vec::Vec<
1083                            super::super::super::super::super::analyzed_conjunction::Variable,
1084                        >,
1085                    }
1086                    /// Nested message and enum types in `Reduce`.
1087                    pub mod reduce {
1088                        #[derive(Clone, PartialEq, ::prost::Message)]
1089                        pub struct ReduceAssign {
1090                            #[prost(message, optional, tag = "1")]
1091                            pub assigned: ::core::option::Option<
1092                                super::super::super::super::super::super::analyzed_conjunction::Variable,
1093                            >,
1094                            #[prost(message, optional, tag = "2")]
1095                            pub reducer: ::core::option::Option<
1096                                super::super::super::Reducer,
1097                            >,
1098                        }
1099                    }
1100                    #[derive(Clone, PartialEq, ::prost::Oneof)]
1101                    pub enum Stage {
1102                        #[prost(message, tag = "1")]
1103                        Match(Match),
1104                        #[prost(message, tag = "2")]
1105                        Insert(Insert),
1106                        #[prost(message, tag = "3")]
1107                        Put(Put),
1108                        #[prost(message, tag = "4")]
1109                        Update(Update),
1110                        #[prost(message, tag = "5")]
1111                        Delete(Delete),
1112                        #[prost(message, tag = "6")]
1113                        Select(Select),
1114                        #[prost(message, tag = "7")]
1115                        Sort(Sort),
1116                        #[prost(message, tag = "8")]
1117                        Require(Require),
1118                        #[prost(message, tag = "9")]
1119                        Offset(Offset),
1120                        #[prost(message, tag = "10")]
1121                        Limit(Limit),
1122                        #[prost(message, tag = "11")]
1123                        Distinct(Distinct),
1124                        #[prost(message, tag = "12")]
1125                        Reduce(Reduce),
1126                    }
1127                }
1128            }
1129            #[derive(Clone, PartialEq, ::prost::Message)]
1130            pub struct Reducer {
1131                #[prost(string, tag = "1")]
1132                pub reducer: ::prost::alloc::string::String,
1133                #[prost(message, repeated, tag = "2")]
1134                pub variables: ::prost::alloc::vec::Vec<
1135                    super::super::super::analyzed_conjunction::Variable,
1136                >,
1137            }
1138            #[derive(Clone, PartialEq, ::prost::Message)]
1139            pub struct Fetch {
1140                #[prost(oneof = "fetch::Node", tags = "1, 2, 3")]
1141                pub node: ::core::option::Option<fetch::Node>,
1142            }
1143            /// Nested message and enum types in `Fetch`.
1144            pub mod fetch {
1145                #[derive(Clone, PartialEq, ::prost::Message)]
1146                pub struct Object {
1147                    #[prost(map = "string, message", tag = "1")]
1148                    pub fetch: ::std::collections::HashMap<
1149                        ::prost::alloc::string::String,
1150                        super::Fetch,
1151                    >,
1152                }
1153                #[derive(Clone, PartialEq, ::prost::Message)]
1154                pub struct Leaf {
1155                    #[prost(message, repeated, tag = "1")]
1156                    pub annotations: ::prost::alloc::vec::Vec<
1157                        super::super::super::super::ValueType,
1158                    >,
1159                }
1160                #[derive(Clone, PartialEq, ::prost::Oneof)]
1161                pub enum Node {
1162                    #[prost(message, tag = "1")]
1163                    Object(Object),
1164                    #[prost(message, tag = "2")]
1165                    List(::prost::alloc::boxed::Box<super::Fetch>),
1166                    #[prost(message, tag = "3")]
1167                    Leaf(Leaf),
1168                }
1169            }
1170        }
1171        #[derive(Clone, PartialEq, ::prost::Oneof)]
1172        pub enum Result {
1173            #[prost(message, tag = "1")]
1174            Err(super::super::Error),
1175            #[prost(message, tag = "2")]
1176            Ok(AnalyzedQuery),
1177        }
1178    }
1179}
1180#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1181pub struct Authentication {}
1182/// Nested message and enum types in `Authentication`.
1183pub mod authentication {
1184    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1185    pub struct Token {}
1186    /// Nested message and enum types in `Token`.
1187    pub mod token {
1188        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1189        pub struct Create {}
1190        /// Nested message and enum types in `Create`.
1191        pub mod create {
1192            #[derive(Clone, PartialEq, ::prost::Message)]
1193            pub struct Req {
1194                #[prost(oneof = "req::Credentials", tags = "1")]
1195                pub credentials: ::core::option::Option<req::Credentials>,
1196            }
1197            /// Nested message and enum types in `Req`.
1198            pub mod req {
1199                #[derive(Clone, PartialEq, ::prost::Message)]
1200                pub struct Password {
1201                    #[prost(string, tag = "1")]
1202                    pub username: ::prost::alloc::string::String,
1203                    #[prost(string, tag = "2")]
1204                    pub password: ::prost::alloc::string::String,
1205                }
1206                #[derive(Clone, PartialEq, ::prost::Oneof)]
1207                pub enum Credentials {
1208                    /// extend by other credential kinds
1209                    #[prost(message, tag = "1")]
1210                    Password(Password),
1211                }
1212            }
1213            #[derive(Clone, PartialEq, ::prost::Message)]
1214            pub struct Res {
1215                #[prost(string, tag = "1")]
1216                pub token: ::prost::alloc::string::String,
1217            }
1218        }
1219    }
1220}
1221#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1222pub struct Migration {}
1223/// Nested message and enum types in `Migration`.
1224pub mod migration {
1225    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1226    pub struct Export {}
1227    /// Nested message and enum types in `Export`.
1228    pub mod export {
1229        #[derive(Clone, PartialEq, ::prost::Message)]
1230        pub struct Req {
1231            #[prost(string, tag = "1")]
1232            pub name: ::prost::alloc::string::String,
1233        }
1234        #[derive(Clone, PartialEq, ::prost::Message)]
1235        pub struct Server {
1236            #[prost(oneof = "server::Server", tags = "1, 2, 3")]
1237            pub server: ::core::option::Option<server::Server>,
1238        }
1239        /// Nested message and enum types in `Server`.
1240        pub mod server {
1241            #[derive(Clone, PartialEq, ::prost::Oneof)]
1242            pub enum Server {
1243                #[prost(message, tag = "1")]
1244                InitialRes(super::InitialRes),
1245                #[prost(message, tag = "2")]
1246                ResPart(super::ResPart),
1247                #[prost(message, tag = "3")]
1248                Done(super::Done),
1249            }
1250        }
1251        #[derive(Clone, PartialEq, ::prost::Message)]
1252        pub struct InitialRes {
1253            #[prost(string, tag = "1")]
1254            pub schema: ::prost::alloc::string::String,
1255        }
1256        #[derive(Clone, PartialEq, ::prost::Message)]
1257        pub struct ResPart {
1258            #[prost(message, repeated, tag = "1")]
1259            pub items: ::prost::alloc::vec::Vec<super::Item>,
1260        }
1261        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1262        pub struct Done {}
1263    }
1264    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1265    pub struct Import {}
1266    /// Nested message and enum types in `Import`.
1267    pub mod import {
1268        #[derive(Clone, PartialEq, ::prost::Message)]
1269        pub struct Client {
1270            #[prost(oneof = "client::Client", tags = "1, 2, 3")]
1271            pub client: ::core::option::Option<client::Client>,
1272        }
1273        /// Nested message and enum types in `Client`.
1274        pub mod client {
1275            #[derive(Clone, PartialEq, ::prost::Message)]
1276            pub struct InitialReq {
1277                #[prost(string, tag = "1")]
1278                pub name: ::prost::alloc::string::String,
1279                #[prost(string, tag = "2")]
1280                pub schema: ::prost::alloc::string::String,
1281            }
1282            #[derive(Clone, PartialEq, ::prost::Message)]
1283            pub struct ReqPart {
1284                #[prost(message, repeated, tag = "1")]
1285                pub items: ::prost::alloc::vec::Vec<super::super::Item>,
1286            }
1287            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1288            pub struct Done {}
1289            #[derive(Clone, PartialEq, ::prost::Oneof)]
1290            pub enum Client {
1291                #[prost(message, tag = "1")]
1292                InitialReq(InitialReq),
1293                #[prost(message, tag = "2")]
1294                ReqPart(ReqPart),
1295                #[prost(message, tag = "3")]
1296                Done(Done),
1297            }
1298        }
1299        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1300        pub struct Server {
1301            #[prost(message, optional, tag = "1")]
1302            pub done: ::core::option::Option<server::Done>,
1303        }
1304        /// Nested message and enum types in `Server`.
1305        pub mod server {
1306            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1307            pub struct Done {}
1308        }
1309    }
1310    #[derive(Clone, PartialEq, ::prost::Message)]
1311    pub struct Item {
1312        #[prost(oneof = "item::Item", tags = "1, 2, 3, 15, 16")]
1313        pub item: ::core::option::Option<item::Item>,
1314    }
1315    /// Nested message and enum types in `Item`.
1316    pub mod item {
1317        #[derive(Clone, PartialEq, ::prost::Message)]
1318        pub struct Entity {
1319            #[prost(string, tag = "1")]
1320            pub id: ::prost::alloc::string::String,
1321            #[prost(string, tag = "2")]
1322            pub label: ::prost::alloc::string::String,
1323            #[prost(message, repeated, tag = "3")]
1324            pub attributes: ::prost::alloc::vec::Vec<OwnedAttribute>,
1325        }
1326        #[derive(Clone, PartialEq, ::prost::Message)]
1327        pub struct Attribute {
1328            #[prost(string, tag = "1")]
1329            pub id: ::prost::alloc::string::String,
1330            #[prost(string, tag = "2")]
1331            pub label: ::prost::alloc::string::String,
1332            /// empty in 3.x, used for backwards compatibility
1333            #[prost(message, repeated, tag = "3")]
1334            pub attributes: ::prost::alloc::vec::Vec<OwnedAttribute>,
1335            #[prost(message, optional, tag = "4")]
1336            pub value: ::core::option::Option<super::MigrationValue>,
1337        }
1338        #[derive(Clone, PartialEq, ::prost::Message)]
1339        pub struct Relation {
1340            #[prost(string, tag = "1")]
1341            pub id: ::prost::alloc::string::String,
1342            #[prost(string, tag = "2")]
1343            pub label: ::prost::alloc::string::String,
1344            #[prost(message, repeated, tag = "3")]
1345            pub attributes: ::prost::alloc::vec::Vec<OwnedAttribute>,
1346            #[prost(message, repeated, tag = "4")]
1347            pub roles: ::prost::alloc::vec::Vec<relation::Role>,
1348        }
1349        /// Nested message and enum types in `Relation`.
1350        pub mod relation {
1351            #[derive(Clone, PartialEq, ::prost::Message)]
1352            pub struct Role {
1353                #[prost(string, tag = "1")]
1354                pub label: ::prost::alloc::string::String,
1355                #[prost(message, repeated, tag = "2")]
1356                pub players: ::prost::alloc::vec::Vec<role::Player>,
1357            }
1358            /// Nested message and enum types in `Role`.
1359            pub mod role {
1360                #[derive(Clone, PartialEq, ::prost::Message)]
1361                pub struct Player {
1362                    #[prost(string, tag = "1")]
1363                    pub id: ::prost::alloc::string::String,
1364                }
1365            }
1366        }
1367        #[derive(Clone, PartialEq, ::prost::Message)]
1368        pub struct OwnedAttribute {
1369            #[prost(string, tag = "1")]
1370            pub id: ::prost::alloc::string::String,
1371        }
1372        #[derive(Clone, PartialEq, ::prost::Message)]
1373        pub struct Header {
1374            #[prost(string, tag = "1")]
1375            pub typedb_version: ::prost::alloc::string::String,
1376            #[prost(string, tag = "2")]
1377            pub original_database: ::prost::alloc::string::String,
1378        }
1379        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1380        pub struct Checksums {
1381            #[prost(int64, tag = "1")]
1382            pub entity_count: i64,
1383            #[prost(int64, tag = "2")]
1384            pub attribute_count: i64,
1385            #[prost(int64, tag = "3")]
1386            pub relation_count: i64,
1387            #[prost(int64, tag = "4")]
1388            pub role_count: i64,
1389            #[prost(int64, tag = "5")]
1390            pub ownership_count: i64,
1391        }
1392        #[derive(Clone, PartialEq, ::prost::Oneof)]
1393        pub enum Item {
1394            #[prost(message, tag = "1")]
1395            Attribute(Attribute),
1396            #[prost(message, tag = "2")]
1397            Entity(Entity),
1398            #[prost(message, tag = "3")]
1399            Relation(Relation),
1400            #[prost(message, tag = "15")]
1401            Header(Header),
1402            #[prost(message, tag = "16")]
1403            Checksums(Checksums),
1404        }
1405    }
1406    #[derive(Clone, PartialEq, ::prost::Message)]
1407    pub struct MigrationValue {
1408        #[prost(
1409            oneof = "migration_value::Value",
1410            tags = "1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12"
1411        )]
1412        pub value: ::core::option::Option<migration_value::Value>,
1413    }
1414    /// Nested message and enum types in `MigrationValue`.
1415    pub mod migration_value {
1416        #[derive(Clone, PartialEq, ::prost::Oneof)]
1417        pub enum Value {
1418            #[prost(string, tag = "1")]
1419            String(::prost::alloc::string::String),
1420            #[prost(bool, tag = "2")]
1421            Boolean(bool),
1422            #[prost(int64, tag = "3")]
1423            Integer(i64),
1424            #[prost(double, tag = "4")]
1425            Double(f64),
1426            /// compatibility with 2.x, milliseconds since epoch
1427            #[prost(int64, tag = "5")]
1428            DatetimeMillis(i64),
1429            #[prost(message, tag = "6")]
1430            Decimal(super::super::value::Decimal),
1431            #[prost(message, tag = "8")]
1432            Date(super::super::value::Date),
1433            #[prost(message, tag = "9")]
1434            Datetime(super::super::value::Datetime),
1435            #[prost(message, tag = "10")]
1436            DatetimeTz(super::super::value::DatetimeTz),
1437            #[prost(message, tag = "11")]
1438            Duration(super::super::value::Duration),
1439            #[prost(message, tag = "12")]
1440            Struct(super::super::value::Struct),
1441        }
1442    }
1443}
1444#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1445pub struct DatabaseManager {}
1446/// Nested message and enum types in `DatabaseManager`.
1447pub mod database_manager {
1448    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1449    pub struct Get {}
1450    /// Nested message and enum types in `Get`.
1451    pub mod get {
1452        #[derive(Clone, PartialEq, ::prost::Message)]
1453        pub struct Req {
1454            #[prost(string, tag = "1")]
1455            pub name: ::prost::alloc::string::String,
1456        }
1457        #[derive(Clone, PartialEq, ::prost::Message)]
1458        pub struct Res {
1459            #[prost(message, optional, tag = "1")]
1460            pub database: ::core::option::Option<super::super::Database>,
1461        }
1462    }
1463    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1464    pub struct All {}
1465    /// Nested message and enum types in `All`.
1466    pub mod all {
1467        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1468        pub struct Req {}
1469        #[derive(Clone, PartialEq, ::prost::Message)]
1470        pub struct Res {
1471            #[prost(message, repeated, tag = "1")]
1472            pub databases: ::prost::alloc::vec::Vec<super::super::Database>,
1473        }
1474    }
1475    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1476    pub struct Contains {}
1477    /// Nested message and enum types in `Contains`.
1478    pub mod contains {
1479        #[derive(Clone, PartialEq, ::prost::Message)]
1480        pub struct Req {
1481            #[prost(string, tag = "1")]
1482            pub name: ::prost::alloc::string::String,
1483        }
1484        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1485        pub struct Res {
1486            #[prost(bool, tag = "1")]
1487            pub contains: bool,
1488        }
1489    }
1490    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1491    pub struct Create {}
1492    /// Nested message and enum types in `Create`.
1493    pub mod create {
1494        #[derive(Clone, PartialEq, ::prost::Message)]
1495        pub struct Req {
1496            #[prost(string, tag = "1")]
1497            pub name: ::prost::alloc::string::String,
1498        }
1499        #[derive(Clone, PartialEq, ::prost::Message)]
1500        pub struct Res {
1501            #[prost(message, optional, tag = "1")]
1502            pub database: ::core::option::Option<super::super::Database>,
1503        }
1504    }
1505    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1506    pub struct Import {}
1507    /// Nested message and enum types in `Import`.
1508    pub mod import {
1509        #[derive(Clone, PartialEq, ::prost::Message)]
1510        pub struct Client {
1511            #[prost(message, optional, tag = "1")]
1512            pub client: ::core::option::Option<super::super::migration::import::Client>,
1513        }
1514        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1515        pub struct Server {
1516            #[prost(message, optional, tag = "1")]
1517            pub server: ::core::option::Option<super::super::migration::import::Server>,
1518        }
1519    }
1520}
1521#[derive(Clone, PartialEq, ::prost::Message)]
1522pub struct Database {
1523    #[prost(string, tag = "1")]
1524    pub name: ::prost::alloc::string::String,
1525}
1526/// Nested message and enum types in `Database`.
1527pub mod database {
1528    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1529    pub struct Schema {}
1530    /// Nested message and enum types in `Schema`.
1531    pub mod schema {
1532        #[derive(Clone, PartialEq, ::prost::Message)]
1533        pub struct Req {
1534            #[prost(string, tag = "1")]
1535            pub name: ::prost::alloc::string::String,
1536        }
1537        #[derive(Clone, PartialEq, ::prost::Message)]
1538        pub struct Res {
1539            #[prost(string, tag = "1")]
1540            pub schema: ::prost::alloc::string::String,
1541        }
1542    }
1543    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1544    pub struct TypeSchema {}
1545    /// Nested message and enum types in `TypeSchema`.
1546    pub mod type_schema {
1547        #[derive(Clone, PartialEq, ::prost::Message)]
1548        pub struct Req {
1549            #[prost(string, tag = "1")]
1550            pub name: ::prost::alloc::string::String,
1551        }
1552        #[derive(Clone, PartialEq, ::prost::Message)]
1553        pub struct Res {
1554            #[prost(string, tag = "1")]
1555            pub schema: ::prost::alloc::string::String,
1556        }
1557    }
1558    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1559    pub struct Export {}
1560    /// Nested message and enum types in `Export`.
1561    pub mod export {
1562        #[derive(Clone, PartialEq, ::prost::Message)]
1563        pub struct Req {
1564            #[prost(message, optional, tag = "1")]
1565            pub req: ::core::option::Option<super::super::migration::export::Req>,
1566        }
1567        #[derive(Clone, PartialEq, ::prost::Message)]
1568        pub struct Server {
1569            #[prost(message, optional, tag = "1")]
1570            pub server: ::core::option::Option<super::super::migration::export::Server>,
1571        }
1572    }
1573    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1574    pub struct Delete {}
1575    /// Nested message and enum types in `Delete`.
1576    pub mod delete {
1577        #[derive(Clone, PartialEq, ::prost::Message)]
1578        pub struct Req {
1579            #[prost(string, tag = "1")]
1580            pub name: ::prost::alloc::string::String,
1581        }
1582        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1583        pub struct Res {}
1584    }
1585}
1586#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1587pub struct ServerManager {}
1588/// Nested message and enum types in `ServerManager`.
1589pub mod server_manager {
1590    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1591    pub struct All {}
1592    /// Nested message and enum types in `All`.
1593    pub mod all {
1594        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1595        pub struct Req {}
1596        #[derive(Clone, PartialEq, ::prost::Message)]
1597        pub struct Res {
1598            #[prost(message, repeated, tag = "1")]
1599            pub servers: ::prost::alloc::vec::Vec<super::super::Server>,
1600        }
1601    }
1602    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1603    pub struct Get {}
1604    /// Nested message and enum types in `Get`.
1605    pub mod get {
1606        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1607        pub struct Req {}
1608        #[derive(Clone, PartialEq, ::prost::Message)]
1609        pub struct Res {
1610            #[prost(message, optional, tag = "1")]
1611            pub server: ::core::option::Option<super::super::Server>,
1612        }
1613    }
1614}
1615#[derive(Clone, PartialEq, ::prost::Message)]
1616pub struct Server {
1617    #[prost(string, optional, tag = "1")]
1618    pub address: ::core::option::Option<::prost::alloc::string::String>,
1619    #[prost(message, optional, tag = "2")]
1620    pub replication_status: ::core::option::Option<server::ReplicationStatus>,
1621}
1622/// Nested message and enum types in `Server`.
1623pub mod server {
1624    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1625    pub struct ReplicationStatus {
1626        #[prost(uint64, tag = "1")]
1627        pub id: u64,
1628        #[prost(enumeration = "replication_status::Role", optional, tag = "2")]
1629        pub role: ::core::option::Option<i32>,
1630        #[prost(uint64, optional, tag = "3")]
1631        pub term: ::core::option::Option<u64>,
1632    }
1633    /// Nested message and enum types in `ReplicationStatus`.
1634    pub mod replication_status {
1635        #[derive(
1636            Clone,
1637            Copy,
1638            Debug,
1639            PartialEq,
1640            Eq,
1641            Hash,
1642            PartialOrd,
1643            Ord,
1644            ::prost::Enumeration
1645        )]
1646        #[repr(i32)]
1647        pub enum Role {
1648            Primary = 0,
1649            Candidate = 1,
1650            Secondary = 2,
1651        }
1652        impl Role {
1653            /// String value of the enum field names used in the ProtoBuf definition.
1654            ///
1655            /// The values are not transformed in any way and thus are considered stable
1656            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1657            pub fn as_str_name(&self) -> &'static str {
1658                match self {
1659                    Self::Primary => "Primary",
1660                    Self::Candidate => "Candidate",
1661                    Self::Secondary => "Secondary",
1662                }
1663            }
1664            /// Creates an enum from field names used in the ProtoBuf definition.
1665            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1666                match value {
1667                    "Primary" => Some(Self::Primary),
1668                    "Candidate" => Some(Self::Candidate),
1669                    "Secondary" => Some(Self::Secondary),
1670                    _ => None,
1671                }
1672            }
1673        }
1674    }
1675    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1676    pub struct Version {}
1677    /// Nested message and enum types in `Version`.
1678    pub mod version {
1679        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1680        pub struct Req {}
1681        #[derive(Clone, PartialEq, ::prost::Message)]
1682        pub struct Res {
1683            #[prost(string, tag = "1")]
1684            pub distribution: ::prost::alloc::string::String,
1685            #[prost(string, tag = "2")]
1686            pub version: ::prost::alloc::string::String,
1687        }
1688    }
1689}
1690#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1691#[repr(i32)]
1692pub enum Version {
1693    Unspecified = 0,
1694    Version = 8,
1695}
1696impl Version {
1697    /// String value of the enum field names used in the ProtoBuf definition.
1698    ///
1699    /// The values are not transformed in any way and thus are considered stable
1700    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1701    pub fn as_str_name(&self) -> &'static str {
1702        match self {
1703            Self::Unspecified => "UNSPECIFIED",
1704            Self::Version => "VERSION",
1705        }
1706    }
1707    /// Creates an enum from field names used in the ProtoBuf definition.
1708    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1709        match value {
1710            "UNSPECIFIED" => Some(Self::Unspecified),
1711            "VERSION" => Some(Self::Version),
1712            _ => None,
1713        }
1714    }
1715}
1716#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1717#[repr(i32)]
1718pub enum ExtensionVersion {
1719    UnspecifiedExtension = 0,
1720    /// Reserving makes little sense here.
1721    Extension = 2,
1722}
1723impl ExtensionVersion {
1724    /// String value of the enum field names used in the ProtoBuf definition.
1725    ///
1726    /// The values are not transformed in any way and thus are considered stable
1727    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1728    pub fn as_str_name(&self) -> &'static str {
1729        match self {
1730            Self::UnspecifiedExtension => "UNSPECIFIED_EXTENSION",
1731            Self::Extension => "EXTENSION",
1732        }
1733    }
1734    /// Creates an enum from field names used in the ProtoBuf definition.
1735    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1736        match value {
1737            "UNSPECIFIED_EXTENSION" => Some(Self::UnspecifiedExtension),
1738            "EXTENSION" => Some(Self::Extension),
1739            _ => None,
1740        }
1741    }
1742}
1743#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1744pub struct Connection {}
1745/// Nested message and enum types in `Connection`.
1746pub mod connection {
1747    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1748    pub struct Open {}
1749    /// Nested message and enum types in `Open`.
1750    pub mod open {
1751        #[derive(Clone, PartialEq, ::prost::Message)]
1752        pub struct Req {
1753            #[prost(enumeration = "super::super::Version", tag = "1")]
1754            pub version: i32,
1755            #[prost(enumeration = "super::super::ExtensionVersion", tag = "5")]
1756            pub extension_version: i32,
1757            #[prost(string, tag = "2")]
1758            pub driver_lang: ::prost::alloc::string::String,
1759            #[prost(string, tag = "3")]
1760            pub driver_version: ::prost::alloc::string::String,
1761            #[prost(message, optional, tag = "4")]
1762            pub authentication: ::core::option::Option<
1763                super::super::authentication::token::create::Req,
1764            >,
1765        }
1766        #[derive(Clone, PartialEq, ::prost::Message)]
1767        pub struct Res {
1768            #[prost(uint64, tag = "1")]
1769            pub server_duration_millis: u64,
1770            #[prost(message, optional, tag = "2")]
1771            pub connection_id: ::core::option::Option<super::super::ConnectionId>,
1772            #[prost(message, optional, tag = "3")]
1773            pub servers_all: ::core::option::Option<
1774                super::super::server_manager::all::Res,
1775            >,
1776            #[prost(message, optional, tag = "4")]
1777            pub authentication: ::core::option::Option<
1778                super::super::authentication::token::create::Res,
1779            >,
1780        }
1781    }
1782}
1783#[derive(Clone, PartialEq, ::prost::Message)]
1784pub struct ConnectionId {
1785    #[prost(bytes = "vec", tag = "1")]
1786    pub id: ::prost::alloc::vec::Vec<u8>,
1787}
1788#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1789pub struct Query {}
1790/// Nested message and enum types in `Query`.
1791pub mod query {
1792    #[derive(Clone, PartialEq, ::prost::Message)]
1793    pub struct Req {
1794        #[prost(message, optional, tag = "1")]
1795        pub options: ::core::option::Option<super::options::Query>,
1796        #[prost(string, tag = "2")]
1797        pub query: ::prost::alloc::string::String,
1798        #[prost(message, optional, tag = "3")]
1799        pub given: ::core::option::Option<req::GivenRows>,
1800    }
1801    /// Nested message and enum types in `Req`.
1802    pub mod req {
1803        #[derive(Clone, PartialEq, ::prost::Message)]
1804        pub struct GivenRows {
1805            #[prost(string, repeated, tag = "1")]
1806            pub variables: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1807            #[prost(message, repeated, tag = "2")]
1808            pub rows: ::prost::alloc::vec::Vec<GivenRow>,
1809        }
1810        #[derive(Clone, PartialEq, ::prost::Message)]
1811        pub struct GivenRow {
1812            #[prost(message, repeated, tag = "1")]
1813            pub entries: ::prost::alloc::vec::Vec<GivenEntry>,
1814        }
1815        #[derive(Clone, PartialEq, ::prost::Message)]
1816        pub struct GivenEntry {
1817            #[prost(oneof = "given_entry::Entry", tags = "1, 2, 3")]
1818            pub entry: ::core::option::Option<given_entry::Entry>,
1819        }
1820        /// Nested message and enum types in `GivenEntry`.
1821        pub mod given_entry {
1822            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1823            pub struct EmptyEntry {}
1824            #[derive(Clone, PartialEq, ::prost::Oneof)]
1825            pub enum Entry {
1826                /// Optional None
1827                #[prost(message, tag = "1")]
1828                Empty(EmptyEntry),
1829                #[prost(message, tag = "2")]
1830                Value(super::super::super::Value),
1831                #[prost(message, tag = "3")]
1832                Thing(super::super::super::Thing),
1833            }
1834        }
1835    }
1836    #[derive(Clone, PartialEq, ::prost::Message)]
1837    pub struct InitialRes {
1838        #[prost(oneof = "initial_res::Res", tags = "1, 2")]
1839        pub res: ::core::option::Option<initial_res::Res>,
1840    }
1841    /// Nested message and enum types in `InitialRes`.
1842    pub mod initial_res {
1843        #[derive(Clone, PartialEq, ::prost::Message)]
1844        pub struct Ok {
1845            #[prost(oneof = "ok::Ok", tags = "1, 3, 4")]
1846            pub ok: ::core::option::Option<ok::Ok>,
1847        }
1848        /// Nested message and enum types in `Ok`.
1849        pub mod ok {
1850            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1851            pub struct Done {
1852                #[prost(enumeration = "super::super::Type", tag = "1")]
1853                pub query_type: i32,
1854            }
1855            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1856            pub struct ConceptDocumentStream {
1857                /// note: we could use this first response to record debug info, type annotations, warnings, etc
1858                /// TODO: network optimisation: replace keys with IDs, sending keys in the header to rebuild the document on the client side
1859                /// TODO: network optimisation: replace types (== mostly constant strings) with a IDs, sending types in the header to rebuild on the client side
1860                #[prost(enumeration = "super::super::Type", tag = "2")]
1861                pub query_type: i32,
1862            }
1863            #[derive(Clone, PartialEq, ::prost::Message)]
1864            pub struct ConceptRowStream {
1865                /// TODO: network optimisation: replace types (== mostly constant strings) with a IDs, sending types in the header to rebuild on the client side
1866                #[prost(string, repeated, tag = "1")]
1867                pub column_variable_names: ::prost::alloc::vec::Vec<
1868                    ::prost::alloc::string::String,
1869                >,
1870                #[prost(enumeration = "super::super::Type", tag = "2")]
1871                pub query_type: i32,
1872                #[prost(message, optional, tag = "3")]
1873                pub query_structure: ::core::option::Option<
1874                    super::super::super::analyze::res::analyzed_query::Pipeline,
1875                >,
1876            }
1877            #[derive(Clone, PartialEq, ::prost::Oneof)]
1878            pub enum Ok {
1879                #[prost(message, tag = "1")]
1880                Done(Done),
1881                #[prost(message, tag = "3")]
1882                ConceptDocumentStream(ConceptDocumentStream),
1883                #[prost(message, tag = "4")]
1884                ConceptRowStream(ConceptRowStream),
1885            }
1886        }
1887        #[derive(Clone, PartialEq, ::prost::Oneof)]
1888        pub enum Res {
1889            #[prost(message, tag = "1")]
1890            Error(super::super::Error),
1891            #[prost(message, tag = "2")]
1892            Ok(Ok),
1893        }
1894    }
1895    #[derive(Clone, PartialEq, ::prost::Message)]
1896    pub struct ResPart {
1897        #[prost(oneof = "res_part::Res", tags = "1, 2")]
1898        pub res: ::core::option::Option<res_part::Res>,
1899    }
1900    /// Nested message and enum types in `ResPart`.
1901    pub mod res_part {
1902        #[derive(Clone, PartialEq, ::prost::Message)]
1903        pub struct ConceptDocumentsRes {
1904            #[prost(message, repeated, tag = "1")]
1905            pub documents: ::prost::alloc::vec::Vec<super::super::ConceptDocument>,
1906        }
1907        #[derive(Clone, PartialEq, ::prost::Message)]
1908        pub struct ConceptRowsRes {
1909            #[prost(message, repeated, tag = "1")]
1910            pub rows: ::prost::alloc::vec::Vec<super::super::ConceptRow>,
1911        }
1912        #[derive(Clone, PartialEq, ::prost::Oneof)]
1913        pub enum Res {
1914            #[prost(message, tag = "1")]
1915            DocumentsRes(ConceptDocumentsRes),
1916            #[prost(message, tag = "2")]
1917            RowsRes(ConceptRowsRes),
1918        }
1919    }
1920    #[derive(
1921        Clone,
1922        Copy,
1923        Debug,
1924        PartialEq,
1925        Eq,
1926        Hash,
1927        PartialOrd,
1928        Ord,
1929        ::prost::Enumeration
1930    )]
1931    #[repr(i32)]
1932    pub enum Type {
1933        Read = 0,
1934        Write = 1,
1935        Schema = 2,
1936    }
1937    impl Type {
1938        /// String value of the enum field names used in the ProtoBuf definition.
1939        ///
1940        /// The values are not transformed in any way and thus are considered stable
1941        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1942        pub fn as_str_name(&self) -> &'static str {
1943            match self {
1944                Self::Read => "READ",
1945                Self::Write => "WRITE",
1946                Self::Schema => "SCHEMA",
1947            }
1948        }
1949        /// Creates an enum from field names used in the ProtoBuf definition.
1950        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1951            match value {
1952                "READ" => Some(Self::Read),
1953                "WRITE" => Some(Self::Write),
1954                "SCHEMA" => Some(Self::Schema),
1955                _ => None,
1956            }
1957        }
1958    }
1959}
1960#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1961pub struct Transaction {}
1962/// Nested message and enum types in `Transaction`.
1963pub mod transaction {
1964    #[derive(Clone, PartialEq, ::prost::Message)]
1965    pub struct Client {
1966        #[prost(message, repeated, tag = "1")]
1967        pub reqs: ::prost::alloc::vec::Vec<Req>,
1968    }
1969    #[derive(Clone, PartialEq, ::prost::Message)]
1970    pub struct Server {
1971        #[prost(oneof = "server::Server", tags = "1, 2")]
1972        pub server: ::core::option::Option<server::Server>,
1973    }
1974    /// Nested message and enum types in `Server`.
1975    pub mod server {
1976        #[derive(Clone, PartialEq, ::prost::Oneof)]
1977        pub enum Server {
1978            #[prost(message, tag = "1")]
1979            Res(super::Res),
1980            #[prost(message, tag = "2")]
1981            ResPart(super::ResPart),
1982        }
1983    }
1984    #[derive(Clone, PartialEq, ::prost::Message)]
1985    pub struct Req {
1986        #[prost(bytes = "vec", tag = "1")]
1987        pub req_id: ::prost::alloc::vec::Vec<u8>,
1988        #[prost(map = "string, string", tag = "2")]
1989        pub metadata: ::std::collections::HashMap<
1990            ::prost::alloc::string::String,
1991            ::prost::alloc::string::String,
1992        >,
1993        #[prost(oneof = "req::Req", tags = "3, 4, 5, 6, 7, 8, 9")]
1994        pub req: ::core::option::Option<req::Req>,
1995    }
1996    /// Nested message and enum types in `Req`.
1997    pub mod req {
1998        #[derive(Clone, PartialEq, ::prost::Oneof)]
1999        pub enum Req {
2000            #[prost(message, tag = "3")]
2001            OpenReq(super::open::Req),
2002            #[prost(message, tag = "4")]
2003            QueryReq(super::super::query::Req),
2004            #[prost(message, tag = "5")]
2005            StreamReq(super::stream_signal::Req),
2006            #[prost(message, tag = "6")]
2007            CommitReq(super::commit::Req),
2008            #[prost(message, tag = "7")]
2009            RollbackReq(super::rollback::Req),
2010            #[prost(message, tag = "8")]
2011            CloseReq(super::close::Req),
2012            #[prost(message, tag = "9")]
2013            AnalyzeReq(super::super::analyze::Req),
2014        }
2015    }
2016    #[derive(Clone, PartialEq, ::prost::Message)]
2017    pub struct Res {
2018        #[prost(bytes = "vec", tag = "1")]
2019        pub req_id: ::prost::alloc::vec::Vec<u8>,
2020        #[prost(oneof = "res::Res", tags = "2, 3, 5, 6, 9")]
2021        pub res: ::core::option::Option<res::Res>,
2022    }
2023    /// Nested message and enum types in `Res`.
2024    pub mod res {
2025        #[derive(Clone, PartialEq, ::prost::Oneof)]
2026        pub enum Res {
2027            #[prost(message, tag = "2")]
2028            OpenRes(super::open::Res),
2029            #[prost(message, tag = "3")]
2030            QueryInitialRes(super::super::query::InitialRes),
2031            #[prost(message, tag = "5")]
2032            CommitRes(super::commit::Res),
2033            #[prost(message, tag = "6")]
2034            RollbackRes(super::rollback::Res),
2035            #[prost(message, tag = "9")]
2036            AnalyzeRes(super::super::analyze::Res),
2037        }
2038    }
2039    #[derive(Clone, PartialEq, ::prost::Message)]
2040    pub struct ResPart {
2041        #[prost(bytes = "vec", tag = "1")]
2042        pub req_id: ::prost::alloc::vec::Vec<u8>,
2043        #[prost(oneof = "res_part::ResPart", tags = "2, 3")]
2044        pub res_part: ::core::option::Option<res_part::ResPart>,
2045    }
2046    /// Nested message and enum types in `ResPart`.
2047    pub mod res_part {
2048        #[derive(Clone, PartialEq, ::prost::Oneof)]
2049        pub enum ResPart {
2050            #[prost(message, tag = "2")]
2051            QueryRes(super::super::query::ResPart),
2052            #[prost(message, tag = "3")]
2053            StreamRes(super::stream_signal::ResPart),
2054        }
2055    }
2056    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2057    pub struct Open {}
2058    /// Nested message and enum types in `Open`.
2059    pub mod open {
2060        #[derive(Clone, PartialEq, ::prost::Message)]
2061        pub struct Req {
2062            #[prost(string, tag = "1")]
2063            pub database: ::prost::alloc::string::String,
2064            #[prost(enumeration = "super::Type", tag = "2")]
2065            pub r#type: i32,
2066            #[prost(message, optional, tag = "3")]
2067            pub options: ::core::option::Option<super::super::options::Transaction>,
2068            #[prost(uint64, tag = "4")]
2069            pub network_latency_millis: u64,
2070        }
2071        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2072        pub struct Res {
2073            #[prost(uint64, tag = "2")]
2074            pub server_duration_millis: u64,
2075        }
2076    }
2077    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2078    pub struct Commit {}
2079    /// Nested message and enum types in `Commit`.
2080    pub mod commit {
2081        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2082        pub struct Req {}
2083        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2084        pub struct Res {}
2085    }
2086    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2087    pub struct Rollback {}
2088    /// Nested message and enum types in `Rollback`.
2089    pub mod rollback {
2090        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2091        pub struct Req {}
2092        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2093        pub struct Res {}
2094    }
2095    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2096    pub struct Close {}
2097    /// Nested message and enum types in `Close`.
2098    pub mod close {
2099        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2100        pub struct Req {}
2101        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2102        pub struct Res {}
2103    }
2104    /// TODO: When actually used, should be probably merged with Error from error.proto
2105    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2106    pub struct GetSchemaExceptions {}
2107    /// Nested message and enum types in `GetSchemaExceptions`.
2108    pub mod get_schema_exceptions {
2109        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2110        pub struct Req {}
2111        #[derive(Clone, PartialEq, ::prost::Message)]
2112        pub struct Res {
2113            #[prost(message, repeated, tag = "1")]
2114            pub exceptions: ::prost::alloc::vec::Vec<super::SchemaException>,
2115        }
2116    }
2117    #[derive(Clone, PartialEq, ::prost::Message)]
2118    pub struct SchemaException {
2119        #[prost(string, tag = "1")]
2120        pub code: ::prost::alloc::string::String,
2121        #[prost(string, tag = "2")]
2122        pub message: ::prost::alloc::string::String,
2123    }
2124    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2125    pub struct StreamSignal {}
2126    /// Nested message and enum types in `StreamSignal`.
2127    pub mod stream_signal {
2128        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2129        pub struct Req {}
2130        #[derive(Clone, PartialEq, ::prost::Message)]
2131        pub struct ResPart {
2132            #[prost(oneof = "res_part::State", tags = "1, 2, 3")]
2133            pub state: ::core::option::Option<res_part::State>,
2134        }
2135        /// Nested message and enum types in `ResPart`.
2136        pub mod res_part {
2137            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2138            pub struct Continue {}
2139            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2140            pub struct Done {}
2141            #[derive(Clone, PartialEq, ::prost::Oneof)]
2142            pub enum State {
2143                #[prost(message, tag = "1")]
2144                Continue(Continue),
2145                #[prost(message, tag = "2")]
2146                Done(Done),
2147                #[prost(message, tag = "3")]
2148                Error(super::super::super::Error),
2149            }
2150        }
2151    }
2152    #[derive(
2153        Clone,
2154        Copy,
2155        Debug,
2156        PartialEq,
2157        Eq,
2158        Hash,
2159        PartialOrd,
2160        Ord,
2161        ::prost::Enumeration
2162    )]
2163    #[repr(i32)]
2164    pub enum Type {
2165        Read = 0,
2166        Write = 1,
2167        Schema = 2,
2168    }
2169    impl Type {
2170        /// String value of the enum field names used in the ProtoBuf definition.
2171        ///
2172        /// The values are not transformed in any way and thus are considered stable
2173        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2174        pub fn as_str_name(&self) -> &'static str {
2175            match self {
2176                Self::Read => "READ",
2177                Self::Write => "WRITE",
2178                Self::Schema => "SCHEMA",
2179            }
2180        }
2181        /// Creates an enum from field names used in the ProtoBuf definition.
2182        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2183            match value {
2184                "READ" => Some(Self::Read),
2185                "WRITE" => Some(Self::Write),
2186                "SCHEMA" => Some(Self::Schema),
2187                _ => None,
2188            }
2189        }
2190    }
2191}
2192#[derive(Clone, Copy, PartialEq, ::prost::Message)]
2193pub struct UserManager {}
2194/// Nested message and enum types in `UserManager`.
2195pub mod user_manager {
2196    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2197    pub struct All {}
2198    /// Nested message and enum types in `All`.
2199    pub mod all {
2200        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2201        pub struct Req {}
2202        #[derive(Clone, PartialEq, ::prost::Message)]
2203        pub struct Res {
2204            #[prost(message, repeated, tag = "1")]
2205            pub users: ::prost::alloc::vec::Vec<super::super::User>,
2206        }
2207    }
2208    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2209    pub struct Contains {}
2210    /// Nested message and enum types in `Contains`.
2211    pub mod contains {
2212        #[derive(Clone, PartialEq, ::prost::Message)]
2213        pub struct Req {
2214            #[prost(string, tag = "1")]
2215            pub name: ::prost::alloc::string::String,
2216        }
2217        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2218        pub struct Res {
2219            #[prost(bool, tag = "1")]
2220            pub contains: bool,
2221        }
2222    }
2223    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2224    pub struct Get {}
2225    /// Nested message and enum types in `Get`.
2226    pub mod get {
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, PartialEq, ::prost::Message)]
2233        pub struct Res {
2234            #[prost(message, optional, tag = "1")]
2235            pub user: ::core::option::Option<super::super::User>,
2236        }
2237    }
2238    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2239    pub struct Create {}
2240    /// Nested message and enum types in `Create`.
2241    pub mod create {
2242        #[derive(Clone, PartialEq, ::prost::Message)]
2243        pub struct Req {
2244            #[prost(message, optional, tag = "1")]
2245            pub user: ::core::option::Option<super::super::User>,
2246        }
2247        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2248        pub struct Res {}
2249    }
2250}
2251#[derive(Clone, PartialEq, ::prost::Message)]
2252pub struct User {
2253    #[prost(string, tag = "1")]
2254    pub name: ::prost::alloc::string::String,
2255    #[prost(string, optional, tag = "2")]
2256    pub password: ::core::option::Option<::prost::alloc::string::String>,
2257}
2258/// Nested message and enum types in `User`.
2259pub mod user {
2260    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2261    pub struct Update {}
2262    /// Nested message and enum types in `Update`.
2263    pub mod update {
2264        #[derive(Clone, PartialEq, ::prost::Message)]
2265        pub struct Req {
2266            #[prost(string, tag = "1")]
2267            pub name: ::prost::alloc::string::String,
2268            #[prost(message, optional, tag = "2")]
2269            pub user: ::core::option::Option<super::super::User>,
2270        }
2271        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2272        pub struct Res {}
2273    }
2274    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2275    pub struct Delete {}
2276    /// Nested message and enum types in `Delete`.
2277    pub mod delete {
2278        #[derive(Clone, PartialEq, ::prost::Message)]
2279        pub struct Req {
2280            #[prost(string, tag = "1")]
2281            pub name: ::prost::alloc::string::String,
2282        }
2283        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
2284        pub struct Res {}
2285    }
2286}
2287/// Generated client implementations.
2288#[allow(non_camel_case_types)]
2289pub mod type_db_client {
2290    #![allow(
2291        unused_variables,
2292        dead_code,
2293        missing_docs,
2294        clippy::wildcard_imports,
2295        clippy::let_unit_value,
2296    )]
2297    use tonic::codegen::*;
2298    use tonic::codegen::http::Uri;
2299    #[derive(Debug, Clone)]
2300    pub struct TypeDbClient<T> {
2301        inner: tonic::client::Grpc<T>,
2302    }
2303    impl TypeDbClient<tonic::transport::Channel> {
2304        /// Attempt to create a new client by connecting to a given endpoint.
2305        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2306        where
2307            D: TryInto<tonic::transport::Endpoint>,
2308            D::Error: Into<StdError>,
2309        {
2310            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2311            Ok(Self::new(conn))
2312        }
2313    }
2314    impl<T> TypeDbClient<T>
2315    where
2316        T: tonic::client::GrpcService<tonic::body::BoxBody>,
2317        T::Error: Into<StdError>,
2318        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2319        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2320    {
2321        pub fn new(inner: T) -> Self {
2322            let inner = tonic::client::Grpc::new(inner);
2323            Self { inner }
2324        }
2325        pub fn with_origin(inner: T, origin: Uri) -> Self {
2326            let inner = tonic::client::Grpc::with_origin(inner, origin);
2327            Self { inner }
2328        }
2329        pub fn with_interceptor<F>(
2330            inner: T,
2331            interceptor: F,
2332        ) -> TypeDbClient<InterceptedService<T, F>>
2333        where
2334            F: tonic::service::Interceptor,
2335            T::ResponseBody: Default,
2336            T: tonic::codegen::Service<
2337                http::Request<tonic::body::BoxBody>,
2338                Response = http::Response<
2339                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
2340                >,
2341            >,
2342            <T as tonic::codegen::Service<
2343                http::Request<tonic::body::BoxBody>,
2344            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2345        {
2346            TypeDbClient::new(InterceptedService::new(inner, interceptor))
2347        }
2348        /// Compress requests with the given encoding.
2349        ///
2350        /// This requires the server to support it otherwise it might respond with an
2351        /// error.
2352        #[must_use]
2353        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2354            self.inner = self.inner.send_compressed(encoding);
2355            self
2356        }
2357        /// Enable decompressing responses.
2358        #[must_use]
2359        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2360            self.inner = self.inner.accept_compressed(encoding);
2361            self
2362        }
2363        /// Limits the maximum size of a decoded message.
2364        ///
2365        /// Default: `4MB`
2366        #[must_use]
2367        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2368            self.inner = self.inner.max_decoding_message_size(limit);
2369            self
2370        }
2371        /// Limits the maximum size of an encoded message.
2372        ///
2373        /// Default: `usize::MAX`
2374        #[must_use]
2375        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2376            self.inner = self.inner.max_encoding_message_size(limit);
2377            self
2378        }
2379        /// Connection API
2380        pub async fn connection_open(
2381            &mut self,
2382            request: impl tonic::IntoRequest<super::connection::open::Req>,
2383        ) -> std::result::Result<
2384            tonic::Response<super::connection::open::Res>,
2385            tonic::Status,
2386        > {
2387            self.inner
2388                .ready()
2389                .await
2390                .map_err(|e| {
2391                    tonic::Status::unknown(
2392                        format!("Service was not ready: {}", e.into()),
2393                    )
2394                })?;
2395            let codec = tonic::codec::ProstCodec::default();
2396            let path = http::uri::PathAndQuery::from_static(
2397                "/typedb.protocol.TypeDB/connection_open",
2398            );
2399            let mut req = request.into_request();
2400            req.extensions_mut()
2401                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "connection_open"));
2402            self.inner.unary(req, path, codec).await
2403        }
2404        /// Authentication API
2405        pub async fn authentication_token_create(
2406            &mut self,
2407            request: impl tonic::IntoRequest<super::authentication::token::create::Req>,
2408        ) -> std::result::Result<
2409            tonic::Response<super::authentication::token::create::Res>,
2410            tonic::Status,
2411        > {
2412            self.inner
2413                .ready()
2414                .await
2415                .map_err(|e| {
2416                    tonic::Status::unknown(
2417                        format!("Service was not ready: {}", e.into()),
2418                    )
2419                })?;
2420            let codec = tonic::codec::ProstCodec::default();
2421            let path = http::uri::PathAndQuery::from_static(
2422                "/typedb.protocol.TypeDB/authentication_token_create",
2423            );
2424            let mut req = request.into_request();
2425            req.extensions_mut()
2426                .insert(
2427                    GrpcMethod::new(
2428                        "typedb.protocol.TypeDB",
2429                        "authentication_token_create",
2430                    ),
2431                );
2432            self.inner.unary(req, path, codec).await
2433        }
2434        /// Server Manager API
2435        pub async fn servers_all(
2436            &mut self,
2437            request: impl tonic::IntoRequest<super::server_manager::all::Req>,
2438        ) -> std::result::Result<
2439            tonic::Response<super::server_manager::all::Res>,
2440            tonic::Status,
2441        > {
2442            self.inner
2443                .ready()
2444                .await
2445                .map_err(|e| {
2446                    tonic::Status::unknown(
2447                        format!("Service was not ready: {}", e.into()),
2448                    )
2449                })?;
2450            let codec = tonic::codec::ProstCodec::default();
2451            let path = http::uri::PathAndQuery::from_static(
2452                "/typedb.protocol.TypeDB/servers_all",
2453            );
2454            let mut req = request.into_request();
2455            req.extensions_mut()
2456                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "servers_all"));
2457            self.inner.unary(req, path, codec).await
2458        }
2459        pub async fn servers_get(
2460            &mut self,
2461            request: impl tonic::IntoRequest<super::server_manager::get::Req>,
2462        ) -> std::result::Result<
2463            tonic::Response<super::server_manager::get::Res>,
2464            tonic::Status,
2465        > {
2466            self.inner
2467                .ready()
2468                .await
2469                .map_err(|e| {
2470                    tonic::Status::unknown(
2471                        format!("Service was not ready: {}", e.into()),
2472                    )
2473                })?;
2474            let codec = tonic::codec::ProstCodec::default();
2475            let path = http::uri::PathAndQuery::from_static(
2476                "/typedb.protocol.TypeDB/servers_get",
2477            );
2478            let mut req = request.into_request();
2479            req.extensions_mut()
2480                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "servers_get"));
2481            self.inner.unary(req, path, codec).await
2482        }
2483        /// Server API
2484        pub async fn server_version(
2485            &mut self,
2486            request: impl tonic::IntoRequest<super::server::version::Req>,
2487        ) -> std::result::Result<
2488            tonic::Response<super::server::version::Res>,
2489            tonic::Status,
2490        > {
2491            self.inner
2492                .ready()
2493                .await
2494                .map_err(|e| {
2495                    tonic::Status::unknown(
2496                        format!("Service was not ready: {}", e.into()),
2497                    )
2498                })?;
2499            let codec = tonic::codec::ProstCodec::default();
2500            let path = http::uri::PathAndQuery::from_static(
2501                "/typedb.protocol.TypeDB/server_version",
2502            );
2503            let mut req = request.into_request();
2504            req.extensions_mut()
2505                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "server_version"));
2506            self.inner.unary(req, path, codec).await
2507        }
2508        /// User Manager API
2509        pub async fn users_get(
2510            &mut self,
2511            request: impl tonic::IntoRequest<super::user_manager::get::Req>,
2512        ) -> std::result::Result<
2513            tonic::Response<super::user_manager::get::Res>,
2514            tonic::Status,
2515        > {
2516            self.inner
2517                .ready()
2518                .await
2519                .map_err(|e| {
2520                    tonic::Status::unknown(
2521                        format!("Service was not ready: {}", e.into()),
2522                    )
2523                })?;
2524            let codec = tonic::codec::ProstCodec::default();
2525            let path = http::uri::PathAndQuery::from_static(
2526                "/typedb.protocol.TypeDB/users_get",
2527            );
2528            let mut req = request.into_request();
2529            req.extensions_mut()
2530                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "users_get"));
2531            self.inner.unary(req, path, codec).await
2532        }
2533        pub async fn users_all(
2534            &mut self,
2535            request: impl tonic::IntoRequest<super::user_manager::all::Req>,
2536        ) -> std::result::Result<
2537            tonic::Response<super::user_manager::all::Res>,
2538            tonic::Status,
2539        > {
2540            self.inner
2541                .ready()
2542                .await
2543                .map_err(|e| {
2544                    tonic::Status::unknown(
2545                        format!("Service was not ready: {}", e.into()),
2546                    )
2547                })?;
2548            let codec = tonic::codec::ProstCodec::default();
2549            let path = http::uri::PathAndQuery::from_static(
2550                "/typedb.protocol.TypeDB/users_all",
2551            );
2552            let mut req = request.into_request();
2553            req.extensions_mut()
2554                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "users_all"));
2555            self.inner.unary(req, path, codec).await
2556        }
2557        pub async fn users_contains(
2558            &mut self,
2559            request: impl tonic::IntoRequest<super::user_manager::contains::Req>,
2560        ) -> std::result::Result<
2561            tonic::Response<super::user_manager::contains::Res>,
2562            tonic::Status,
2563        > {
2564            self.inner
2565                .ready()
2566                .await
2567                .map_err(|e| {
2568                    tonic::Status::unknown(
2569                        format!("Service was not ready: {}", e.into()),
2570                    )
2571                })?;
2572            let codec = tonic::codec::ProstCodec::default();
2573            let path = http::uri::PathAndQuery::from_static(
2574                "/typedb.protocol.TypeDB/users_contains",
2575            );
2576            let mut req = request.into_request();
2577            req.extensions_mut()
2578                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "users_contains"));
2579            self.inner.unary(req, path, codec).await
2580        }
2581        pub async fn users_create(
2582            &mut self,
2583            request: impl tonic::IntoRequest<super::user_manager::create::Req>,
2584        ) -> std::result::Result<
2585            tonic::Response<super::user_manager::create::Res>,
2586            tonic::Status,
2587        > {
2588            self.inner
2589                .ready()
2590                .await
2591                .map_err(|e| {
2592                    tonic::Status::unknown(
2593                        format!("Service was not ready: {}", e.into()),
2594                    )
2595                })?;
2596            let codec = tonic::codec::ProstCodec::default();
2597            let path = http::uri::PathAndQuery::from_static(
2598                "/typedb.protocol.TypeDB/users_create",
2599            );
2600            let mut req = request.into_request();
2601            req.extensions_mut()
2602                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "users_create"));
2603            self.inner.unary(req, path, codec).await
2604        }
2605        /// User API
2606        pub async fn users_update(
2607            &mut self,
2608            request: impl tonic::IntoRequest<super::user::update::Req>,
2609        ) -> std::result::Result<
2610            tonic::Response<super::user::update::Res>,
2611            tonic::Status,
2612        > {
2613            self.inner
2614                .ready()
2615                .await
2616                .map_err(|e| {
2617                    tonic::Status::unknown(
2618                        format!("Service was not ready: {}", e.into()),
2619                    )
2620                })?;
2621            let codec = tonic::codec::ProstCodec::default();
2622            let path = http::uri::PathAndQuery::from_static(
2623                "/typedb.protocol.TypeDB/users_update",
2624            );
2625            let mut req = request.into_request();
2626            req.extensions_mut()
2627                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "users_update"));
2628            self.inner.unary(req, path, codec).await
2629        }
2630        pub async fn users_delete(
2631            &mut self,
2632            request: impl tonic::IntoRequest<super::user::delete::Req>,
2633        ) -> std::result::Result<
2634            tonic::Response<super::user::delete::Res>,
2635            tonic::Status,
2636        > {
2637            self.inner
2638                .ready()
2639                .await
2640                .map_err(|e| {
2641                    tonic::Status::unknown(
2642                        format!("Service was not ready: {}", e.into()),
2643                    )
2644                })?;
2645            let codec = tonic::codec::ProstCodec::default();
2646            let path = http::uri::PathAndQuery::from_static(
2647                "/typedb.protocol.TypeDB/users_delete",
2648            );
2649            let mut req = request.into_request();
2650            req.extensions_mut()
2651                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "users_delete"));
2652            self.inner.unary(req, path, codec).await
2653        }
2654        /// Database Manager API
2655        pub async fn databases_get(
2656            &mut self,
2657            request: impl tonic::IntoRequest<super::database_manager::get::Req>,
2658        ) -> std::result::Result<
2659            tonic::Response<super::database_manager::get::Res>,
2660            tonic::Status,
2661        > {
2662            self.inner
2663                .ready()
2664                .await
2665                .map_err(|e| {
2666                    tonic::Status::unknown(
2667                        format!("Service was not ready: {}", e.into()),
2668                    )
2669                })?;
2670            let codec = tonic::codec::ProstCodec::default();
2671            let path = http::uri::PathAndQuery::from_static(
2672                "/typedb.protocol.TypeDB/databases_get",
2673            );
2674            let mut req = request.into_request();
2675            req.extensions_mut()
2676                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "databases_get"));
2677            self.inner.unary(req, path, codec).await
2678        }
2679        pub async fn databases_all(
2680            &mut self,
2681            request: impl tonic::IntoRequest<super::database_manager::all::Req>,
2682        ) -> std::result::Result<
2683            tonic::Response<super::database_manager::all::Res>,
2684            tonic::Status,
2685        > {
2686            self.inner
2687                .ready()
2688                .await
2689                .map_err(|e| {
2690                    tonic::Status::unknown(
2691                        format!("Service was not ready: {}", e.into()),
2692                    )
2693                })?;
2694            let codec = tonic::codec::ProstCodec::default();
2695            let path = http::uri::PathAndQuery::from_static(
2696                "/typedb.protocol.TypeDB/databases_all",
2697            );
2698            let mut req = request.into_request();
2699            req.extensions_mut()
2700                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "databases_all"));
2701            self.inner.unary(req, path, codec).await
2702        }
2703        pub async fn databases_contains(
2704            &mut self,
2705            request: impl tonic::IntoRequest<super::database_manager::contains::Req>,
2706        ) -> std::result::Result<
2707            tonic::Response<super::database_manager::contains::Res>,
2708            tonic::Status,
2709        > {
2710            self.inner
2711                .ready()
2712                .await
2713                .map_err(|e| {
2714                    tonic::Status::unknown(
2715                        format!("Service was not ready: {}", e.into()),
2716                    )
2717                })?;
2718            let codec = tonic::codec::ProstCodec::default();
2719            let path = http::uri::PathAndQuery::from_static(
2720                "/typedb.protocol.TypeDB/databases_contains",
2721            );
2722            let mut req = request.into_request();
2723            req.extensions_mut()
2724                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "databases_contains"));
2725            self.inner.unary(req, path, codec).await
2726        }
2727        pub async fn databases_create(
2728            &mut self,
2729            request: impl tonic::IntoRequest<super::database_manager::create::Req>,
2730        ) -> std::result::Result<
2731            tonic::Response<super::database_manager::create::Res>,
2732            tonic::Status,
2733        > {
2734            self.inner
2735                .ready()
2736                .await
2737                .map_err(|e| {
2738                    tonic::Status::unknown(
2739                        format!("Service was not ready: {}", e.into()),
2740                    )
2741                })?;
2742            let codec = tonic::codec::ProstCodec::default();
2743            let path = http::uri::PathAndQuery::from_static(
2744                "/typedb.protocol.TypeDB/databases_create",
2745            );
2746            let mut req = request.into_request();
2747            req.extensions_mut()
2748                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "databases_create"));
2749            self.inner.unary(req, path, codec).await
2750        }
2751        pub async fn databases_import(
2752            &mut self,
2753            request: impl tonic::IntoStreamingRequest<
2754                Message = super::database_manager::import::Client,
2755            >,
2756        ) -> std::result::Result<
2757            tonic::Response<
2758                tonic::codec::Streaming<super::database_manager::import::Server>,
2759            >,
2760            tonic::Status,
2761        > {
2762            self.inner
2763                .ready()
2764                .await
2765                .map_err(|e| {
2766                    tonic::Status::unknown(
2767                        format!("Service was not ready: {}", e.into()),
2768                    )
2769                })?;
2770            let codec = tonic::codec::ProstCodec::default();
2771            let path = http::uri::PathAndQuery::from_static(
2772                "/typedb.protocol.TypeDB/databases_import",
2773            );
2774            let mut req = request.into_streaming_request();
2775            req.extensions_mut()
2776                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "databases_import"));
2777            self.inner.streaming(req, path, codec).await
2778        }
2779        /// Database API
2780        pub async fn database_schema(
2781            &mut self,
2782            request: impl tonic::IntoRequest<super::database::schema::Req>,
2783        ) -> std::result::Result<
2784            tonic::Response<super::database::schema::Res>,
2785            tonic::Status,
2786        > {
2787            self.inner
2788                .ready()
2789                .await
2790                .map_err(|e| {
2791                    tonic::Status::unknown(
2792                        format!("Service was not ready: {}", e.into()),
2793                    )
2794                })?;
2795            let codec = tonic::codec::ProstCodec::default();
2796            let path = http::uri::PathAndQuery::from_static(
2797                "/typedb.protocol.TypeDB/database_schema",
2798            );
2799            let mut req = request.into_request();
2800            req.extensions_mut()
2801                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "database_schema"));
2802            self.inner.unary(req, path, codec).await
2803        }
2804        pub async fn database_type_schema(
2805            &mut self,
2806            request: impl tonic::IntoRequest<super::database::type_schema::Req>,
2807        ) -> std::result::Result<
2808            tonic::Response<super::database::type_schema::Res>,
2809            tonic::Status,
2810        > {
2811            self.inner
2812                .ready()
2813                .await
2814                .map_err(|e| {
2815                    tonic::Status::unknown(
2816                        format!("Service was not ready: {}", e.into()),
2817                    )
2818                })?;
2819            let codec = tonic::codec::ProstCodec::default();
2820            let path = http::uri::PathAndQuery::from_static(
2821                "/typedb.protocol.TypeDB/database_type_schema",
2822            );
2823            let mut req = request.into_request();
2824            req.extensions_mut()
2825                .insert(
2826                    GrpcMethod::new("typedb.protocol.TypeDB", "database_type_schema"),
2827                );
2828            self.inner.unary(req, path, codec).await
2829        }
2830        pub async fn database_delete(
2831            &mut self,
2832            request: impl tonic::IntoRequest<super::database::delete::Req>,
2833        ) -> std::result::Result<
2834            tonic::Response<super::database::delete::Res>,
2835            tonic::Status,
2836        > {
2837            self.inner
2838                .ready()
2839                .await
2840                .map_err(|e| {
2841                    tonic::Status::unknown(
2842                        format!("Service was not ready: {}", e.into()),
2843                    )
2844                })?;
2845            let codec = tonic::codec::ProstCodec::default();
2846            let path = http::uri::PathAndQuery::from_static(
2847                "/typedb.protocol.TypeDB/database_delete",
2848            );
2849            let mut req = request.into_request();
2850            req.extensions_mut()
2851                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "database_delete"));
2852            self.inner.unary(req, path, codec).await
2853        }
2854        pub async fn database_export(
2855            &mut self,
2856            request: impl tonic::IntoRequest<super::database::export::Req>,
2857        ) -> std::result::Result<
2858            tonic::Response<tonic::codec::Streaming<super::database::export::Server>>,
2859            tonic::Status,
2860        > {
2861            self.inner
2862                .ready()
2863                .await
2864                .map_err(|e| {
2865                    tonic::Status::unknown(
2866                        format!("Service was not ready: {}", e.into()),
2867                    )
2868                })?;
2869            let codec = tonic::codec::ProstCodec::default();
2870            let path = http::uri::PathAndQuery::from_static(
2871                "/typedb.protocol.TypeDB/database_export",
2872            );
2873            let mut req = request.into_request();
2874            req.extensions_mut()
2875                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "database_export"));
2876            self.inner.server_streaming(req, path, codec).await
2877        }
2878        /// Transaction Streaming API
2879        /// Opens a bi-directional stream representing a stateful transaction, streaming
2880        /// requests and responses back-and-forth. The first transaction client message must
2881        /// be {Transaction.Open.Req}. Closing the stream closes the transaction.
2882        pub async fn transaction(
2883            &mut self,
2884            request: impl tonic::IntoStreamingRequest<
2885                Message = super::transaction::Client,
2886            >,
2887        ) -> std::result::Result<
2888            tonic::Response<tonic::codec::Streaming<super::transaction::Server>>,
2889            tonic::Status,
2890        > {
2891            self.inner
2892                .ready()
2893                .await
2894                .map_err(|e| {
2895                    tonic::Status::unknown(
2896                        format!("Service was not ready: {}", e.into()),
2897                    )
2898                })?;
2899            let codec = tonic::codec::ProstCodec::default();
2900            let path = http::uri::PathAndQuery::from_static(
2901                "/typedb.protocol.TypeDB/transaction",
2902            );
2903            let mut req = request.into_streaming_request();
2904            req.extensions_mut()
2905                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "transaction"));
2906            self.inner.streaming(req, path, codec).await
2907        }
2908    }
2909}
2910/// Generated server implementations.
2911#[allow(non_camel_case_types)]
2912pub mod type_db_server {
2913    #![allow(
2914        unused_variables,
2915        dead_code,
2916        missing_docs,
2917        clippy::wildcard_imports,
2918        clippy::let_unit_value,
2919    )]
2920    use tonic::codegen::*;
2921    /// Generated trait containing gRPC methods that should be implemented for use with TypeDbServer.
2922    #[async_trait]
2923    pub trait TypeDb: std::marker::Send + std::marker::Sync + 'static {
2924        /// Connection API
2925        async fn connection_open(
2926            &self,
2927            request: tonic::Request<super::connection::open::Req>,
2928        ) -> std::result::Result<
2929            tonic::Response<super::connection::open::Res>,
2930            tonic::Status,
2931        >;
2932        /// Authentication API
2933        async fn authentication_token_create(
2934            &self,
2935            request: tonic::Request<super::authentication::token::create::Req>,
2936        ) -> std::result::Result<
2937            tonic::Response<super::authentication::token::create::Res>,
2938            tonic::Status,
2939        >;
2940        /// Server Manager API
2941        async fn servers_all(
2942            &self,
2943            request: tonic::Request<super::server_manager::all::Req>,
2944        ) -> std::result::Result<
2945            tonic::Response<super::server_manager::all::Res>,
2946            tonic::Status,
2947        >;
2948        async fn servers_get(
2949            &self,
2950            request: tonic::Request<super::server_manager::get::Req>,
2951        ) -> std::result::Result<
2952            tonic::Response<super::server_manager::get::Res>,
2953            tonic::Status,
2954        >;
2955        /// Server API
2956        async fn server_version(
2957            &self,
2958            request: tonic::Request<super::server::version::Req>,
2959        ) -> std::result::Result<
2960            tonic::Response<super::server::version::Res>,
2961            tonic::Status,
2962        >;
2963        /// User Manager API
2964        async fn users_get(
2965            &self,
2966            request: tonic::Request<super::user_manager::get::Req>,
2967        ) -> std::result::Result<
2968            tonic::Response<super::user_manager::get::Res>,
2969            tonic::Status,
2970        >;
2971        async fn users_all(
2972            &self,
2973            request: tonic::Request<super::user_manager::all::Req>,
2974        ) -> std::result::Result<
2975            tonic::Response<super::user_manager::all::Res>,
2976            tonic::Status,
2977        >;
2978        async fn users_contains(
2979            &self,
2980            request: tonic::Request<super::user_manager::contains::Req>,
2981        ) -> std::result::Result<
2982            tonic::Response<super::user_manager::contains::Res>,
2983            tonic::Status,
2984        >;
2985        async fn users_create(
2986            &self,
2987            request: tonic::Request<super::user_manager::create::Req>,
2988        ) -> std::result::Result<
2989            tonic::Response<super::user_manager::create::Res>,
2990            tonic::Status,
2991        >;
2992        /// User API
2993        async fn users_update(
2994            &self,
2995            request: tonic::Request<super::user::update::Req>,
2996        ) -> std::result::Result<
2997            tonic::Response<super::user::update::Res>,
2998            tonic::Status,
2999        >;
3000        async fn users_delete(
3001            &self,
3002            request: tonic::Request<super::user::delete::Req>,
3003        ) -> std::result::Result<
3004            tonic::Response<super::user::delete::Res>,
3005            tonic::Status,
3006        >;
3007        /// Database Manager API
3008        async fn databases_get(
3009            &self,
3010            request: tonic::Request<super::database_manager::get::Req>,
3011        ) -> std::result::Result<
3012            tonic::Response<super::database_manager::get::Res>,
3013            tonic::Status,
3014        >;
3015        async fn databases_all(
3016            &self,
3017            request: tonic::Request<super::database_manager::all::Req>,
3018        ) -> std::result::Result<
3019            tonic::Response<super::database_manager::all::Res>,
3020            tonic::Status,
3021        >;
3022        async fn databases_contains(
3023            &self,
3024            request: tonic::Request<super::database_manager::contains::Req>,
3025        ) -> std::result::Result<
3026            tonic::Response<super::database_manager::contains::Res>,
3027            tonic::Status,
3028        >;
3029        async fn databases_create(
3030            &self,
3031            request: tonic::Request<super::database_manager::create::Req>,
3032        ) -> std::result::Result<
3033            tonic::Response<super::database_manager::create::Res>,
3034            tonic::Status,
3035        >;
3036        /// Server streaming response type for the databases_import method.
3037        type databases_importStream: tonic::codegen::tokio_stream::Stream<
3038                Item = std::result::Result<
3039                    super::database_manager::import::Server,
3040                    tonic::Status,
3041                >,
3042            >
3043            + std::marker::Send
3044            + 'static;
3045        async fn databases_import(
3046            &self,
3047            request: tonic::Request<
3048                tonic::Streaming<super::database_manager::import::Client>,
3049            >,
3050        ) -> std::result::Result<
3051            tonic::Response<Self::databases_importStream>,
3052            tonic::Status,
3053        >;
3054        /// Database API
3055        async fn database_schema(
3056            &self,
3057            request: tonic::Request<super::database::schema::Req>,
3058        ) -> std::result::Result<
3059            tonic::Response<super::database::schema::Res>,
3060            tonic::Status,
3061        >;
3062        async fn database_type_schema(
3063            &self,
3064            request: tonic::Request<super::database::type_schema::Req>,
3065        ) -> std::result::Result<
3066            tonic::Response<super::database::type_schema::Res>,
3067            tonic::Status,
3068        >;
3069        async fn database_delete(
3070            &self,
3071            request: tonic::Request<super::database::delete::Req>,
3072        ) -> std::result::Result<
3073            tonic::Response<super::database::delete::Res>,
3074            tonic::Status,
3075        >;
3076        /// Server streaming response type for the database_export method.
3077        type database_exportStream: tonic::codegen::tokio_stream::Stream<
3078                Item = std::result::Result<
3079                    super::database::export::Server,
3080                    tonic::Status,
3081                >,
3082            >
3083            + std::marker::Send
3084            + 'static;
3085        async fn database_export(
3086            &self,
3087            request: tonic::Request<super::database::export::Req>,
3088        ) -> std::result::Result<
3089            tonic::Response<Self::database_exportStream>,
3090            tonic::Status,
3091        >;
3092        /// Server streaming response type for the transaction method.
3093        type transactionStream: tonic::codegen::tokio_stream::Stream<
3094                Item = std::result::Result<super::transaction::Server, tonic::Status>,
3095            >
3096            + std::marker::Send
3097            + 'static;
3098        /// Transaction Streaming API
3099        /// Opens a bi-directional stream representing a stateful transaction, streaming
3100        /// requests and responses back-and-forth. The first transaction client message must
3101        /// be {Transaction.Open.Req}. Closing the stream closes the transaction.
3102        async fn transaction(
3103            &self,
3104            request: tonic::Request<tonic::Streaming<super::transaction::Client>>,
3105        ) -> std::result::Result<
3106            tonic::Response<Self::transactionStream>,
3107            tonic::Status,
3108        >;
3109    }
3110    #[derive(Debug)]
3111    pub struct TypeDbServer<T> {
3112        inner: Arc<T>,
3113        accept_compression_encodings: EnabledCompressionEncodings,
3114        send_compression_encodings: EnabledCompressionEncodings,
3115        max_decoding_message_size: Option<usize>,
3116        max_encoding_message_size: Option<usize>,
3117    }
3118    impl<T> TypeDbServer<T> {
3119        pub fn new(inner: T) -> Self {
3120            Self::from_arc(Arc::new(inner))
3121        }
3122        pub fn from_arc(inner: Arc<T>) -> Self {
3123            Self {
3124                inner,
3125                accept_compression_encodings: Default::default(),
3126                send_compression_encodings: Default::default(),
3127                max_decoding_message_size: None,
3128                max_encoding_message_size: None,
3129            }
3130        }
3131        pub fn with_interceptor<F>(
3132            inner: T,
3133            interceptor: F,
3134        ) -> InterceptedService<Self, F>
3135        where
3136            F: tonic::service::Interceptor,
3137        {
3138            InterceptedService::new(Self::new(inner), interceptor)
3139        }
3140        /// Enable decompressing requests with the given encoding.
3141        #[must_use]
3142        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3143            self.accept_compression_encodings.enable(encoding);
3144            self
3145        }
3146        /// Compress responses with the given encoding, if the client supports it.
3147        #[must_use]
3148        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3149            self.send_compression_encodings.enable(encoding);
3150            self
3151        }
3152        /// Limits the maximum size of a decoded message.
3153        ///
3154        /// Default: `4MB`
3155        #[must_use]
3156        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3157            self.max_decoding_message_size = Some(limit);
3158            self
3159        }
3160        /// Limits the maximum size of an encoded message.
3161        ///
3162        /// Default: `usize::MAX`
3163        #[must_use]
3164        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3165            self.max_encoding_message_size = Some(limit);
3166            self
3167        }
3168    }
3169    impl<T, B> tonic::codegen::Service<http::Request<B>> for TypeDbServer<T>
3170    where
3171        T: TypeDb,
3172        B: Body + std::marker::Send + 'static,
3173        B::Error: Into<StdError> + std::marker::Send + 'static,
3174    {
3175        type Response = http::Response<tonic::body::BoxBody>;
3176        type Error = std::convert::Infallible;
3177        type Future = BoxFuture<Self::Response, Self::Error>;
3178        fn poll_ready(
3179            &mut self,
3180            _cx: &mut Context<'_>,
3181        ) -> Poll<std::result::Result<(), Self::Error>> {
3182            Poll::Ready(Ok(()))
3183        }
3184        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3185            match req.uri().path() {
3186                "/typedb.protocol.TypeDB/connection_open" => {
3187                    #[allow(non_camel_case_types)]
3188                    struct connection_openSvc<T: TypeDb>(pub Arc<T>);
3189                    impl<
3190                        T: TypeDb,
3191                    > tonic::server::UnaryService<super::connection::open::Req>
3192                    for connection_openSvc<T> {
3193                        type Response = super::connection::open::Res;
3194                        type Future = BoxFuture<
3195                            tonic::Response<Self::Response>,
3196                            tonic::Status,
3197                        >;
3198                        fn call(
3199                            &mut self,
3200                            request: tonic::Request<super::connection::open::Req>,
3201                        ) -> Self::Future {
3202                            let inner = Arc::clone(&self.0);
3203                            let fut = async move {
3204                                <T as TypeDb>::connection_open(&inner, request).await
3205                            };
3206                            Box::pin(fut)
3207                        }
3208                    }
3209                    let accept_compression_encodings = self.accept_compression_encodings;
3210                    let send_compression_encodings = self.send_compression_encodings;
3211                    let max_decoding_message_size = self.max_decoding_message_size;
3212                    let max_encoding_message_size = self.max_encoding_message_size;
3213                    let inner = self.inner.clone();
3214                    let fut = async move {
3215                        let method = connection_openSvc(inner);
3216                        let codec = tonic::codec::ProstCodec::default();
3217                        let mut grpc = tonic::server::Grpc::new(codec)
3218                            .apply_compression_config(
3219                                accept_compression_encodings,
3220                                send_compression_encodings,
3221                            )
3222                            .apply_max_message_size_config(
3223                                max_decoding_message_size,
3224                                max_encoding_message_size,
3225                            );
3226                        let res = grpc.unary(method, req).await;
3227                        Ok(res)
3228                    };
3229                    Box::pin(fut)
3230                }
3231                "/typedb.protocol.TypeDB/authentication_token_create" => {
3232                    #[allow(non_camel_case_types)]
3233                    struct authentication_token_createSvc<T: TypeDb>(pub Arc<T>);
3234                    impl<
3235                        T: TypeDb,
3236                    > tonic::server::UnaryService<
3237                        super::authentication::token::create::Req,
3238                    > for authentication_token_createSvc<T> {
3239                        type Response = super::authentication::token::create::Res;
3240                        type Future = BoxFuture<
3241                            tonic::Response<Self::Response>,
3242                            tonic::Status,
3243                        >;
3244                        fn call(
3245                            &mut self,
3246                            request: tonic::Request<
3247                                super::authentication::token::create::Req,
3248                            >,
3249                        ) -> Self::Future {
3250                            let inner = Arc::clone(&self.0);
3251                            let fut = async move {
3252                                <T as TypeDb>::authentication_token_create(&inner, request)
3253                                    .await
3254                            };
3255                            Box::pin(fut)
3256                        }
3257                    }
3258                    let accept_compression_encodings = self.accept_compression_encodings;
3259                    let send_compression_encodings = self.send_compression_encodings;
3260                    let max_decoding_message_size = self.max_decoding_message_size;
3261                    let max_encoding_message_size = self.max_encoding_message_size;
3262                    let inner = self.inner.clone();
3263                    let fut = async move {
3264                        let method = authentication_token_createSvc(inner);
3265                        let codec = tonic::codec::ProstCodec::default();
3266                        let mut grpc = tonic::server::Grpc::new(codec)
3267                            .apply_compression_config(
3268                                accept_compression_encodings,
3269                                send_compression_encodings,
3270                            )
3271                            .apply_max_message_size_config(
3272                                max_decoding_message_size,
3273                                max_encoding_message_size,
3274                            );
3275                        let res = grpc.unary(method, req).await;
3276                        Ok(res)
3277                    };
3278                    Box::pin(fut)
3279                }
3280                "/typedb.protocol.TypeDB/servers_all" => {
3281                    #[allow(non_camel_case_types)]
3282                    struct servers_allSvc<T: TypeDb>(pub Arc<T>);
3283                    impl<
3284                        T: TypeDb,
3285                    > tonic::server::UnaryService<super::server_manager::all::Req>
3286                    for servers_allSvc<T> {
3287                        type Response = super::server_manager::all::Res;
3288                        type Future = BoxFuture<
3289                            tonic::Response<Self::Response>,
3290                            tonic::Status,
3291                        >;
3292                        fn call(
3293                            &mut self,
3294                            request: tonic::Request<super::server_manager::all::Req>,
3295                        ) -> Self::Future {
3296                            let inner = Arc::clone(&self.0);
3297                            let fut = async move {
3298                                <T as TypeDb>::servers_all(&inner, request).await
3299                            };
3300                            Box::pin(fut)
3301                        }
3302                    }
3303                    let accept_compression_encodings = self.accept_compression_encodings;
3304                    let send_compression_encodings = self.send_compression_encodings;
3305                    let max_decoding_message_size = self.max_decoding_message_size;
3306                    let max_encoding_message_size = self.max_encoding_message_size;
3307                    let inner = self.inner.clone();
3308                    let fut = async move {
3309                        let method = servers_allSvc(inner);
3310                        let codec = tonic::codec::ProstCodec::default();
3311                        let mut grpc = tonic::server::Grpc::new(codec)
3312                            .apply_compression_config(
3313                                accept_compression_encodings,
3314                                send_compression_encodings,
3315                            )
3316                            .apply_max_message_size_config(
3317                                max_decoding_message_size,
3318                                max_encoding_message_size,
3319                            );
3320                        let res = grpc.unary(method, req).await;
3321                        Ok(res)
3322                    };
3323                    Box::pin(fut)
3324                }
3325                "/typedb.protocol.TypeDB/servers_get" => {
3326                    #[allow(non_camel_case_types)]
3327                    struct servers_getSvc<T: TypeDb>(pub Arc<T>);
3328                    impl<
3329                        T: TypeDb,
3330                    > tonic::server::UnaryService<super::server_manager::get::Req>
3331                    for servers_getSvc<T> {
3332                        type Response = super::server_manager::get::Res;
3333                        type Future = BoxFuture<
3334                            tonic::Response<Self::Response>,
3335                            tonic::Status,
3336                        >;
3337                        fn call(
3338                            &mut self,
3339                            request: tonic::Request<super::server_manager::get::Req>,
3340                        ) -> Self::Future {
3341                            let inner = Arc::clone(&self.0);
3342                            let fut = async move {
3343                                <T as TypeDb>::servers_get(&inner, request).await
3344                            };
3345                            Box::pin(fut)
3346                        }
3347                    }
3348                    let accept_compression_encodings = self.accept_compression_encodings;
3349                    let send_compression_encodings = self.send_compression_encodings;
3350                    let max_decoding_message_size = self.max_decoding_message_size;
3351                    let max_encoding_message_size = self.max_encoding_message_size;
3352                    let inner = self.inner.clone();
3353                    let fut = async move {
3354                        let method = servers_getSvc(inner);
3355                        let codec = tonic::codec::ProstCodec::default();
3356                        let mut grpc = tonic::server::Grpc::new(codec)
3357                            .apply_compression_config(
3358                                accept_compression_encodings,
3359                                send_compression_encodings,
3360                            )
3361                            .apply_max_message_size_config(
3362                                max_decoding_message_size,
3363                                max_encoding_message_size,
3364                            );
3365                        let res = grpc.unary(method, req).await;
3366                        Ok(res)
3367                    };
3368                    Box::pin(fut)
3369                }
3370                "/typedb.protocol.TypeDB/server_version" => {
3371                    #[allow(non_camel_case_types)]
3372                    struct server_versionSvc<T: TypeDb>(pub Arc<T>);
3373                    impl<
3374                        T: TypeDb,
3375                    > tonic::server::UnaryService<super::server::version::Req>
3376                    for server_versionSvc<T> {
3377                        type Response = super::server::version::Res;
3378                        type Future = BoxFuture<
3379                            tonic::Response<Self::Response>,
3380                            tonic::Status,
3381                        >;
3382                        fn call(
3383                            &mut self,
3384                            request: tonic::Request<super::server::version::Req>,
3385                        ) -> Self::Future {
3386                            let inner = Arc::clone(&self.0);
3387                            let fut = async move {
3388                                <T as TypeDb>::server_version(&inner, request).await
3389                            };
3390                            Box::pin(fut)
3391                        }
3392                    }
3393                    let accept_compression_encodings = self.accept_compression_encodings;
3394                    let send_compression_encodings = self.send_compression_encodings;
3395                    let max_decoding_message_size = self.max_decoding_message_size;
3396                    let max_encoding_message_size = self.max_encoding_message_size;
3397                    let inner = self.inner.clone();
3398                    let fut = async move {
3399                        let method = server_versionSvc(inner);
3400                        let codec = tonic::codec::ProstCodec::default();
3401                        let mut grpc = tonic::server::Grpc::new(codec)
3402                            .apply_compression_config(
3403                                accept_compression_encodings,
3404                                send_compression_encodings,
3405                            )
3406                            .apply_max_message_size_config(
3407                                max_decoding_message_size,
3408                                max_encoding_message_size,
3409                            );
3410                        let res = grpc.unary(method, req).await;
3411                        Ok(res)
3412                    };
3413                    Box::pin(fut)
3414                }
3415                "/typedb.protocol.TypeDB/users_get" => {
3416                    #[allow(non_camel_case_types)]
3417                    struct users_getSvc<T: TypeDb>(pub Arc<T>);
3418                    impl<
3419                        T: TypeDb,
3420                    > tonic::server::UnaryService<super::user_manager::get::Req>
3421                    for users_getSvc<T> {
3422                        type Response = super::user_manager::get::Res;
3423                        type Future = BoxFuture<
3424                            tonic::Response<Self::Response>,
3425                            tonic::Status,
3426                        >;
3427                        fn call(
3428                            &mut self,
3429                            request: tonic::Request<super::user_manager::get::Req>,
3430                        ) -> Self::Future {
3431                            let inner = Arc::clone(&self.0);
3432                            let fut = async move {
3433                                <T as TypeDb>::users_get(&inner, request).await
3434                            };
3435                            Box::pin(fut)
3436                        }
3437                    }
3438                    let accept_compression_encodings = self.accept_compression_encodings;
3439                    let send_compression_encodings = self.send_compression_encodings;
3440                    let max_decoding_message_size = self.max_decoding_message_size;
3441                    let max_encoding_message_size = self.max_encoding_message_size;
3442                    let inner = self.inner.clone();
3443                    let fut = async move {
3444                        let method = users_getSvc(inner);
3445                        let codec = tonic::codec::ProstCodec::default();
3446                        let mut grpc = tonic::server::Grpc::new(codec)
3447                            .apply_compression_config(
3448                                accept_compression_encodings,
3449                                send_compression_encodings,
3450                            )
3451                            .apply_max_message_size_config(
3452                                max_decoding_message_size,
3453                                max_encoding_message_size,
3454                            );
3455                        let res = grpc.unary(method, req).await;
3456                        Ok(res)
3457                    };
3458                    Box::pin(fut)
3459                }
3460                "/typedb.protocol.TypeDB/users_all" => {
3461                    #[allow(non_camel_case_types)]
3462                    struct users_allSvc<T: TypeDb>(pub Arc<T>);
3463                    impl<
3464                        T: TypeDb,
3465                    > tonic::server::UnaryService<super::user_manager::all::Req>
3466                    for users_allSvc<T> {
3467                        type Response = super::user_manager::all::Res;
3468                        type Future = BoxFuture<
3469                            tonic::Response<Self::Response>,
3470                            tonic::Status,
3471                        >;
3472                        fn call(
3473                            &mut self,
3474                            request: tonic::Request<super::user_manager::all::Req>,
3475                        ) -> Self::Future {
3476                            let inner = Arc::clone(&self.0);
3477                            let fut = async move {
3478                                <T as TypeDb>::users_all(&inner, request).await
3479                            };
3480                            Box::pin(fut)
3481                        }
3482                    }
3483                    let accept_compression_encodings = self.accept_compression_encodings;
3484                    let send_compression_encodings = self.send_compression_encodings;
3485                    let max_decoding_message_size = self.max_decoding_message_size;
3486                    let max_encoding_message_size = self.max_encoding_message_size;
3487                    let inner = self.inner.clone();
3488                    let fut = async move {
3489                        let method = users_allSvc(inner);
3490                        let codec = tonic::codec::ProstCodec::default();
3491                        let mut grpc = tonic::server::Grpc::new(codec)
3492                            .apply_compression_config(
3493                                accept_compression_encodings,
3494                                send_compression_encodings,
3495                            )
3496                            .apply_max_message_size_config(
3497                                max_decoding_message_size,
3498                                max_encoding_message_size,
3499                            );
3500                        let res = grpc.unary(method, req).await;
3501                        Ok(res)
3502                    };
3503                    Box::pin(fut)
3504                }
3505                "/typedb.protocol.TypeDB/users_contains" => {
3506                    #[allow(non_camel_case_types)]
3507                    struct users_containsSvc<T: TypeDb>(pub Arc<T>);
3508                    impl<
3509                        T: TypeDb,
3510                    > tonic::server::UnaryService<super::user_manager::contains::Req>
3511                    for users_containsSvc<T> {
3512                        type Response = super::user_manager::contains::Res;
3513                        type Future = BoxFuture<
3514                            tonic::Response<Self::Response>,
3515                            tonic::Status,
3516                        >;
3517                        fn call(
3518                            &mut self,
3519                            request: tonic::Request<super::user_manager::contains::Req>,
3520                        ) -> Self::Future {
3521                            let inner = Arc::clone(&self.0);
3522                            let fut = async move {
3523                                <T as TypeDb>::users_contains(&inner, request).await
3524                            };
3525                            Box::pin(fut)
3526                        }
3527                    }
3528                    let accept_compression_encodings = self.accept_compression_encodings;
3529                    let send_compression_encodings = self.send_compression_encodings;
3530                    let max_decoding_message_size = self.max_decoding_message_size;
3531                    let max_encoding_message_size = self.max_encoding_message_size;
3532                    let inner = self.inner.clone();
3533                    let fut = async move {
3534                        let method = users_containsSvc(inner);
3535                        let codec = tonic::codec::ProstCodec::default();
3536                        let mut grpc = tonic::server::Grpc::new(codec)
3537                            .apply_compression_config(
3538                                accept_compression_encodings,
3539                                send_compression_encodings,
3540                            )
3541                            .apply_max_message_size_config(
3542                                max_decoding_message_size,
3543                                max_encoding_message_size,
3544                            );
3545                        let res = grpc.unary(method, req).await;
3546                        Ok(res)
3547                    };
3548                    Box::pin(fut)
3549                }
3550                "/typedb.protocol.TypeDB/users_create" => {
3551                    #[allow(non_camel_case_types)]
3552                    struct users_createSvc<T: TypeDb>(pub Arc<T>);
3553                    impl<
3554                        T: TypeDb,
3555                    > tonic::server::UnaryService<super::user_manager::create::Req>
3556                    for users_createSvc<T> {
3557                        type Response = super::user_manager::create::Res;
3558                        type Future = BoxFuture<
3559                            tonic::Response<Self::Response>,
3560                            tonic::Status,
3561                        >;
3562                        fn call(
3563                            &mut self,
3564                            request: tonic::Request<super::user_manager::create::Req>,
3565                        ) -> Self::Future {
3566                            let inner = Arc::clone(&self.0);
3567                            let fut = async move {
3568                                <T as TypeDb>::users_create(&inner, request).await
3569                            };
3570                            Box::pin(fut)
3571                        }
3572                    }
3573                    let accept_compression_encodings = self.accept_compression_encodings;
3574                    let send_compression_encodings = self.send_compression_encodings;
3575                    let max_decoding_message_size = self.max_decoding_message_size;
3576                    let max_encoding_message_size = self.max_encoding_message_size;
3577                    let inner = self.inner.clone();
3578                    let fut = async move {
3579                        let method = users_createSvc(inner);
3580                        let codec = tonic::codec::ProstCodec::default();
3581                        let mut grpc = tonic::server::Grpc::new(codec)
3582                            .apply_compression_config(
3583                                accept_compression_encodings,
3584                                send_compression_encodings,
3585                            )
3586                            .apply_max_message_size_config(
3587                                max_decoding_message_size,
3588                                max_encoding_message_size,
3589                            );
3590                        let res = grpc.unary(method, req).await;
3591                        Ok(res)
3592                    };
3593                    Box::pin(fut)
3594                }
3595                "/typedb.protocol.TypeDB/users_update" => {
3596                    #[allow(non_camel_case_types)]
3597                    struct users_updateSvc<T: TypeDb>(pub Arc<T>);
3598                    impl<T: TypeDb> tonic::server::UnaryService<super::user::update::Req>
3599                    for users_updateSvc<T> {
3600                        type Response = super::user::update::Res;
3601                        type Future = BoxFuture<
3602                            tonic::Response<Self::Response>,
3603                            tonic::Status,
3604                        >;
3605                        fn call(
3606                            &mut self,
3607                            request: tonic::Request<super::user::update::Req>,
3608                        ) -> Self::Future {
3609                            let inner = Arc::clone(&self.0);
3610                            let fut = async move {
3611                                <T as TypeDb>::users_update(&inner, request).await
3612                            };
3613                            Box::pin(fut)
3614                        }
3615                    }
3616                    let accept_compression_encodings = self.accept_compression_encodings;
3617                    let send_compression_encodings = self.send_compression_encodings;
3618                    let max_decoding_message_size = self.max_decoding_message_size;
3619                    let max_encoding_message_size = self.max_encoding_message_size;
3620                    let inner = self.inner.clone();
3621                    let fut = async move {
3622                        let method = users_updateSvc(inner);
3623                        let codec = tonic::codec::ProstCodec::default();
3624                        let mut grpc = tonic::server::Grpc::new(codec)
3625                            .apply_compression_config(
3626                                accept_compression_encodings,
3627                                send_compression_encodings,
3628                            )
3629                            .apply_max_message_size_config(
3630                                max_decoding_message_size,
3631                                max_encoding_message_size,
3632                            );
3633                        let res = grpc.unary(method, req).await;
3634                        Ok(res)
3635                    };
3636                    Box::pin(fut)
3637                }
3638                "/typedb.protocol.TypeDB/users_delete" => {
3639                    #[allow(non_camel_case_types)]
3640                    struct users_deleteSvc<T: TypeDb>(pub Arc<T>);
3641                    impl<T: TypeDb> tonic::server::UnaryService<super::user::delete::Req>
3642                    for users_deleteSvc<T> {
3643                        type Response = super::user::delete::Res;
3644                        type Future = BoxFuture<
3645                            tonic::Response<Self::Response>,
3646                            tonic::Status,
3647                        >;
3648                        fn call(
3649                            &mut self,
3650                            request: tonic::Request<super::user::delete::Req>,
3651                        ) -> Self::Future {
3652                            let inner = Arc::clone(&self.0);
3653                            let fut = async move {
3654                                <T as TypeDb>::users_delete(&inner, request).await
3655                            };
3656                            Box::pin(fut)
3657                        }
3658                    }
3659                    let accept_compression_encodings = self.accept_compression_encodings;
3660                    let send_compression_encodings = self.send_compression_encodings;
3661                    let max_decoding_message_size = self.max_decoding_message_size;
3662                    let max_encoding_message_size = self.max_encoding_message_size;
3663                    let inner = self.inner.clone();
3664                    let fut = async move {
3665                        let method = users_deleteSvc(inner);
3666                        let codec = tonic::codec::ProstCodec::default();
3667                        let mut grpc = tonic::server::Grpc::new(codec)
3668                            .apply_compression_config(
3669                                accept_compression_encodings,
3670                                send_compression_encodings,
3671                            )
3672                            .apply_max_message_size_config(
3673                                max_decoding_message_size,
3674                                max_encoding_message_size,
3675                            );
3676                        let res = grpc.unary(method, req).await;
3677                        Ok(res)
3678                    };
3679                    Box::pin(fut)
3680                }
3681                "/typedb.protocol.TypeDB/databases_get" => {
3682                    #[allow(non_camel_case_types)]
3683                    struct databases_getSvc<T: TypeDb>(pub Arc<T>);
3684                    impl<
3685                        T: TypeDb,
3686                    > tonic::server::UnaryService<super::database_manager::get::Req>
3687                    for databases_getSvc<T> {
3688                        type Response = super::database_manager::get::Res;
3689                        type Future = BoxFuture<
3690                            tonic::Response<Self::Response>,
3691                            tonic::Status,
3692                        >;
3693                        fn call(
3694                            &mut self,
3695                            request: tonic::Request<super::database_manager::get::Req>,
3696                        ) -> Self::Future {
3697                            let inner = Arc::clone(&self.0);
3698                            let fut = async move {
3699                                <T as TypeDb>::databases_get(&inner, request).await
3700                            };
3701                            Box::pin(fut)
3702                        }
3703                    }
3704                    let accept_compression_encodings = self.accept_compression_encodings;
3705                    let send_compression_encodings = self.send_compression_encodings;
3706                    let max_decoding_message_size = self.max_decoding_message_size;
3707                    let max_encoding_message_size = self.max_encoding_message_size;
3708                    let inner = self.inner.clone();
3709                    let fut = async move {
3710                        let method = databases_getSvc(inner);
3711                        let codec = tonic::codec::ProstCodec::default();
3712                        let mut grpc = tonic::server::Grpc::new(codec)
3713                            .apply_compression_config(
3714                                accept_compression_encodings,
3715                                send_compression_encodings,
3716                            )
3717                            .apply_max_message_size_config(
3718                                max_decoding_message_size,
3719                                max_encoding_message_size,
3720                            );
3721                        let res = grpc.unary(method, req).await;
3722                        Ok(res)
3723                    };
3724                    Box::pin(fut)
3725                }
3726                "/typedb.protocol.TypeDB/databases_all" => {
3727                    #[allow(non_camel_case_types)]
3728                    struct databases_allSvc<T: TypeDb>(pub Arc<T>);
3729                    impl<
3730                        T: TypeDb,
3731                    > tonic::server::UnaryService<super::database_manager::all::Req>
3732                    for databases_allSvc<T> {
3733                        type Response = super::database_manager::all::Res;
3734                        type Future = BoxFuture<
3735                            tonic::Response<Self::Response>,
3736                            tonic::Status,
3737                        >;
3738                        fn call(
3739                            &mut self,
3740                            request: tonic::Request<super::database_manager::all::Req>,
3741                        ) -> Self::Future {
3742                            let inner = Arc::clone(&self.0);
3743                            let fut = async move {
3744                                <T as TypeDb>::databases_all(&inner, request).await
3745                            };
3746                            Box::pin(fut)
3747                        }
3748                    }
3749                    let accept_compression_encodings = self.accept_compression_encodings;
3750                    let send_compression_encodings = self.send_compression_encodings;
3751                    let max_decoding_message_size = self.max_decoding_message_size;
3752                    let max_encoding_message_size = self.max_encoding_message_size;
3753                    let inner = self.inner.clone();
3754                    let fut = async move {
3755                        let method = databases_allSvc(inner);
3756                        let codec = tonic::codec::ProstCodec::default();
3757                        let mut grpc = tonic::server::Grpc::new(codec)
3758                            .apply_compression_config(
3759                                accept_compression_encodings,
3760                                send_compression_encodings,
3761                            )
3762                            .apply_max_message_size_config(
3763                                max_decoding_message_size,
3764                                max_encoding_message_size,
3765                            );
3766                        let res = grpc.unary(method, req).await;
3767                        Ok(res)
3768                    };
3769                    Box::pin(fut)
3770                }
3771                "/typedb.protocol.TypeDB/databases_contains" => {
3772                    #[allow(non_camel_case_types)]
3773                    struct databases_containsSvc<T: TypeDb>(pub Arc<T>);
3774                    impl<
3775                        T: TypeDb,
3776                    > tonic::server::UnaryService<super::database_manager::contains::Req>
3777                    for databases_containsSvc<T> {
3778                        type Response = super::database_manager::contains::Res;
3779                        type Future = BoxFuture<
3780                            tonic::Response<Self::Response>,
3781                            tonic::Status,
3782                        >;
3783                        fn call(
3784                            &mut self,
3785                            request: tonic::Request<
3786                                super::database_manager::contains::Req,
3787                            >,
3788                        ) -> Self::Future {
3789                            let inner = Arc::clone(&self.0);
3790                            let fut = async move {
3791                                <T as TypeDb>::databases_contains(&inner, request).await
3792                            };
3793                            Box::pin(fut)
3794                        }
3795                    }
3796                    let accept_compression_encodings = self.accept_compression_encodings;
3797                    let send_compression_encodings = self.send_compression_encodings;
3798                    let max_decoding_message_size = self.max_decoding_message_size;
3799                    let max_encoding_message_size = self.max_encoding_message_size;
3800                    let inner = self.inner.clone();
3801                    let fut = async move {
3802                        let method = databases_containsSvc(inner);
3803                        let codec = tonic::codec::ProstCodec::default();
3804                        let mut grpc = tonic::server::Grpc::new(codec)
3805                            .apply_compression_config(
3806                                accept_compression_encodings,
3807                                send_compression_encodings,
3808                            )
3809                            .apply_max_message_size_config(
3810                                max_decoding_message_size,
3811                                max_encoding_message_size,
3812                            );
3813                        let res = grpc.unary(method, req).await;
3814                        Ok(res)
3815                    };
3816                    Box::pin(fut)
3817                }
3818                "/typedb.protocol.TypeDB/databases_create" => {
3819                    #[allow(non_camel_case_types)]
3820                    struct databases_createSvc<T: TypeDb>(pub Arc<T>);
3821                    impl<
3822                        T: TypeDb,
3823                    > tonic::server::UnaryService<super::database_manager::create::Req>
3824                    for databases_createSvc<T> {
3825                        type Response = super::database_manager::create::Res;
3826                        type Future = BoxFuture<
3827                            tonic::Response<Self::Response>,
3828                            tonic::Status,
3829                        >;
3830                        fn call(
3831                            &mut self,
3832                            request: tonic::Request<super::database_manager::create::Req>,
3833                        ) -> Self::Future {
3834                            let inner = Arc::clone(&self.0);
3835                            let fut = async move {
3836                                <T as TypeDb>::databases_create(&inner, request).await
3837                            };
3838                            Box::pin(fut)
3839                        }
3840                    }
3841                    let accept_compression_encodings = self.accept_compression_encodings;
3842                    let send_compression_encodings = self.send_compression_encodings;
3843                    let max_decoding_message_size = self.max_decoding_message_size;
3844                    let max_encoding_message_size = self.max_encoding_message_size;
3845                    let inner = self.inner.clone();
3846                    let fut = async move {
3847                        let method = databases_createSvc(inner);
3848                        let codec = tonic::codec::ProstCodec::default();
3849                        let mut grpc = tonic::server::Grpc::new(codec)
3850                            .apply_compression_config(
3851                                accept_compression_encodings,
3852                                send_compression_encodings,
3853                            )
3854                            .apply_max_message_size_config(
3855                                max_decoding_message_size,
3856                                max_encoding_message_size,
3857                            );
3858                        let res = grpc.unary(method, req).await;
3859                        Ok(res)
3860                    };
3861                    Box::pin(fut)
3862                }
3863                "/typedb.protocol.TypeDB/databases_import" => {
3864                    #[allow(non_camel_case_types)]
3865                    struct databases_importSvc<T: TypeDb>(pub Arc<T>);
3866                    impl<
3867                        T: TypeDb,
3868                    > tonic::server::StreamingService<
3869                        super::database_manager::import::Client,
3870                    > for databases_importSvc<T> {
3871                        type Response = super::database_manager::import::Server;
3872                        type ResponseStream = T::databases_importStream;
3873                        type Future = BoxFuture<
3874                            tonic::Response<Self::ResponseStream>,
3875                            tonic::Status,
3876                        >;
3877                        fn call(
3878                            &mut self,
3879                            request: tonic::Request<
3880                                tonic::Streaming<super::database_manager::import::Client>,
3881                            >,
3882                        ) -> Self::Future {
3883                            let inner = Arc::clone(&self.0);
3884                            let fut = async move {
3885                                <T as TypeDb>::databases_import(&inner, request).await
3886                            };
3887                            Box::pin(fut)
3888                        }
3889                    }
3890                    let accept_compression_encodings = self.accept_compression_encodings;
3891                    let send_compression_encodings = self.send_compression_encodings;
3892                    let max_decoding_message_size = self.max_decoding_message_size;
3893                    let max_encoding_message_size = self.max_encoding_message_size;
3894                    let inner = self.inner.clone();
3895                    let fut = async move {
3896                        let method = databases_importSvc(inner);
3897                        let codec = tonic::codec::ProstCodec::default();
3898                        let mut grpc = tonic::server::Grpc::new(codec)
3899                            .apply_compression_config(
3900                                accept_compression_encodings,
3901                                send_compression_encodings,
3902                            )
3903                            .apply_max_message_size_config(
3904                                max_decoding_message_size,
3905                                max_encoding_message_size,
3906                            );
3907                        let res = grpc.streaming(method, req).await;
3908                        Ok(res)
3909                    };
3910                    Box::pin(fut)
3911                }
3912                "/typedb.protocol.TypeDB/database_schema" => {
3913                    #[allow(non_camel_case_types)]
3914                    struct database_schemaSvc<T: TypeDb>(pub Arc<T>);
3915                    impl<
3916                        T: TypeDb,
3917                    > tonic::server::UnaryService<super::database::schema::Req>
3918                    for database_schemaSvc<T> {
3919                        type Response = super::database::schema::Res;
3920                        type Future = BoxFuture<
3921                            tonic::Response<Self::Response>,
3922                            tonic::Status,
3923                        >;
3924                        fn call(
3925                            &mut self,
3926                            request: tonic::Request<super::database::schema::Req>,
3927                        ) -> Self::Future {
3928                            let inner = Arc::clone(&self.0);
3929                            let fut = async move {
3930                                <T as TypeDb>::database_schema(&inner, request).await
3931                            };
3932                            Box::pin(fut)
3933                        }
3934                    }
3935                    let accept_compression_encodings = self.accept_compression_encodings;
3936                    let send_compression_encodings = self.send_compression_encodings;
3937                    let max_decoding_message_size = self.max_decoding_message_size;
3938                    let max_encoding_message_size = self.max_encoding_message_size;
3939                    let inner = self.inner.clone();
3940                    let fut = async move {
3941                        let method = database_schemaSvc(inner);
3942                        let codec = tonic::codec::ProstCodec::default();
3943                        let mut grpc = tonic::server::Grpc::new(codec)
3944                            .apply_compression_config(
3945                                accept_compression_encodings,
3946                                send_compression_encodings,
3947                            )
3948                            .apply_max_message_size_config(
3949                                max_decoding_message_size,
3950                                max_encoding_message_size,
3951                            );
3952                        let res = grpc.unary(method, req).await;
3953                        Ok(res)
3954                    };
3955                    Box::pin(fut)
3956                }
3957                "/typedb.protocol.TypeDB/database_type_schema" => {
3958                    #[allow(non_camel_case_types)]
3959                    struct database_type_schemaSvc<T: TypeDb>(pub Arc<T>);
3960                    impl<
3961                        T: TypeDb,
3962                    > tonic::server::UnaryService<super::database::type_schema::Req>
3963                    for database_type_schemaSvc<T> {
3964                        type Response = super::database::type_schema::Res;
3965                        type Future = BoxFuture<
3966                            tonic::Response<Self::Response>,
3967                            tonic::Status,
3968                        >;
3969                        fn call(
3970                            &mut self,
3971                            request: tonic::Request<super::database::type_schema::Req>,
3972                        ) -> Self::Future {
3973                            let inner = Arc::clone(&self.0);
3974                            let fut = async move {
3975                                <T as TypeDb>::database_type_schema(&inner, request).await
3976                            };
3977                            Box::pin(fut)
3978                        }
3979                    }
3980                    let accept_compression_encodings = self.accept_compression_encodings;
3981                    let send_compression_encodings = self.send_compression_encodings;
3982                    let max_decoding_message_size = self.max_decoding_message_size;
3983                    let max_encoding_message_size = self.max_encoding_message_size;
3984                    let inner = self.inner.clone();
3985                    let fut = async move {
3986                        let method = database_type_schemaSvc(inner);
3987                        let codec = tonic::codec::ProstCodec::default();
3988                        let mut grpc = tonic::server::Grpc::new(codec)
3989                            .apply_compression_config(
3990                                accept_compression_encodings,
3991                                send_compression_encodings,
3992                            )
3993                            .apply_max_message_size_config(
3994                                max_decoding_message_size,
3995                                max_encoding_message_size,
3996                            );
3997                        let res = grpc.unary(method, req).await;
3998                        Ok(res)
3999                    };
4000                    Box::pin(fut)
4001                }
4002                "/typedb.protocol.TypeDB/database_delete" => {
4003                    #[allow(non_camel_case_types)]
4004                    struct database_deleteSvc<T: TypeDb>(pub Arc<T>);
4005                    impl<
4006                        T: TypeDb,
4007                    > tonic::server::UnaryService<super::database::delete::Req>
4008                    for database_deleteSvc<T> {
4009                        type Response = super::database::delete::Res;
4010                        type Future = BoxFuture<
4011                            tonic::Response<Self::Response>,
4012                            tonic::Status,
4013                        >;
4014                        fn call(
4015                            &mut self,
4016                            request: tonic::Request<super::database::delete::Req>,
4017                        ) -> Self::Future {
4018                            let inner = Arc::clone(&self.0);
4019                            let fut = async move {
4020                                <T as TypeDb>::database_delete(&inner, request).await
4021                            };
4022                            Box::pin(fut)
4023                        }
4024                    }
4025                    let accept_compression_encodings = self.accept_compression_encodings;
4026                    let send_compression_encodings = self.send_compression_encodings;
4027                    let max_decoding_message_size = self.max_decoding_message_size;
4028                    let max_encoding_message_size = self.max_encoding_message_size;
4029                    let inner = self.inner.clone();
4030                    let fut = async move {
4031                        let method = database_deleteSvc(inner);
4032                        let codec = tonic::codec::ProstCodec::default();
4033                        let mut grpc = tonic::server::Grpc::new(codec)
4034                            .apply_compression_config(
4035                                accept_compression_encodings,
4036                                send_compression_encodings,
4037                            )
4038                            .apply_max_message_size_config(
4039                                max_decoding_message_size,
4040                                max_encoding_message_size,
4041                            );
4042                        let res = grpc.unary(method, req).await;
4043                        Ok(res)
4044                    };
4045                    Box::pin(fut)
4046                }
4047                "/typedb.protocol.TypeDB/database_export" => {
4048                    #[allow(non_camel_case_types)]
4049                    struct database_exportSvc<T: TypeDb>(pub Arc<T>);
4050                    impl<
4051                        T: TypeDb,
4052                    > tonic::server::ServerStreamingService<super::database::export::Req>
4053                    for database_exportSvc<T> {
4054                        type Response = super::database::export::Server;
4055                        type ResponseStream = T::database_exportStream;
4056                        type Future = BoxFuture<
4057                            tonic::Response<Self::ResponseStream>,
4058                            tonic::Status,
4059                        >;
4060                        fn call(
4061                            &mut self,
4062                            request: tonic::Request<super::database::export::Req>,
4063                        ) -> Self::Future {
4064                            let inner = Arc::clone(&self.0);
4065                            let fut = async move {
4066                                <T as TypeDb>::database_export(&inner, request).await
4067                            };
4068                            Box::pin(fut)
4069                        }
4070                    }
4071                    let accept_compression_encodings = self.accept_compression_encodings;
4072                    let send_compression_encodings = self.send_compression_encodings;
4073                    let max_decoding_message_size = self.max_decoding_message_size;
4074                    let max_encoding_message_size = self.max_encoding_message_size;
4075                    let inner = self.inner.clone();
4076                    let fut = async move {
4077                        let method = database_exportSvc(inner);
4078                        let codec = tonic::codec::ProstCodec::default();
4079                        let mut grpc = tonic::server::Grpc::new(codec)
4080                            .apply_compression_config(
4081                                accept_compression_encodings,
4082                                send_compression_encodings,
4083                            )
4084                            .apply_max_message_size_config(
4085                                max_decoding_message_size,
4086                                max_encoding_message_size,
4087                            );
4088                        let res = grpc.server_streaming(method, req).await;
4089                        Ok(res)
4090                    };
4091                    Box::pin(fut)
4092                }
4093                "/typedb.protocol.TypeDB/transaction" => {
4094                    #[allow(non_camel_case_types)]
4095                    struct transactionSvc<T: TypeDb>(pub Arc<T>);
4096                    impl<
4097                        T: TypeDb,
4098                    > tonic::server::StreamingService<super::transaction::Client>
4099                    for transactionSvc<T> {
4100                        type Response = super::transaction::Server;
4101                        type ResponseStream = T::transactionStream;
4102                        type Future = BoxFuture<
4103                            tonic::Response<Self::ResponseStream>,
4104                            tonic::Status,
4105                        >;
4106                        fn call(
4107                            &mut self,
4108                            request: tonic::Request<
4109                                tonic::Streaming<super::transaction::Client>,
4110                            >,
4111                        ) -> Self::Future {
4112                            let inner = Arc::clone(&self.0);
4113                            let fut = async move {
4114                                <T as TypeDb>::transaction(&inner, request).await
4115                            };
4116                            Box::pin(fut)
4117                        }
4118                    }
4119                    let accept_compression_encodings = self.accept_compression_encodings;
4120                    let send_compression_encodings = self.send_compression_encodings;
4121                    let max_decoding_message_size = self.max_decoding_message_size;
4122                    let max_encoding_message_size = self.max_encoding_message_size;
4123                    let inner = self.inner.clone();
4124                    let fut = async move {
4125                        let method = transactionSvc(inner);
4126                        let codec = tonic::codec::ProstCodec::default();
4127                        let mut grpc = tonic::server::Grpc::new(codec)
4128                            .apply_compression_config(
4129                                accept_compression_encodings,
4130                                send_compression_encodings,
4131                            )
4132                            .apply_max_message_size_config(
4133                                max_decoding_message_size,
4134                                max_encoding_message_size,
4135                            );
4136                        let res = grpc.streaming(method, req).await;
4137                        Ok(res)
4138                    };
4139                    Box::pin(fut)
4140                }
4141                _ => {
4142                    Box::pin(async move {
4143                        let mut response = http::Response::new(empty_body());
4144                        let headers = response.headers_mut();
4145                        headers
4146                            .insert(
4147                                tonic::Status::GRPC_STATUS,
4148                                (tonic::Code::Unimplemented as i32).into(),
4149                            );
4150                        headers
4151                            .insert(
4152                                http::header::CONTENT_TYPE,
4153                                tonic::metadata::GRPC_CONTENT_TYPE,
4154                            );
4155                        Ok(response)
4156                    })
4157                }
4158            }
4159        }
4160    }
4161    impl<T> Clone for TypeDbServer<T> {
4162        fn clone(&self) -> Self {
4163            let inner = self.inner.clone();
4164            Self {
4165                inner,
4166                accept_compression_encodings: self.accept_compression_encodings,
4167                send_compression_encodings: self.send_compression_encodings,
4168                max_decoding_message_size: self.max_decoding_message_size,
4169                max_encoding_message_size: self.max_encoding_message_size,
4170            }
4171        }
4172    }
4173    /// Generated gRPC service name
4174    pub const SERVICE_NAME: &str = "typedb.protocol.TypeDB";
4175    impl<T> tonic::server::NamedService for TypeDbServer<T> {
4176        const NAME: &'static str = SERVICE_NAME;
4177    }
4178}