typedb_protocol/
typedb.protocol.rs

1// This file is @generated by prost-build.
2#[derive(Clone, Copy, PartialEq, ::prost::Message)]
3pub struct Authentication {}
4/// Nested message and enum types in `Authentication`.
5pub mod authentication {
6    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
7    pub struct Token {}
8    /// Nested message and enum types in `Token`.
9    pub mod token {
10        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
11        pub struct Create {}
12        /// Nested message and enum types in `Create`.
13        pub mod create {
14            #[derive(Clone, PartialEq, ::prost::Message)]
15            pub struct Req {
16                #[prost(oneof = "req::Credentials", tags = "1")]
17                pub credentials: ::core::option::Option<req::Credentials>,
18            }
19            /// Nested message and enum types in `Req`.
20            pub mod req {
21                #[derive(Clone, PartialEq, ::prost::Message)]
22                pub struct Password {
23                    #[prost(string, tag = "1")]
24                    pub username: ::prost::alloc::string::String,
25                    #[prost(string, tag = "2")]
26                    pub password: ::prost::alloc::string::String,
27                }
28                #[derive(Clone, PartialEq, ::prost::Oneof)]
29                pub enum Credentials {
30                    /// extend by other credential kinds
31                    #[prost(message, tag = "1")]
32                    Password(Password),
33                }
34            }
35            #[derive(Clone, PartialEq, ::prost::Message)]
36            pub struct Res {
37                #[prost(string, tag = "1")]
38                pub token: ::prost::alloc::string::String,
39            }
40        }
41    }
42}
43#[derive(Clone, PartialEq, ::prost::Message)]
44pub struct Concept {
45    #[prost(oneof = "concept::Concept", tags = "1, 2, 3, 4, 5, 6, 7")]
46    pub concept: ::core::option::Option<concept::Concept>,
47}
48/// Nested message and enum types in `Concept`.
49pub mod concept {
50    #[derive(Clone, PartialEq, ::prost::Oneof)]
51    pub enum Concept {
52        #[prost(message, tag = "1")]
53        EntityType(super::EntityType),
54        #[prost(message, tag = "2")]
55        RelationType(super::RelationType),
56        #[prost(message, tag = "3")]
57        AttributeType(super::AttributeType),
58        #[prost(message, tag = "4")]
59        RoleType(super::RoleType),
60        #[prost(message, tag = "5")]
61        Entity(super::Entity),
62        #[prost(message, tag = "6")]
63        Relation(super::Relation),
64        #[prost(message, tag = "7")]
65        Attribute(super::Attribute),
66    }
67}
68#[derive(Clone, PartialEq, ::prost::Message)]
69pub struct Thing {
70    #[prost(oneof = "thing::Thing", tags = "1, 2, 3")]
71    pub thing: ::core::option::Option<thing::Thing>,
72}
73/// Nested message and enum types in `Thing`.
74pub mod thing {
75    #[derive(Clone, PartialEq, ::prost::Oneof)]
76    pub enum Thing {
77        #[prost(message, tag = "1")]
78        Entity(super::Entity),
79        #[prost(message, tag = "2")]
80        Relation(super::Relation),
81        #[prost(message, tag = "3")]
82        Attribute(super::Attribute),
83    }
84}
85#[derive(Clone, PartialEq, ::prost::Message)]
86pub struct Entity {
87    #[prost(bytes = "vec", tag = "1")]
88    pub iid: ::prost::alloc::vec::Vec<u8>,
89    #[prost(message, optional, tag = "2")]
90    pub entity_type: ::core::option::Option<EntityType>,
91}
92#[derive(Clone, PartialEq, ::prost::Message)]
93pub struct Relation {
94    #[prost(bytes = "vec", tag = "1")]
95    pub iid: ::prost::alloc::vec::Vec<u8>,
96    #[prost(message, optional, tag = "2")]
97    pub relation_type: ::core::option::Option<RelationType>,
98}
99#[derive(Clone, PartialEq, ::prost::Message)]
100pub struct Attribute {
101    #[prost(bytes = "vec", tag = "1")]
102    pub iid: ::prost::alloc::vec::Vec<u8>,
103    #[prost(message, optional, tag = "2")]
104    pub attribute_type: ::core::option::Option<AttributeType>,
105    #[prost(message, optional, tag = "3")]
106    pub value: ::core::option::Option<Value>,
107}
108#[derive(Clone, PartialEq, ::prost::Message)]
109pub struct Value {
110    #[prost(oneof = "value::Value", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10")]
111    pub value: ::core::option::Option<value::Value>,
112}
113/// Nested message and enum types in `Value`.
114pub mod value {
115    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
116    pub struct Decimal {
117        #[prost(sint64, tag = "1")]
118        pub integer: i64,
119        #[prost(uint64, tag = "2")]
120        pub fractional: u64,
121    }
122    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
123    pub struct Date {
124        /// days since January 1, 0001 as day 1 in the Gregorian Calendar (following Rust conventions)
125        #[prost(sint32, tag = "1")]
126        pub num_days_since_ce: i32,
127    }
128    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
129    pub struct Datetime {
130        /// seconds since epoch
131        #[prost(sint64, tag = "1")]
132        pub seconds: i64,
133        #[prost(uint32, tag = "2")]
134        pub nanos: u32,
135    }
136    #[derive(Clone, PartialEq, ::prost::Message)]
137    pub struct DatetimeTz {
138        #[prost(message, optional, tag = "1")]
139        pub datetime: ::core::option::Option<Datetime>,
140        #[prost(oneof = "datetime_tz::Timezone", tags = "2, 3")]
141        pub timezone: ::core::option::Option<datetime_tz::Timezone>,
142    }
143    /// Nested message and enum types in `Datetime_TZ`.
144    pub mod datetime_tz {
145        #[derive(Clone, PartialEq, ::prost::Oneof)]
146        pub enum Timezone {
147            #[prost(string, tag = "2")]
148            Named(::prost::alloc::string::String),
149            /// offset in seconds
150            #[prost(sint32, tag = "3")]
151            Offset(i32),
152        }
153    }
154    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
155    pub struct Duration {
156        #[prost(uint32, tag = "1")]
157        pub months: u32,
158        #[prost(uint32, tag = "2")]
159        pub days: u32,
160        #[prost(uint64, tag = "3")]
161        pub nanos: u64,
162    }
163    #[derive(Clone, PartialEq, ::prost::Message)]
164    pub struct Struct {
165        #[prost(string, tag = "1")]
166        pub struct_type_name: ::prost::alloc::string::String,
167    }
168    #[derive(Clone, PartialEq, ::prost::Oneof)]
169    pub enum Value {
170        #[prost(bool, tag = "1")]
171        Boolean(bool),
172        #[prost(sint64, tag = "2")]
173        Integer(i64),
174        #[prost(double, tag = "3")]
175        Double(f64),
176        #[prost(message, tag = "4")]
177        Decimal(Decimal),
178        #[prost(string, tag = "5")]
179        String(::prost::alloc::string::String),
180        #[prost(message, tag = "6")]
181        Date(Date),
182        #[prost(message, tag = "7")]
183        Datetime(Datetime),
184        #[prost(message, tag = "8")]
185        DatetimeTz(DatetimeTz),
186        #[prost(message, tag = "9")]
187        Duration(Duration),
188        #[prost(message, tag = "10")]
189        Struct(Struct),
190    }
191}
192#[derive(Clone, PartialEq, ::prost::Message)]
193pub struct Type {
194    #[prost(oneof = "r#type::Type", tags = "1, 2, 3, 4")]
195    pub r#type: ::core::option::Option<r#type::Type>,
196}
197/// Nested message and enum types in `Type`.
198pub mod r#type {
199    #[derive(Clone, PartialEq, ::prost::Oneof)]
200    pub enum Type {
201        #[prost(message, tag = "1")]
202        EntityType(super::EntityType),
203        #[prost(message, tag = "2")]
204        RelationType(super::RelationType),
205        #[prost(message, tag = "3")]
206        AttributeType(super::AttributeType),
207        #[prost(message, tag = "4")]
208        RoleType(super::RoleType),
209    }
210}
211#[derive(Clone, PartialEq, ::prost::Message)]
212pub struct RoleType {
213    #[prost(string, tag = "1")]
214    pub label: ::prost::alloc::string::String,
215}
216#[derive(Clone, PartialEq, ::prost::Message)]
217pub struct EntityType {
218    #[prost(string, tag = "1")]
219    pub label: ::prost::alloc::string::String,
220}
221#[derive(Clone, PartialEq, ::prost::Message)]
222pub struct RelationType {
223    #[prost(string, tag = "1")]
224    pub label: ::prost::alloc::string::String,
225}
226#[derive(Clone, PartialEq, ::prost::Message)]
227pub struct AttributeType {
228    #[prost(string, tag = "1")]
229    pub label: ::prost::alloc::string::String,
230    #[prost(message, optional, tag = "2")]
231    pub value_type: ::core::option::Option<ValueType>,
232}
233#[derive(Clone, PartialEq, ::prost::Message)]
234pub struct ValueType {
235    #[prost(oneof = "value_type::ValueType", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10")]
236    pub value_type: ::core::option::Option<value_type::ValueType>,
237}
238/// Nested message and enum types in `ValueType`.
239pub mod value_type {
240    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
241    pub struct Boolean {}
242    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
243    pub struct Integer {}
244    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
245    pub struct Double {}
246    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
247    pub struct Decimal {}
248    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
249    pub struct String {}
250    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
251    pub struct Date {}
252    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
253    pub struct DateTime {}
254    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
255    pub struct DateTimeTz {}
256    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
257    pub struct Duration {}
258    #[derive(Clone, PartialEq, ::prost::Message)]
259    pub struct Struct {
260        #[prost(string, tag = "1")]
261        pub name: ::prost::alloc::string::String,
262    }
263    #[derive(Clone, PartialEq, ::prost::Oneof)]
264    pub enum ValueType {
265        #[prost(message, tag = "1")]
266        Boolean(Boolean),
267        #[prost(message, tag = "2")]
268        Integer(Integer),
269        #[prost(message, tag = "3")]
270        Double(Double),
271        #[prost(message, tag = "4")]
272        Decimal(Decimal),
273        #[prost(message, tag = "5")]
274        String(String),
275        #[prost(message, tag = "6")]
276        Date(Date),
277        #[prost(message, tag = "7")]
278        Datetime(DateTime),
279        #[prost(message, tag = "8")]
280        DatetimeTz(DateTimeTz),
281        #[prost(message, tag = "9")]
282        Duration(Duration),
283        #[prost(message, tag = "10")]
284        Struct(Struct),
285    }
286}
287#[derive(Clone, Copy, PartialEq, ::prost::Message)]
288pub struct Migration {}
289/// Nested message and enum types in `Migration`.
290pub mod migration {
291    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
292    pub struct Export {}
293    /// Nested message and enum types in `Export`.
294    pub mod export {
295        #[derive(Clone, PartialEq, ::prost::Message)]
296        pub struct Req {
297            #[prost(string, tag = "1")]
298            pub name: ::prost::alloc::string::String,
299        }
300        #[derive(Clone, PartialEq, ::prost::Message)]
301        pub struct Server {
302            #[prost(oneof = "server::Server", tags = "1, 2, 3")]
303            pub server: ::core::option::Option<server::Server>,
304        }
305        /// Nested message and enum types in `Server`.
306        pub mod server {
307            #[derive(Clone, PartialEq, ::prost::Oneof)]
308            pub enum Server {
309                #[prost(message, tag = "1")]
310                InitialRes(super::InitialRes),
311                #[prost(message, tag = "2")]
312                ResPart(super::ResPart),
313                #[prost(message, tag = "3")]
314                Done(super::Done),
315            }
316        }
317        #[derive(Clone, PartialEq, ::prost::Message)]
318        pub struct InitialRes {
319            #[prost(string, tag = "1")]
320            pub schema: ::prost::alloc::string::String,
321        }
322        #[derive(Clone, PartialEq, ::prost::Message)]
323        pub struct ResPart {
324            #[prost(message, repeated, tag = "1")]
325            pub items: ::prost::alloc::vec::Vec<super::Item>,
326        }
327        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
328        pub struct Done {}
329    }
330    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
331    pub struct Import {}
332    /// Nested message and enum types in `Import`.
333    pub mod import {
334        #[derive(Clone, PartialEq, ::prost::Message)]
335        pub struct Client {
336            #[prost(oneof = "client::Client", tags = "1, 2, 3")]
337            pub client: ::core::option::Option<client::Client>,
338        }
339        /// Nested message and enum types in `Client`.
340        pub mod client {
341            #[derive(Clone, PartialEq, ::prost::Message)]
342            pub struct InitialReq {
343                #[prost(string, tag = "1")]
344                pub name: ::prost::alloc::string::String,
345                #[prost(string, tag = "2")]
346                pub schema: ::prost::alloc::string::String,
347            }
348            #[derive(Clone, PartialEq, ::prost::Message)]
349            pub struct ReqPart {
350                #[prost(message, repeated, tag = "1")]
351                pub items: ::prost::alloc::vec::Vec<super::super::Item>,
352            }
353            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
354            pub struct Done {}
355            #[derive(Clone, PartialEq, ::prost::Oneof)]
356            pub enum Client {
357                #[prost(message, tag = "1")]
358                InitialReq(InitialReq),
359                #[prost(message, tag = "2")]
360                ReqPart(ReqPart),
361                #[prost(message, tag = "3")]
362                Done(Done),
363            }
364        }
365        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
366        pub struct Server {
367            #[prost(message, optional, tag = "1")]
368            pub done: ::core::option::Option<server::Done>,
369        }
370        /// Nested message and enum types in `Server`.
371        pub mod server {
372            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
373            pub struct Done {}
374        }
375    }
376    #[derive(Clone, PartialEq, ::prost::Message)]
377    pub struct Item {
378        #[prost(oneof = "item::Item", tags = "1, 2, 3, 15, 16")]
379        pub item: ::core::option::Option<item::Item>,
380    }
381    /// Nested message and enum types in `Item`.
382    pub mod item {
383        #[derive(Clone, PartialEq, ::prost::Message)]
384        pub struct Entity {
385            #[prost(string, tag = "1")]
386            pub id: ::prost::alloc::string::String,
387            #[prost(string, tag = "2")]
388            pub label: ::prost::alloc::string::String,
389            #[prost(message, repeated, tag = "3")]
390            pub attributes: ::prost::alloc::vec::Vec<OwnedAttribute>,
391        }
392        #[derive(Clone, PartialEq, ::prost::Message)]
393        pub struct Attribute {
394            #[prost(string, tag = "1")]
395            pub id: ::prost::alloc::string::String,
396            #[prost(string, tag = "2")]
397            pub label: ::prost::alloc::string::String,
398            /// empty in 3.x, used for backwards compatibility
399            #[prost(message, repeated, tag = "3")]
400            pub attributes: ::prost::alloc::vec::Vec<OwnedAttribute>,
401            #[prost(message, optional, tag = "4")]
402            pub value: ::core::option::Option<super::MigrationValue>,
403        }
404        #[derive(Clone, PartialEq, ::prost::Message)]
405        pub struct Relation {
406            #[prost(string, tag = "1")]
407            pub id: ::prost::alloc::string::String,
408            #[prost(string, tag = "2")]
409            pub label: ::prost::alloc::string::String,
410            #[prost(message, repeated, tag = "3")]
411            pub attributes: ::prost::alloc::vec::Vec<OwnedAttribute>,
412            #[prost(message, repeated, tag = "4")]
413            pub roles: ::prost::alloc::vec::Vec<relation::Role>,
414        }
415        /// Nested message and enum types in `Relation`.
416        pub mod relation {
417            #[derive(Clone, PartialEq, ::prost::Message)]
418            pub struct Role {
419                #[prost(string, tag = "1")]
420                pub label: ::prost::alloc::string::String,
421                #[prost(message, repeated, tag = "2")]
422                pub players: ::prost::alloc::vec::Vec<role::Player>,
423            }
424            /// Nested message and enum types in `Role`.
425            pub mod role {
426                #[derive(Clone, PartialEq, ::prost::Message)]
427                pub struct Player {
428                    #[prost(string, tag = "1")]
429                    pub id: ::prost::alloc::string::String,
430                }
431            }
432        }
433        #[derive(Clone, PartialEq, ::prost::Message)]
434        pub struct OwnedAttribute {
435            #[prost(string, tag = "1")]
436            pub id: ::prost::alloc::string::String,
437        }
438        #[derive(Clone, PartialEq, ::prost::Message)]
439        pub struct Header {
440            #[prost(string, tag = "1")]
441            pub typedb_version: ::prost::alloc::string::String,
442            #[prost(string, tag = "2")]
443            pub original_database: ::prost::alloc::string::String,
444        }
445        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
446        pub struct Checksums {
447            #[prost(int64, tag = "1")]
448            pub entity_count: i64,
449            #[prost(int64, tag = "2")]
450            pub attribute_count: i64,
451            #[prost(int64, tag = "3")]
452            pub relation_count: i64,
453            #[prost(int64, tag = "4")]
454            pub role_count: i64,
455            #[prost(int64, tag = "5")]
456            pub ownership_count: i64,
457        }
458        #[derive(Clone, PartialEq, ::prost::Oneof)]
459        pub enum Item {
460            #[prost(message, tag = "1")]
461            Attribute(Attribute),
462            #[prost(message, tag = "2")]
463            Entity(Entity),
464            #[prost(message, tag = "3")]
465            Relation(Relation),
466            #[prost(message, tag = "15")]
467            Header(Header),
468            #[prost(message, tag = "16")]
469            Checksums(Checksums),
470        }
471    }
472    #[derive(Clone, PartialEq, ::prost::Message)]
473    pub struct MigrationValue {
474        #[prost(
475            oneof = "migration_value::Value",
476            tags = "1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12"
477        )]
478        pub value: ::core::option::Option<migration_value::Value>,
479    }
480    /// Nested message and enum types in `MigrationValue`.
481    pub mod migration_value {
482        #[derive(Clone, PartialEq, ::prost::Oneof)]
483        pub enum Value {
484            #[prost(string, tag = "1")]
485            String(::prost::alloc::string::String),
486            #[prost(bool, tag = "2")]
487            Boolean(bool),
488            #[prost(int64, tag = "3")]
489            Integer(i64),
490            #[prost(double, tag = "4")]
491            Double(f64),
492            /// compatibility with 2.x, milliseconds since epoch
493            #[prost(int64, tag = "5")]
494            DatetimeMillis(i64),
495            #[prost(message, tag = "6")]
496            Decimal(super::super::value::Decimal),
497            #[prost(message, tag = "8")]
498            Date(super::super::value::Date),
499            #[prost(message, tag = "9")]
500            Datetime(super::super::value::Datetime),
501            #[prost(message, tag = "10")]
502            DatetimeTz(super::super::value::DatetimeTz),
503            #[prost(message, tag = "11")]
504            Duration(super::super::value::Duration),
505            #[prost(message, tag = "12")]
506            Struct(super::super::value::Struct),
507        }
508    }
509}
510#[derive(Clone, Copy, PartialEq, ::prost::Message)]
511pub struct DatabaseManager {}
512/// Nested message and enum types in `DatabaseManager`.
513pub mod database_manager {
514    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
515    pub struct Get {}
516    /// Nested message and enum types in `Get`.
517    pub mod get {
518        #[derive(Clone, PartialEq, ::prost::Message)]
519        pub struct Req {
520            #[prost(string, tag = "1")]
521            pub name: ::prost::alloc::string::String,
522        }
523        #[derive(Clone, PartialEq, ::prost::Message)]
524        pub struct Res {
525            #[prost(message, optional, tag = "1")]
526            pub database: ::core::option::Option<super::super::DatabaseReplicas>,
527        }
528    }
529    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
530    pub struct All {}
531    /// Nested message and enum types in `All`.
532    pub mod all {
533        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
534        pub struct Req {}
535        #[derive(Clone, PartialEq, ::prost::Message)]
536        pub struct Res {
537            #[prost(message, repeated, tag = "1")]
538            pub databases: ::prost::alloc::vec::Vec<super::super::DatabaseReplicas>,
539        }
540    }
541    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
542    pub struct Contains {}
543    /// Nested message and enum types in `Contains`.
544    pub mod contains {
545        #[derive(Clone, PartialEq, ::prost::Message)]
546        pub struct Req {
547            #[prost(string, tag = "1")]
548            pub name: ::prost::alloc::string::String,
549        }
550        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
551        pub struct Res {
552            #[prost(bool, tag = "1")]
553            pub contains: bool,
554        }
555    }
556    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
557    pub struct Create {}
558    /// Nested message and enum types in `Create`.
559    pub mod create {
560        #[derive(Clone, PartialEq, ::prost::Message)]
561        pub struct Req {
562            #[prost(string, tag = "1")]
563            pub name: ::prost::alloc::string::String,
564        }
565        #[derive(Clone, PartialEq, ::prost::Message)]
566        pub struct Res {
567            #[prost(message, optional, tag = "1")]
568            pub database: ::core::option::Option<super::super::DatabaseReplicas>,
569        }
570    }
571    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
572    pub struct Import {}
573    /// Nested message and enum types in `Import`.
574    pub mod import {
575        #[derive(Clone, PartialEq, ::prost::Message)]
576        pub struct Client {
577            #[prost(message, optional, tag = "1")]
578            pub client: ::core::option::Option<super::super::migration::import::Client>,
579        }
580        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
581        pub struct Server {
582            #[prost(message, optional, tag = "1")]
583            pub server: ::core::option::Option<super::super::migration::import::Server>,
584        }
585    }
586}
587#[derive(Clone, PartialEq, ::prost::Message)]
588pub struct DatabaseReplicas {
589    #[prost(string, tag = "1")]
590    pub name: ::prost::alloc::string::String,
591    #[prost(message, repeated, tag = "2")]
592    pub replicas: ::prost::alloc::vec::Vec<database_replicas::Replica>,
593}
594/// Nested message and enum types in `DatabaseReplicas`.
595pub mod database_replicas {
596    #[derive(Clone, PartialEq, ::prost::Message)]
597    pub struct Replica {
598        #[prost(string, tag = "1")]
599        pub address: ::prost::alloc::string::String,
600        #[prost(bool, tag = "2")]
601        pub primary: bool,
602        #[prost(bool, tag = "3")]
603        pub preferred: bool,
604        #[prost(int64, tag = "4")]
605        pub term: i64,
606    }
607}
608#[derive(Clone, Copy, PartialEq, ::prost::Message)]
609pub struct Database {}
610/// Nested message and enum types in `Database`.
611pub mod database {
612    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
613    pub struct Schema {}
614    /// Nested message and enum types in `Schema`.
615    pub mod schema {
616        #[derive(Clone, PartialEq, ::prost::Message)]
617        pub struct Req {
618            #[prost(string, tag = "1")]
619            pub name: ::prost::alloc::string::String,
620        }
621        #[derive(Clone, PartialEq, ::prost::Message)]
622        pub struct Res {
623            #[prost(string, tag = "1")]
624            pub schema: ::prost::alloc::string::String,
625        }
626    }
627    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
628    pub struct TypeSchema {}
629    /// Nested message and enum types in `TypeSchema`.
630    pub mod type_schema {
631        #[derive(Clone, PartialEq, ::prost::Message)]
632        pub struct Req {
633            #[prost(string, tag = "1")]
634            pub name: ::prost::alloc::string::String,
635        }
636        #[derive(Clone, PartialEq, ::prost::Message)]
637        pub struct Res {
638            #[prost(string, tag = "1")]
639            pub schema: ::prost::alloc::string::String,
640        }
641    }
642    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
643    pub struct Export {}
644    /// Nested message and enum types in `Export`.
645    pub mod export {
646        #[derive(Clone, PartialEq, ::prost::Message)]
647        pub struct Req {
648            #[prost(message, optional, tag = "1")]
649            pub req: ::core::option::Option<super::super::migration::export::Req>,
650        }
651        #[derive(Clone, PartialEq, ::prost::Message)]
652        pub struct Server {
653            #[prost(message, optional, tag = "1")]
654            pub server: ::core::option::Option<super::super::migration::export::Server>,
655        }
656    }
657    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
658    pub struct Delete {}
659    /// Nested message and enum types in `Delete`.
660    pub mod delete {
661        #[derive(Clone, PartialEq, ::prost::Message)]
662        pub struct Req {
663            #[prost(string, tag = "1")]
664            pub name: ::prost::alloc::string::String,
665        }
666        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
667        pub struct Res {}
668    }
669}
670#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
671#[repr(i32)]
672pub enum Version {
673    Unspecified = 0,
674    Version = 7,
675}
676impl Version {
677    /// String value of the enum field names used in the ProtoBuf definition.
678    ///
679    /// The values are not transformed in any way and thus are considered stable
680    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
681    pub fn as_str_name(&self) -> &'static str {
682        match self {
683            Self::Unspecified => "UNSPECIFIED",
684            Self::Version => "VERSION",
685        }
686    }
687    /// Creates an enum from field names used in the ProtoBuf definition.
688    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
689        match value {
690            "UNSPECIFIED" => Some(Self::Unspecified),
691            "VERSION" => Some(Self::Version),
692            _ => None,
693        }
694    }
695}
696#[derive(Clone, Copy, PartialEq, ::prost::Message)]
697pub struct Connection {}
698/// Nested message and enum types in `Connection`.
699pub mod connection {
700    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
701    pub struct Open {}
702    /// Nested message and enum types in `Open`.
703    pub mod open {
704        #[derive(Clone, PartialEq, ::prost::Message)]
705        pub struct Req {
706            #[prost(enumeration = "super::super::Version", tag = "1")]
707            pub version: i32,
708            #[prost(string, tag = "2")]
709            pub driver_lang: ::prost::alloc::string::String,
710            #[prost(string, tag = "3")]
711            pub driver_version: ::prost::alloc::string::String,
712            #[prost(message, optional, tag = "4")]
713            pub authentication: ::core::option::Option<
714                super::super::authentication::token::create::Req,
715            >,
716        }
717        #[derive(Clone, PartialEq, ::prost::Message)]
718        pub struct Res {
719            #[prost(uint64, tag = "1")]
720            pub server_duration_millis: u64,
721            #[prost(message, optional, tag = "2")]
722            pub connection_id: ::core::option::Option<super::super::ConnectionId>,
723            /// pre-send all databases and replica info
724            #[prost(message, optional, tag = "3")]
725            pub databases_all: ::core::option::Option<
726                super::super::database_manager::all::Res,
727            >,
728            #[prost(message, optional, tag = "4")]
729            pub authentication: ::core::option::Option<
730                super::super::authentication::token::create::Res,
731            >,
732        }
733    }
734}
735/// Connection ID and Token are expected in all message metadata
736#[derive(Clone, PartialEq, ::prost::Message)]
737pub struct ConnectionId {
738    #[prost(bytes = "vec", tag = "1")]
739    pub id: ::prost::alloc::vec::Vec<u8>,
740}
741#[derive(Clone, Copy, PartialEq, ::prost::Message)]
742pub struct ServerManager {}
743/// Nested message and enum types in `ServerManager`.
744pub mod server_manager {
745    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
746    pub struct All {}
747    /// Nested message and enum types in `All`.
748    pub mod all {
749        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
750        pub struct Req {}
751        #[derive(Clone, PartialEq, ::prost::Message)]
752        pub struct Res {
753            #[prost(message, repeated, tag = "1")]
754            pub servers: ::prost::alloc::vec::Vec<super::super::Server>,
755        }
756    }
757}
758#[derive(Clone, PartialEq, ::prost::Message)]
759pub struct Server {
760    #[prost(string, tag = "1")]
761    pub address: ::prost::alloc::string::String,
762}
763#[derive(Clone, Copy, PartialEq, ::prost::Message)]
764pub struct UserManager {}
765/// Nested message and enum types in `UserManager`.
766pub mod user_manager {
767    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
768    pub struct All {}
769    /// Nested message and enum types in `All`.
770    pub mod all {
771        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
772        pub struct Req {}
773        #[derive(Clone, PartialEq, ::prost::Message)]
774        pub struct Res {
775            #[prost(message, repeated, tag = "1")]
776            pub users: ::prost::alloc::vec::Vec<super::super::User>,
777        }
778    }
779    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
780    pub struct Contains {}
781    /// Nested message and enum types in `Contains`.
782    pub mod contains {
783        #[derive(Clone, PartialEq, ::prost::Message)]
784        pub struct Req {
785            #[prost(string, tag = "1")]
786            pub name: ::prost::alloc::string::String,
787        }
788        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
789        pub struct Res {
790            #[prost(bool, tag = "1")]
791            pub contains: bool,
792        }
793    }
794    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
795    pub struct Get {}
796    /// Nested message and enum types in `Get`.
797    pub mod get {
798        #[derive(Clone, PartialEq, ::prost::Message)]
799        pub struct Req {
800            #[prost(string, tag = "1")]
801            pub name: ::prost::alloc::string::String,
802        }
803        #[derive(Clone, PartialEq, ::prost::Message)]
804        pub struct Res {
805            #[prost(message, optional, tag = "1")]
806            pub user: ::core::option::Option<super::super::User>,
807        }
808    }
809    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
810    pub struct Create {}
811    /// Nested message and enum types in `Create`.
812    pub mod create {
813        #[derive(Clone, PartialEq, ::prost::Message)]
814        pub struct Req {
815            #[prost(message, optional, tag = "1")]
816            pub user: ::core::option::Option<super::super::User>,
817        }
818        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
819        pub struct Res {}
820    }
821}
822#[derive(Clone, PartialEq, ::prost::Message)]
823pub struct User {
824    #[prost(string, tag = "1")]
825    pub name: ::prost::alloc::string::String,
826    #[prost(string, optional, tag = "2")]
827    pub password: ::core::option::Option<::prost::alloc::string::String>,
828}
829/// Nested message and enum types in `User`.
830pub mod user {
831    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
832    pub struct Update {}
833    /// Nested message and enum types in `Update`.
834    pub mod update {
835        #[derive(Clone, PartialEq, ::prost::Message)]
836        pub struct Req {
837            #[prost(string, tag = "1")]
838            pub name: ::prost::alloc::string::String,
839            #[prost(message, optional, tag = "2")]
840            pub user: ::core::option::Option<super::super::User>,
841        }
842        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
843        pub struct Res {}
844    }
845    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
846    pub struct Delete {}
847    /// Nested message and enum types in `Delete`.
848    pub mod delete {
849        #[derive(Clone, PartialEq, ::prost::Message)]
850        pub struct Req {
851            #[prost(string, tag = "1")]
852            pub name: ::prost::alloc::string::String,
853        }
854        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
855        pub struct Res {}
856    }
857}
858/// This is an emulation of the google ErrorDetails message. Generally, ErrorDetails are submitted via the GRPC error
859/// mechanism, but a manual error sending is required in streams
860#[derive(Clone, PartialEq, ::prost::Message)]
861pub struct Error {
862    #[prost(string, tag = "1")]
863    pub error_code: ::prost::alloc::string::String,
864    #[prost(string, tag = "2")]
865    pub domain: ::prost::alloc::string::String,
866    #[prost(string, repeated, tag = "3")]
867    pub stack_trace: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
868}
869#[derive(Clone, Copy, PartialEq, ::prost::Message)]
870pub struct Options {}
871/// Nested message and enum types in `Options`.
872pub mod options {
873    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
874    pub struct Transaction {
875        #[prost(bool, optional, tag = "1")]
876        pub parallel: ::core::option::Option<bool>,
877        #[prost(uint64, optional, tag = "2")]
878        pub transaction_timeout_millis: ::core::option::Option<u64>,
879        #[prost(uint64, optional, tag = "3")]
880        pub schema_lock_acquire_timeout_millis: ::core::option::Option<u64>,
881    }
882    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
883    pub struct Query {
884        #[prost(bool, optional, tag = "1")]
885        pub include_instance_types: ::core::option::Option<bool>,
886        #[prost(uint64, optional, tag = "2")]
887        pub prefetch_size: ::core::option::Option<u64>,
888    }
889}
890#[derive(Clone, PartialEq, ::prost::Message)]
891pub struct ConceptRow {
892    #[prost(message, repeated, tag = "1")]
893    pub row: ::prost::alloc::vec::Vec<RowEntry>,
894}
895#[derive(Clone, PartialEq, ::prost::Message)]
896pub struct RowEntry {
897    #[prost(oneof = "row_entry::Entry", tags = "1, 2, 3, 4, 5")]
898    pub entry: ::core::option::Option<row_entry::Entry>,
899}
900/// Nested message and enum types in `RowEntry`.
901pub mod row_entry {
902    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
903    pub struct Empty {}
904    #[derive(Clone, PartialEq, ::prost::Message)]
905    pub struct ConceptList {
906        #[prost(message, repeated, tag = "1")]
907        pub concepts: ::prost::alloc::vec::Vec<super::Concept>,
908    }
909    #[derive(Clone, PartialEq, ::prost::Message)]
910    pub struct ValueList {
911        #[prost(message, repeated, tag = "1")]
912        pub values: ::prost::alloc::vec::Vec<super::Value>,
913    }
914    #[derive(Clone, PartialEq, ::prost::Oneof)]
915    pub enum Entry {
916        #[prost(message, tag = "1")]
917        Empty(Empty),
918        #[prost(message, tag = "2")]
919        Concept(super::Concept),
920        #[prost(message, tag = "3")]
921        Value(super::Value),
922        #[prost(message, tag = "4")]
923        ConceptList(ConceptList),
924        #[prost(message, tag = "5")]
925        ValueList(ValueList),
926    }
927}
928#[derive(Clone, PartialEq, ::prost::Message)]
929pub struct ConceptDocument {
930    #[prost(message, optional, tag = "1")]
931    pub root: ::core::option::Option<concept_document::Node>,
932}
933/// Nested message and enum types in `ConceptDocument`.
934pub mod concept_document {
935    #[derive(Clone, PartialEq, ::prost::Message)]
936    pub struct Node {
937        #[prost(oneof = "node::Node", tags = "1, 2, 3")]
938        pub node: ::core::option::Option<node::Node>,
939    }
940    /// Nested message and enum types in `Node`.
941    pub mod node {
942        #[derive(Clone, PartialEq, ::prost::Message)]
943        pub struct Map {
944            #[prost(map = "string, message", tag = "1")]
945            pub map: ::std::collections::HashMap<
946                ::prost::alloc::string::String,
947                super::Node,
948            >,
949        }
950        #[derive(Clone, PartialEq, ::prost::Message)]
951        pub struct List {
952            #[prost(message, repeated, tag = "1")]
953            pub list: ::prost::alloc::vec::Vec<super::Node>,
954        }
955        #[derive(Clone, PartialEq, ::prost::Message)]
956        pub struct Leaf {
957            #[prost(oneof = "leaf::Leaf", tags = "1, 10, 11, 12, 13, 15, 20, 21, 30")]
958            pub leaf: ::core::option::Option<leaf::Leaf>,
959        }
960        /// Nested message and enum types in `Leaf`.
961        pub mod leaf {
962            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
963            pub struct Empty {}
964            #[derive(
965                Clone,
966                Copy,
967                Debug,
968                PartialEq,
969                Eq,
970                Hash,
971                PartialOrd,
972                Ord,
973                ::prost::Enumeration
974            )]
975            #[repr(i32)]
976            pub enum Kind {
977                Entity = 0,
978                Relation = 1,
979                Attribute = 3,
980                Role = 4,
981            }
982            impl Kind {
983                /// String value of the enum field names used in the ProtoBuf definition.
984                ///
985                /// The values are not transformed in any way and thus are considered stable
986                /// (if the ProtoBuf definition does not change) and safe for programmatic use.
987                pub fn as_str_name(&self) -> &'static str {
988                    match self {
989                        Self::Entity => "Entity",
990                        Self::Relation => "Relation",
991                        Self::Attribute => "Attribute",
992                        Self::Role => "Role",
993                    }
994                }
995                /// Creates an enum from field names used in the ProtoBuf definition.
996                pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
997                    match value {
998                        "Entity" => Some(Self::Entity),
999                        "Relation" => Some(Self::Relation),
1000                        "Attribute" => Some(Self::Attribute),
1001                        "Role" => Some(Self::Role),
1002                        _ => None,
1003                    }
1004                }
1005            }
1006            #[derive(Clone, PartialEq, ::prost::Oneof)]
1007            pub enum Leaf {
1008                #[prost(message, tag = "1")]
1009                Empty(Empty),
1010                #[prost(message, tag = "10")]
1011                EntityType(super::super::super::EntityType),
1012                #[prost(message, tag = "11")]
1013                RelationType(super::super::super::RelationType),
1014                #[prost(message, tag = "12")]
1015                AttributeType(super::super::super::AttributeType),
1016                #[prost(message, tag = "13")]
1017                RoleType(super::super::super::RoleType),
1018                #[prost(message, tag = "15")]
1019                ValueType(super::super::super::ValueType),
1020                #[prost(message, tag = "20")]
1021                Attribute(super::super::super::Attribute),
1022                #[prost(message, tag = "21")]
1023                Value(super::super::super::Value),
1024                #[prost(enumeration = "Kind", tag = "30")]
1025                Kind(i32),
1026            }
1027        }
1028        #[derive(Clone, PartialEq, ::prost::Oneof)]
1029        pub enum Node {
1030            #[prost(message, tag = "1")]
1031            Map(Map),
1032            #[prost(message, tag = "2")]
1033            List(List),
1034            #[prost(message, tag = "3")]
1035            Leaf(Leaf),
1036        }
1037    }
1038}
1039#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1040pub struct Query {}
1041/// Nested message and enum types in `Query`.
1042pub mod query {
1043    #[derive(Clone, PartialEq, ::prost::Message)]
1044    pub struct Req {
1045        #[prost(message, optional, tag = "1")]
1046        pub options: ::core::option::Option<super::options::Query>,
1047        #[prost(string, tag = "2")]
1048        pub query: ::prost::alloc::string::String,
1049    }
1050    #[derive(Clone, PartialEq, ::prost::Message)]
1051    pub struct InitialRes {
1052        #[prost(oneof = "initial_res::Res", tags = "1, 2")]
1053        pub res: ::core::option::Option<initial_res::Res>,
1054    }
1055    /// Nested message and enum types in `InitialRes`.
1056    pub mod initial_res {
1057        #[derive(Clone, PartialEq, ::prost::Message)]
1058        pub struct Ok {
1059            #[prost(oneof = "ok::Ok", tags = "1, 3, 4")]
1060            pub ok: ::core::option::Option<ok::Ok>,
1061        }
1062        /// Nested message and enum types in `Ok`.
1063        pub mod ok {
1064            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1065            pub struct Done {
1066                #[prost(enumeration = "super::super::Type", tag = "1")]
1067                pub query_type: i32,
1068            }
1069            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1070            pub struct ConceptDocumentStream {
1071                /// note: we could use this first response to record debug info, type annotations, warnings, etc
1072                /// TODO: network optimisation: replace keys with IDs, sending keys in the header to rebuild the document on the client side
1073                /// TODO: network optimisation: replace types (== mostly constant strings) with a IDs, sending types in the header to rebuild on the client side
1074                #[prost(enumeration = "super::super::Type", tag = "2")]
1075                pub query_type: i32,
1076            }
1077            #[derive(Clone, PartialEq, ::prost::Message)]
1078            pub struct ConceptRowStream {
1079                /// TODO: network optimisation: replace types (== mostly constant strings) with a IDs, sending types in the header to rebuild on the client side
1080                #[prost(string, repeated, tag = "1")]
1081                pub column_variable_names: ::prost::alloc::vec::Vec<
1082                    ::prost::alloc::string::String,
1083                >,
1084                #[prost(enumeration = "super::super::Type", tag = "2")]
1085                pub query_type: i32,
1086            }
1087            #[derive(Clone, PartialEq, ::prost::Oneof)]
1088            pub enum Ok {
1089                #[prost(message, tag = "1")]
1090                Done(Done),
1091                #[prost(message, tag = "3")]
1092                ConceptDocumentStream(ConceptDocumentStream),
1093                #[prost(message, tag = "4")]
1094                ConceptRowStream(ConceptRowStream),
1095            }
1096        }
1097        #[derive(Clone, PartialEq, ::prost::Oneof)]
1098        pub enum Res {
1099            #[prost(message, tag = "1")]
1100            Error(super::super::Error),
1101            #[prost(message, tag = "2")]
1102            Ok(Ok),
1103        }
1104    }
1105    #[derive(Clone, PartialEq, ::prost::Message)]
1106    pub struct ResPart {
1107        #[prost(oneof = "res_part::Res", tags = "1, 2")]
1108        pub res: ::core::option::Option<res_part::Res>,
1109    }
1110    /// Nested message and enum types in `ResPart`.
1111    pub mod res_part {
1112        #[derive(Clone, PartialEq, ::prost::Message)]
1113        pub struct ConceptDocumentsRes {
1114            #[prost(message, repeated, tag = "1")]
1115            pub documents: ::prost::alloc::vec::Vec<super::super::ConceptDocument>,
1116        }
1117        #[derive(Clone, PartialEq, ::prost::Message)]
1118        pub struct ConceptRowsRes {
1119            #[prost(message, repeated, tag = "1")]
1120            pub rows: ::prost::alloc::vec::Vec<super::super::ConceptRow>,
1121        }
1122        #[derive(Clone, PartialEq, ::prost::Oneof)]
1123        pub enum Res {
1124            #[prost(message, tag = "1")]
1125            DocumentsRes(ConceptDocumentsRes),
1126            #[prost(message, tag = "2")]
1127            RowsRes(ConceptRowsRes),
1128        }
1129    }
1130    #[derive(
1131        Clone,
1132        Copy,
1133        Debug,
1134        PartialEq,
1135        Eq,
1136        Hash,
1137        PartialOrd,
1138        Ord,
1139        ::prost::Enumeration
1140    )]
1141    #[repr(i32)]
1142    pub enum Type {
1143        Read = 0,
1144        Write = 1,
1145        Schema = 2,
1146    }
1147    impl Type {
1148        /// String value of the enum field names used in the ProtoBuf definition.
1149        ///
1150        /// The values are not transformed in any way and thus are considered stable
1151        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1152        pub fn as_str_name(&self) -> &'static str {
1153            match self {
1154                Self::Read => "READ",
1155                Self::Write => "WRITE",
1156                Self::Schema => "SCHEMA",
1157            }
1158        }
1159        /// Creates an enum from field names used in the ProtoBuf definition.
1160        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1161            match value {
1162                "READ" => Some(Self::Read),
1163                "WRITE" => Some(Self::Write),
1164                "SCHEMA" => Some(Self::Schema),
1165                _ => None,
1166            }
1167        }
1168    }
1169}
1170#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1171pub struct Transaction {}
1172/// Nested message and enum types in `Transaction`.
1173pub mod transaction {
1174    #[derive(Clone, PartialEq, ::prost::Message)]
1175    pub struct Client {
1176        #[prost(message, repeated, tag = "1")]
1177        pub reqs: ::prost::alloc::vec::Vec<Req>,
1178    }
1179    #[derive(Clone, PartialEq, ::prost::Message)]
1180    pub struct Server {
1181        #[prost(oneof = "server::Server", tags = "1, 2")]
1182        pub server: ::core::option::Option<server::Server>,
1183    }
1184    /// Nested message and enum types in `Server`.
1185    pub mod server {
1186        #[derive(Clone, PartialEq, ::prost::Oneof)]
1187        pub enum Server {
1188            #[prost(message, tag = "1")]
1189            Res(super::Res),
1190            #[prost(message, tag = "2")]
1191            ResPart(super::ResPart),
1192        }
1193    }
1194    #[derive(Clone, PartialEq, ::prost::Message)]
1195    pub struct Req {
1196        #[prost(bytes = "vec", tag = "1")]
1197        pub req_id: ::prost::alloc::vec::Vec<u8>,
1198        #[prost(map = "string, string", tag = "2")]
1199        pub metadata: ::std::collections::HashMap<
1200            ::prost::alloc::string::String,
1201            ::prost::alloc::string::String,
1202        >,
1203        #[prost(oneof = "req::Req", tags = "3, 4, 5, 6, 7, 8")]
1204        pub req: ::core::option::Option<req::Req>,
1205    }
1206    /// Nested message and enum types in `Req`.
1207    pub mod req {
1208        #[derive(Clone, PartialEq, ::prost::Oneof)]
1209        pub enum Req {
1210            #[prost(message, tag = "3")]
1211            OpenReq(super::open::Req),
1212            #[prost(message, tag = "4")]
1213            QueryReq(super::super::query::Req),
1214            #[prost(message, tag = "5")]
1215            StreamReq(super::stream_signal::Req),
1216            #[prost(message, tag = "6")]
1217            CommitReq(super::commit::Req),
1218            #[prost(message, tag = "7")]
1219            RollbackReq(super::rollback::Req),
1220            #[prost(message, tag = "8")]
1221            CloseReq(super::close::Req),
1222        }
1223    }
1224    #[derive(Clone, PartialEq, ::prost::Message)]
1225    pub struct Res {
1226        #[prost(bytes = "vec", tag = "1")]
1227        pub req_id: ::prost::alloc::vec::Vec<u8>,
1228        #[prost(oneof = "res::Res", tags = "2, 3, 5, 6")]
1229        pub res: ::core::option::Option<res::Res>,
1230    }
1231    /// Nested message and enum types in `Res`.
1232    pub mod res {
1233        #[derive(Clone, PartialEq, ::prost::Oneof)]
1234        pub enum Res {
1235            #[prost(message, tag = "2")]
1236            OpenRes(super::open::Res),
1237            #[prost(message, tag = "3")]
1238            QueryInitialRes(super::super::query::InitialRes),
1239            #[prost(message, tag = "5")]
1240            CommitRes(super::commit::Res),
1241            #[prost(message, tag = "6")]
1242            RollbackRes(super::rollback::Res),
1243        }
1244    }
1245    #[derive(Clone, PartialEq, ::prost::Message)]
1246    pub struct ResPart {
1247        #[prost(bytes = "vec", tag = "1")]
1248        pub req_id: ::prost::alloc::vec::Vec<u8>,
1249        #[prost(oneof = "res_part::ResPart", tags = "2, 3")]
1250        pub res_part: ::core::option::Option<res_part::ResPart>,
1251    }
1252    /// Nested message and enum types in `ResPart`.
1253    pub mod res_part {
1254        #[derive(Clone, PartialEq, ::prost::Oneof)]
1255        pub enum ResPart {
1256            #[prost(message, tag = "2")]
1257            QueryRes(super::super::query::ResPart),
1258            #[prost(message, tag = "3")]
1259            StreamRes(super::stream_signal::ResPart),
1260        }
1261    }
1262    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1263    pub struct Open {}
1264    /// Nested message and enum types in `Open`.
1265    pub mod open {
1266        #[derive(Clone, PartialEq, ::prost::Message)]
1267        pub struct Req {
1268            #[prost(string, tag = "1")]
1269            pub database: ::prost::alloc::string::String,
1270            #[prost(enumeration = "super::Type", tag = "2")]
1271            pub r#type: i32,
1272            #[prost(message, optional, tag = "3")]
1273            pub options: ::core::option::Option<super::super::options::Transaction>,
1274            #[prost(uint64, tag = "4")]
1275            pub network_latency_millis: u64,
1276        }
1277        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1278        pub struct Res {
1279            #[prost(uint64, tag = "2")]
1280            pub server_duration_millis: u64,
1281        }
1282    }
1283    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1284    pub struct Commit {}
1285    /// Nested message and enum types in `Commit`.
1286    pub mod commit {
1287        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1288        pub struct Req {}
1289        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1290        pub struct Res {}
1291    }
1292    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1293    pub struct Rollback {}
1294    /// Nested message and enum types in `Rollback`.
1295    pub mod rollback {
1296        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1297        pub struct Req {}
1298        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1299        pub struct Res {}
1300    }
1301    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1302    pub struct Close {}
1303    /// Nested message and enum types in `Close`.
1304    pub mod close {
1305        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1306        pub struct Req {}
1307        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1308        pub struct Res {}
1309    }
1310    /// TODO: When actually used, should be probably merged with Error from error.proto
1311    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1312    pub struct GetSchemaExceptions {}
1313    /// Nested message and enum types in `GetSchemaExceptions`.
1314    pub mod get_schema_exceptions {
1315        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1316        pub struct Req {}
1317        #[derive(Clone, PartialEq, ::prost::Message)]
1318        pub struct Res {
1319            #[prost(message, repeated, tag = "1")]
1320            pub exceptions: ::prost::alloc::vec::Vec<super::SchemaException>,
1321        }
1322    }
1323    #[derive(Clone, PartialEq, ::prost::Message)]
1324    pub struct SchemaException {
1325        #[prost(string, tag = "1")]
1326        pub code: ::prost::alloc::string::String,
1327        #[prost(string, tag = "2")]
1328        pub message: ::prost::alloc::string::String,
1329    }
1330    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1331    pub struct StreamSignal {}
1332    /// Nested message and enum types in `StreamSignal`.
1333    pub mod stream_signal {
1334        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1335        pub struct Req {}
1336        #[derive(Clone, PartialEq, ::prost::Message)]
1337        pub struct ResPart {
1338            #[prost(oneof = "res_part::State", tags = "1, 2, 3")]
1339            pub state: ::core::option::Option<res_part::State>,
1340        }
1341        /// Nested message and enum types in `ResPart`.
1342        pub mod res_part {
1343            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1344            pub struct Continue {}
1345            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
1346            pub struct Done {}
1347            #[derive(Clone, PartialEq, ::prost::Oneof)]
1348            pub enum State {
1349                #[prost(message, tag = "1")]
1350                Continue(Continue),
1351                #[prost(message, tag = "2")]
1352                Done(Done),
1353                #[prost(message, tag = "3")]
1354                Error(super::super::super::Error),
1355            }
1356        }
1357    }
1358    #[derive(
1359        Clone,
1360        Copy,
1361        Debug,
1362        PartialEq,
1363        Eq,
1364        Hash,
1365        PartialOrd,
1366        Ord,
1367        ::prost::Enumeration
1368    )]
1369    #[repr(i32)]
1370    pub enum Type {
1371        Read = 0,
1372        Write = 1,
1373        Schema = 2,
1374    }
1375    impl Type {
1376        /// String value of the enum field names used in the ProtoBuf definition.
1377        ///
1378        /// The values are not transformed in any way and thus are considered stable
1379        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1380        pub fn as_str_name(&self) -> &'static str {
1381            match self {
1382                Self::Read => "READ",
1383                Self::Write => "WRITE",
1384                Self::Schema => "SCHEMA",
1385            }
1386        }
1387        /// Creates an enum from field names used in the ProtoBuf definition.
1388        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1389            match value {
1390                "READ" => Some(Self::Read),
1391                "WRITE" => Some(Self::Write),
1392                "SCHEMA" => Some(Self::Schema),
1393                _ => None,
1394            }
1395        }
1396    }
1397}
1398/// Generated client implementations.
1399#[allow(non_camel_case_types)]
1400pub mod type_db_client {
1401    #![allow(
1402        unused_variables,
1403        dead_code,
1404        missing_docs,
1405        clippy::wildcard_imports,
1406        clippy::let_unit_value,
1407    )]
1408    use tonic::codegen::*;
1409    use tonic::codegen::http::Uri;
1410    #[derive(Debug, Clone)]
1411    pub struct TypeDbClient<T> {
1412        inner: tonic::client::Grpc<T>,
1413    }
1414    impl TypeDbClient<tonic::transport::Channel> {
1415        /// Attempt to create a new client by connecting to a given endpoint.
1416        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1417        where
1418            D: TryInto<tonic::transport::Endpoint>,
1419            D::Error: Into<StdError>,
1420        {
1421            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1422            Ok(Self::new(conn))
1423        }
1424    }
1425    impl<T> TypeDbClient<T>
1426    where
1427        T: tonic::client::GrpcService<tonic::body::BoxBody>,
1428        T::Error: Into<StdError>,
1429        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1430        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1431    {
1432        pub fn new(inner: T) -> Self {
1433            let inner = tonic::client::Grpc::new(inner);
1434            Self { inner }
1435        }
1436        pub fn with_origin(inner: T, origin: Uri) -> Self {
1437            let inner = tonic::client::Grpc::with_origin(inner, origin);
1438            Self { inner }
1439        }
1440        pub fn with_interceptor<F>(
1441            inner: T,
1442            interceptor: F,
1443        ) -> TypeDbClient<InterceptedService<T, F>>
1444        where
1445            F: tonic::service::Interceptor,
1446            T::ResponseBody: Default,
1447            T: tonic::codegen::Service<
1448                http::Request<tonic::body::BoxBody>,
1449                Response = http::Response<
1450                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1451                >,
1452            >,
1453            <T as tonic::codegen::Service<
1454                http::Request<tonic::body::BoxBody>,
1455            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1456        {
1457            TypeDbClient::new(InterceptedService::new(inner, interceptor))
1458        }
1459        /// Compress requests with the given encoding.
1460        ///
1461        /// This requires the server to support it otherwise it might respond with an
1462        /// error.
1463        #[must_use]
1464        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1465            self.inner = self.inner.send_compressed(encoding);
1466            self
1467        }
1468        /// Enable decompressing responses.
1469        #[must_use]
1470        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1471            self.inner = self.inner.accept_compressed(encoding);
1472            self
1473        }
1474        /// Limits the maximum size of a decoded message.
1475        ///
1476        /// Default: `4MB`
1477        #[must_use]
1478        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1479            self.inner = self.inner.max_decoding_message_size(limit);
1480            self
1481        }
1482        /// Limits the maximum size of an encoded message.
1483        ///
1484        /// Default: `usize::MAX`
1485        #[must_use]
1486        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1487            self.inner = self.inner.max_encoding_message_size(limit);
1488            self
1489        }
1490        /// Connection API
1491        pub async fn connection_open(
1492            &mut self,
1493            request: impl tonic::IntoRequest<super::connection::open::Req>,
1494        ) -> std::result::Result<
1495            tonic::Response<super::connection::open::Res>,
1496            tonic::Status,
1497        > {
1498            self.inner
1499                .ready()
1500                .await
1501                .map_err(|e| {
1502                    tonic::Status::unknown(
1503                        format!("Service was not ready: {}", e.into()),
1504                    )
1505                })?;
1506            let codec = tonic::codec::ProstCodec::default();
1507            let path = http::uri::PathAndQuery::from_static(
1508                "/typedb.protocol.TypeDB/connection_open",
1509            );
1510            let mut req = request.into_request();
1511            req.extensions_mut()
1512                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "connection_open"));
1513            self.inner.unary(req, path, codec).await
1514        }
1515        /// Authentication API
1516        pub async fn authentication_token_create(
1517            &mut self,
1518            request: impl tonic::IntoRequest<super::authentication::token::create::Req>,
1519        ) -> std::result::Result<
1520            tonic::Response<super::authentication::token::create::Res>,
1521            tonic::Status,
1522        > {
1523            self.inner
1524                .ready()
1525                .await
1526                .map_err(|e| {
1527                    tonic::Status::unknown(
1528                        format!("Service was not ready: {}", e.into()),
1529                    )
1530                })?;
1531            let codec = tonic::codec::ProstCodec::default();
1532            let path = http::uri::PathAndQuery::from_static(
1533                "/typedb.protocol.TypeDB/authentication_token_create",
1534            );
1535            let mut req = request.into_request();
1536            req.extensions_mut()
1537                .insert(
1538                    GrpcMethod::new(
1539                        "typedb.protocol.TypeDB",
1540                        "authentication_token_create",
1541                    ),
1542                );
1543            self.inner.unary(req, path, codec).await
1544        }
1545        /// Server Manager API
1546        pub async fn servers_all(
1547            &mut self,
1548            request: impl tonic::IntoRequest<super::server_manager::all::Req>,
1549        ) -> std::result::Result<
1550            tonic::Response<super::server_manager::all::Res>,
1551            tonic::Status,
1552        > {
1553            self.inner
1554                .ready()
1555                .await
1556                .map_err(|e| {
1557                    tonic::Status::unknown(
1558                        format!("Service was not ready: {}", e.into()),
1559                    )
1560                })?;
1561            let codec = tonic::codec::ProstCodec::default();
1562            let path = http::uri::PathAndQuery::from_static(
1563                "/typedb.protocol.TypeDB/servers_all",
1564            );
1565            let mut req = request.into_request();
1566            req.extensions_mut()
1567                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "servers_all"));
1568            self.inner.unary(req, path, codec).await
1569        }
1570        /// User Manager API
1571        pub async fn users_get(
1572            &mut self,
1573            request: impl tonic::IntoRequest<super::user_manager::get::Req>,
1574        ) -> std::result::Result<
1575            tonic::Response<super::user_manager::get::Res>,
1576            tonic::Status,
1577        > {
1578            self.inner
1579                .ready()
1580                .await
1581                .map_err(|e| {
1582                    tonic::Status::unknown(
1583                        format!("Service was not ready: {}", e.into()),
1584                    )
1585                })?;
1586            let codec = tonic::codec::ProstCodec::default();
1587            let path = http::uri::PathAndQuery::from_static(
1588                "/typedb.protocol.TypeDB/users_get",
1589            );
1590            let mut req = request.into_request();
1591            req.extensions_mut()
1592                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "users_get"));
1593            self.inner.unary(req, path, codec).await
1594        }
1595        pub async fn users_all(
1596            &mut self,
1597            request: impl tonic::IntoRequest<super::user_manager::all::Req>,
1598        ) -> std::result::Result<
1599            tonic::Response<super::user_manager::all::Res>,
1600            tonic::Status,
1601        > {
1602            self.inner
1603                .ready()
1604                .await
1605                .map_err(|e| {
1606                    tonic::Status::unknown(
1607                        format!("Service was not ready: {}", e.into()),
1608                    )
1609                })?;
1610            let codec = tonic::codec::ProstCodec::default();
1611            let path = http::uri::PathAndQuery::from_static(
1612                "/typedb.protocol.TypeDB/users_all",
1613            );
1614            let mut req = request.into_request();
1615            req.extensions_mut()
1616                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "users_all"));
1617            self.inner.unary(req, path, codec).await
1618        }
1619        pub async fn users_contains(
1620            &mut self,
1621            request: impl tonic::IntoRequest<super::user_manager::contains::Req>,
1622        ) -> std::result::Result<
1623            tonic::Response<super::user_manager::contains::Res>,
1624            tonic::Status,
1625        > {
1626            self.inner
1627                .ready()
1628                .await
1629                .map_err(|e| {
1630                    tonic::Status::unknown(
1631                        format!("Service was not ready: {}", e.into()),
1632                    )
1633                })?;
1634            let codec = tonic::codec::ProstCodec::default();
1635            let path = http::uri::PathAndQuery::from_static(
1636                "/typedb.protocol.TypeDB/users_contains",
1637            );
1638            let mut req = request.into_request();
1639            req.extensions_mut()
1640                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "users_contains"));
1641            self.inner.unary(req, path, codec).await
1642        }
1643        pub async fn users_create(
1644            &mut self,
1645            request: impl tonic::IntoRequest<super::user_manager::create::Req>,
1646        ) -> std::result::Result<
1647            tonic::Response<super::user_manager::create::Res>,
1648            tonic::Status,
1649        > {
1650            self.inner
1651                .ready()
1652                .await
1653                .map_err(|e| {
1654                    tonic::Status::unknown(
1655                        format!("Service was not ready: {}", e.into()),
1656                    )
1657                })?;
1658            let codec = tonic::codec::ProstCodec::default();
1659            let path = http::uri::PathAndQuery::from_static(
1660                "/typedb.protocol.TypeDB/users_create",
1661            );
1662            let mut req = request.into_request();
1663            req.extensions_mut()
1664                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "users_create"));
1665            self.inner.unary(req, path, codec).await
1666        }
1667        /// User API
1668        pub async fn users_update(
1669            &mut self,
1670            request: impl tonic::IntoRequest<super::user::update::Req>,
1671        ) -> std::result::Result<
1672            tonic::Response<super::user::update::Res>,
1673            tonic::Status,
1674        > {
1675            self.inner
1676                .ready()
1677                .await
1678                .map_err(|e| {
1679                    tonic::Status::unknown(
1680                        format!("Service was not ready: {}", e.into()),
1681                    )
1682                })?;
1683            let codec = tonic::codec::ProstCodec::default();
1684            let path = http::uri::PathAndQuery::from_static(
1685                "/typedb.protocol.TypeDB/users_update",
1686            );
1687            let mut req = request.into_request();
1688            req.extensions_mut()
1689                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "users_update"));
1690            self.inner.unary(req, path, codec).await
1691        }
1692        pub async fn users_delete(
1693            &mut self,
1694            request: impl tonic::IntoRequest<super::user::delete::Req>,
1695        ) -> std::result::Result<
1696            tonic::Response<super::user::delete::Res>,
1697            tonic::Status,
1698        > {
1699            self.inner
1700                .ready()
1701                .await
1702                .map_err(|e| {
1703                    tonic::Status::unknown(
1704                        format!("Service was not ready: {}", e.into()),
1705                    )
1706                })?;
1707            let codec = tonic::codec::ProstCodec::default();
1708            let path = http::uri::PathAndQuery::from_static(
1709                "/typedb.protocol.TypeDB/users_delete",
1710            );
1711            let mut req = request.into_request();
1712            req.extensions_mut()
1713                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "users_delete"));
1714            self.inner.unary(req, path, codec).await
1715        }
1716        /// Database Manager API
1717        pub async fn databases_get(
1718            &mut self,
1719            request: impl tonic::IntoRequest<super::database_manager::get::Req>,
1720        ) -> std::result::Result<
1721            tonic::Response<super::database_manager::get::Res>,
1722            tonic::Status,
1723        > {
1724            self.inner
1725                .ready()
1726                .await
1727                .map_err(|e| {
1728                    tonic::Status::unknown(
1729                        format!("Service was not ready: {}", e.into()),
1730                    )
1731                })?;
1732            let codec = tonic::codec::ProstCodec::default();
1733            let path = http::uri::PathAndQuery::from_static(
1734                "/typedb.protocol.TypeDB/databases_get",
1735            );
1736            let mut req = request.into_request();
1737            req.extensions_mut()
1738                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "databases_get"));
1739            self.inner.unary(req, path, codec).await
1740        }
1741        pub async fn databases_all(
1742            &mut self,
1743            request: impl tonic::IntoRequest<super::database_manager::all::Req>,
1744        ) -> std::result::Result<
1745            tonic::Response<super::database_manager::all::Res>,
1746            tonic::Status,
1747        > {
1748            self.inner
1749                .ready()
1750                .await
1751                .map_err(|e| {
1752                    tonic::Status::unknown(
1753                        format!("Service was not ready: {}", e.into()),
1754                    )
1755                })?;
1756            let codec = tonic::codec::ProstCodec::default();
1757            let path = http::uri::PathAndQuery::from_static(
1758                "/typedb.protocol.TypeDB/databases_all",
1759            );
1760            let mut req = request.into_request();
1761            req.extensions_mut()
1762                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "databases_all"));
1763            self.inner.unary(req, path, codec).await
1764        }
1765        pub async fn databases_contains(
1766            &mut self,
1767            request: impl tonic::IntoRequest<super::database_manager::contains::Req>,
1768        ) -> std::result::Result<
1769            tonic::Response<super::database_manager::contains::Res>,
1770            tonic::Status,
1771        > {
1772            self.inner
1773                .ready()
1774                .await
1775                .map_err(|e| {
1776                    tonic::Status::unknown(
1777                        format!("Service was not ready: {}", e.into()),
1778                    )
1779                })?;
1780            let codec = tonic::codec::ProstCodec::default();
1781            let path = http::uri::PathAndQuery::from_static(
1782                "/typedb.protocol.TypeDB/databases_contains",
1783            );
1784            let mut req = request.into_request();
1785            req.extensions_mut()
1786                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "databases_contains"));
1787            self.inner.unary(req, path, codec).await
1788        }
1789        pub async fn databases_create(
1790            &mut self,
1791            request: impl tonic::IntoRequest<super::database_manager::create::Req>,
1792        ) -> std::result::Result<
1793            tonic::Response<super::database_manager::create::Res>,
1794            tonic::Status,
1795        > {
1796            self.inner
1797                .ready()
1798                .await
1799                .map_err(|e| {
1800                    tonic::Status::unknown(
1801                        format!("Service was not ready: {}", e.into()),
1802                    )
1803                })?;
1804            let codec = tonic::codec::ProstCodec::default();
1805            let path = http::uri::PathAndQuery::from_static(
1806                "/typedb.protocol.TypeDB/databases_create",
1807            );
1808            let mut req = request.into_request();
1809            req.extensions_mut()
1810                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "databases_create"));
1811            self.inner.unary(req, path, codec).await
1812        }
1813        pub async fn databases_import(
1814            &mut self,
1815            request: impl tonic::IntoStreamingRequest<
1816                Message = super::database_manager::import::Client,
1817            >,
1818        ) -> std::result::Result<
1819            tonic::Response<
1820                tonic::codec::Streaming<super::database_manager::import::Server>,
1821            >,
1822            tonic::Status,
1823        > {
1824            self.inner
1825                .ready()
1826                .await
1827                .map_err(|e| {
1828                    tonic::Status::unknown(
1829                        format!("Service was not ready: {}", e.into()),
1830                    )
1831                })?;
1832            let codec = tonic::codec::ProstCodec::default();
1833            let path = http::uri::PathAndQuery::from_static(
1834                "/typedb.protocol.TypeDB/databases_import",
1835            );
1836            let mut req = request.into_streaming_request();
1837            req.extensions_mut()
1838                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "databases_import"));
1839            self.inner.streaming(req, path, codec).await
1840        }
1841        /// Database API
1842        pub async fn database_schema(
1843            &mut self,
1844            request: impl tonic::IntoRequest<super::database::schema::Req>,
1845        ) -> std::result::Result<
1846            tonic::Response<super::database::schema::Res>,
1847            tonic::Status,
1848        > {
1849            self.inner
1850                .ready()
1851                .await
1852                .map_err(|e| {
1853                    tonic::Status::unknown(
1854                        format!("Service was not ready: {}", e.into()),
1855                    )
1856                })?;
1857            let codec = tonic::codec::ProstCodec::default();
1858            let path = http::uri::PathAndQuery::from_static(
1859                "/typedb.protocol.TypeDB/database_schema",
1860            );
1861            let mut req = request.into_request();
1862            req.extensions_mut()
1863                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "database_schema"));
1864            self.inner.unary(req, path, codec).await
1865        }
1866        pub async fn database_type_schema(
1867            &mut self,
1868            request: impl tonic::IntoRequest<super::database::type_schema::Req>,
1869        ) -> std::result::Result<
1870            tonic::Response<super::database::type_schema::Res>,
1871            tonic::Status,
1872        > {
1873            self.inner
1874                .ready()
1875                .await
1876                .map_err(|e| {
1877                    tonic::Status::unknown(
1878                        format!("Service was not ready: {}", e.into()),
1879                    )
1880                })?;
1881            let codec = tonic::codec::ProstCodec::default();
1882            let path = http::uri::PathAndQuery::from_static(
1883                "/typedb.protocol.TypeDB/database_type_schema",
1884            );
1885            let mut req = request.into_request();
1886            req.extensions_mut()
1887                .insert(
1888                    GrpcMethod::new("typedb.protocol.TypeDB", "database_type_schema"),
1889                );
1890            self.inner.unary(req, path, codec).await
1891        }
1892        pub async fn database_delete(
1893            &mut self,
1894            request: impl tonic::IntoRequest<super::database::delete::Req>,
1895        ) -> std::result::Result<
1896            tonic::Response<super::database::delete::Res>,
1897            tonic::Status,
1898        > {
1899            self.inner
1900                .ready()
1901                .await
1902                .map_err(|e| {
1903                    tonic::Status::unknown(
1904                        format!("Service was not ready: {}", e.into()),
1905                    )
1906                })?;
1907            let codec = tonic::codec::ProstCodec::default();
1908            let path = http::uri::PathAndQuery::from_static(
1909                "/typedb.protocol.TypeDB/database_delete",
1910            );
1911            let mut req = request.into_request();
1912            req.extensions_mut()
1913                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "database_delete"));
1914            self.inner.unary(req, path, codec).await
1915        }
1916        pub async fn database_export(
1917            &mut self,
1918            request: impl tonic::IntoRequest<super::database::export::Req>,
1919        ) -> std::result::Result<
1920            tonic::Response<tonic::codec::Streaming<super::database::export::Server>>,
1921            tonic::Status,
1922        > {
1923            self.inner
1924                .ready()
1925                .await
1926                .map_err(|e| {
1927                    tonic::Status::unknown(
1928                        format!("Service was not ready: {}", e.into()),
1929                    )
1930                })?;
1931            let codec = tonic::codec::ProstCodec::default();
1932            let path = http::uri::PathAndQuery::from_static(
1933                "/typedb.protocol.TypeDB/database_export",
1934            );
1935            let mut req = request.into_request();
1936            req.extensions_mut()
1937                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "database_export"));
1938            self.inner.server_streaming(req, path, codec).await
1939        }
1940        /// Transaction Streaming API
1941        /// Opens a bi-directional stream representing a stateful transaction, streaming
1942        /// requests and responses back-and-forth. The first transaction client message must
1943        /// be {Transaction.Open.Req}. Closing the stream closes the transaction.
1944        pub async fn transaction(
1945            &mut self,
1946            request: impl tonic::IntoStreamingRequest<
1947                Message = super::transaction::Client,
1948            >,
1949        ) -> std::result::Result<
1950            tonic::Response<tonic::codec::Streaming<super::transaction::Server>>,
1951            tonic::Status,
1952        > {
1953            self.inner
1954                .ready()
1955                .await
1956                .map_err(|e| {
1957                    tonic::Status::unknown(
1958                        format!("Service was not ready: {}", e.into()),
1959                    )
1960                })?;
1961            let codec = tonic::codec::ProstCodec::default();
1962            let path = http::uri::PathAndQuery::from_static(
1963                "/typedb.protocol.TypeDB/transaction",
1964            );
1965            let mut req = request.into_streaming_request();
1966            req.extensions_mut()
1967                .insert(GrpcMethod::new("typedb.protocol.TypeDB", "transaction"));
1968            self.inner.streaming(req, path, codec).await
1969        }
1970    }
1971}
1972/// Generated server implementations.
1973#[allow(non_camel_case_types)]
1974pub mod type_db_server {
1975    #![allow(
1976        unused_variables,
1977        dead_code,
1978        missing_docs,
1979        clippy::wildcard_imports,
1980        clippy::let_unit_value,
1981    )]
1982    use tonic::codegen::*;
1983    /// Generated trait containing gRPC methods that should be implemented for use with TypeDbServer.
1984    #[async_trait]
1985    pub trait TypeDb: std::marker::Send + std::marker::Sync + 'static {
1986        /// Connection API
1987        async fn connection_open(
1988            &self,
1989            request: tonic::Request<super::connection::open::Req>,
1990        ) -> std::result::Result<
1991            tonic::Response<super::connection::open::Res>,
1992            tonic::Status,
1993        >;
1994        /// Authentication API
1995        async fn authentication_token_create(
1996            &self,
1997            request: tonic::Request<super::authentication::token::create::Req>,
1998        ) -> std::result::Result<
1999            tonic::Response<super::authentication::token::create::Res>,
2000            tonic::Status,
2001        >;
2002        /// Server Manager API
2003        async fn servers_all(
2004            &self,
2005            request: tonic::Request<super::server_manager::all::Req>,
2006        ) -> std::result::Result<
2007            tonic::Response<super::server_manager::all::Res>,
2008            tonic::Status,
2009        >;
2010        /// User Manager API
2011        async fn users_get(
2012            &self,
2013            request: tonic::Request<super::user_manager::get::Req>,
2014        ) -> std::result::Result<
2015            tonic::Response<super::user_manager::get::Res>,
2016            tonic::Status,
2017        >;
2018        async fn users_all(
2019            &self,
2020            request: tonic::Request<super::user_manager::all::Req>,
2021        ) -> std::result::Result<
2022            tonic::Response<super::user_manager::all::Res>,
2023            tonic::Status,
2024        >;
2025        async fn users_contains(
2026            &self,
2027            request: tonic::Request<super::user_manager::contains::Req>,
2028        ) -> std::result::Result<
2029            tonic::Response<super::user_manager::contains::Res>,
2030            tonic::Status,
2031        >;
2032        async fn users_create(
2033            &self,
2034            request: tonic::Request<super::user_manager::create::Req>,
2035        ) -> std::result::Result<
2036            tonic::Response<super::user_manager::create::Res>,
2037            tonic::Status,
2038        >;
2039        /// User API
2040        async fn users_update(
2041            &self,
2042            request: tonic::Request<super::user::update::Req>,
2043        ) -> std::result::Result<
2044            tonic::Response<super::user::update::Res>,
2045            tonic::Status,
2046        >;
2047        async fn users_delete(
2048            &self,
2049            request: tonic::Request<super::user::delete::Req>,
2050        ) -> std::result::Result<
2051            tonic::Response<super::user::delete::Res>,
2052            tonic::Status,
2053        >;
2054        /// Database Manager API
2055        async fn databases_get(
2056            &self,
2057            request: tonic::Request<super::database_manager::get::Req>,
2058        ) -> std::result::Result<
2059            tonic::Response<super::database_manager::get::Res>,
2060            tonic::Status,
2061        >;
2062        async fn databases_all(
2063            &self,
2064            request: tonic::Request<super::database_manager::all::Req>,
2065        ) -> std::result::Result<
2066            tonic::Response<super::database_manager::all::Res>,
2067            tonic::Status,
2068        >;
2069        async fn databases_contains(
2070            &self,
2071            request: tonic::Request<super::database_manager::contains::Req>,
2072        ) -> std::result::Result<
2073            tonic::Response<super::database_manager::contains::Res>,
2074            tonic::Status,
2075        >;
2076        async fn databases_create(
2077            &self,
2078            request: tonic::Request<super::database_manager::create::Req>,
2079        ) -> std::result::Result<
2080            tonic::Response<super::database_manager::create::Res>,
2081            tonic::Status,
2082        >;
2083        /// Server streaming response type for the databases_import method.
2084        type databases_importStream: tonic::codegen::tokio_stream::Stream<
2085                Item = std::result::Result<
2086                    super::database_manager::import::Server,
2087                    tonic::Status,
2088                >,
2089            >
2090            + std::marker::Send
2091            + 'static;
2092        async fn databases_import(
2093            &self,
2094            request: tonic::Request<
2095                tonic::Streaming<super::database_manager::import::Client>,
2096            >,
2097        ) -> std::result::Result<
2098            tonic::Response<Self::databases_importStream>,
2099            tonic::Status,
2100        >;
2101        /// Database API
2102        async fn database_schema(
2103            &self,
2104            request: tonic::Request<super::database::schema::Req>,
2105        ) -> std::result::Result<
2106            tonic::Response<super::database::schema::Res>,
2107            tonic::Status,
2108        >;
2109        async fn database_type_schema(
2110            &self,
2111            request: tonic::Request<super::database::type_schema::Req>,
2112        ) -> std::result::Result<
2113            tonic::Response<super::database::type_schema::Res>,
2114            tonic::Status,
2115        >;
2116        async fn database_delete(
2117            &self,
2118            request: tonic::Request<super::database::delete::Req>,
2119        ) -> std::result::Result<
2120            tonic::Response<super::database::delete::Res>,
2121            tonic::Status,
2122        >;
2123        /// Server streaming response type for the database_export method.
2124        type database_exportStream: tonic::codegen::tokio_stream::Stream<
2125                Item = std::result::Result<
2126                    super::database::export::Server,
2127                    tonic::Status,
2128                >,
2129            >
2130            + std::marker::Send
2131            + 'static;
2132        async fn database_export(
2133            &self,
2134            request: tonic::Request<super::database::export::Req>,
2135        ) -> std::result::Result<
2136            tonic::Response<Self::database_exportStream>,
2137            tonic::Status,
2138        >;
2139        /// Server streaming response type for the transaction method.
2140        type transactionStream: tonic::codegen::tokio_stream::Stream<
2141                Item = std::result::Result<super::transaction::Server, tonic::Status>,
2142            >
2143            + std::marker::Send
2144            + 'static;
2145        /// Transaction Streaming API
2146        /// Opens a bi-directional stream representing a stateful transaction, streaming
2147        /// requests and responses back-and-forth. The first transaction client message must
2148        /// be {Transaction.Open.Req}. Closing the stream closes the transaction.
2149        async fn transaction(
2150            &self,
2151            request: tonic::Request<tonic::Streaming<super::transaction::Client>>,
2152        ) -> std::result::Result<
2153            tonic::Response<Self::transactionStream>,
2154            tonic::Status,
2155        >;
2156    }
2157    #[derive(Debug)]
2158    pub struct TypeDbServer<T> {
2159        inner: Arc<T>,
2160        accept_compression_encodings: EnabledCompressionEncodings,
2161        send_compression_encodings: EnabledCompressionEncodings,
2162        max_decoding_message_size: Option<usize>,
2163        max_encoding_message_size: Option<usize>,
2164    }
2165    impl<T> TypeDbServer<T> {
2166        pub fn new(inner: T) -> Self {
2167            Self::from_arc(Arc::new(inner))
2168        }
2169        pub fn from_arc(inner: Arc<T>) -> Self {
2170            Self {
2171                inner,
2172                accept_compression_encodings: Default::default(),
2173                send_compression_encodings: Default::default(),
2174                max_decoding_message_size: None,
2175                max_encoding_message_size: None,
2176            }
2177        }
2178        pub fn with_interceptor<F>(
2179            inner: T,
2180            interceptor: F,
2181        ) -> InterceptedService<Self, F>
2182        where
2183            F: tonic::service::Interceptor,
2184        {
2185            InterceptedService::new(Self::new(inner), interceptor)
2186        }
2187        /// Enable decompressing requests with the given encoding.
2188        #[must_use]
2189        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2190            self.accept_compression_encodings.enable(encoding);
2191            self
2192        }
2193        /// Compress responses with the given encoding, if the client supports it.
2194        #[must_use]
2195        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2196            self.send_compression_encodings.enable(encoding);
2197            self
2198        }
2199        /// Limits the maximum size of a decoded message.
2200        ///
2201        /// Default: `4MB`
2202        #[must_use]
2203        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2204            self.max_decoding_message_size = Some(limit);
2205            self
2206        }
2207        /// Limits the maximum size of an encoded message.
2208        ///
2209        /// Default: `usize::MAX`
2210        #[must_use]
2211        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2212            self.max_encoding_message_size = Some(limit);
2213            self
2214        }
2215    }
2216    impl<T, B> tonic::codegen::Service<http::Request<B>> for TypeDbServer<T>
2217    where
2218        T: TypeDb,
2219        B: Body + std::marker::Send + 'static,
2220        B::Error: Into<StdError> + std::marker::Send + 'static,
2221    {
2222        type Response = http::Response<tonic::body::BoxBody>;
2223        type Error = std::convert::Infallible;
2224        type Future = BoxFuture<Self::Response, Self::Error>;
2225        fn poll_ready(
2226            &mut self,
2227            _cx: &mut Context<'_>,
2228        ) -> Poll<std::result::Result<(), Self::Error>> {
2229            Poll::Ready(Ok(()))
2230        }
2231        fn call(&mut self, req: http::Request<B>) -> Self::Future {
2232            match req.uri().path() {
2233                "/typedb.protocol.TypeDB/connection_open" => {
2234                    #[allow(non_camel_case_types)]
2235                    struct connection_openSvc<T: TypeDb>(pub Arc<T>);
2236                    impl<
2237                        T: TypeDb,
2238                    > tonic::server::UnaryService<super::connection::open::Req>
2239                    for connection_openSvc<T> {
2240                        type Response = super::connection::open::Res;
2241                        type Future = BoxFuture<
2242                            tonic::Response<Self::Response>,
2243                            tonic::Status,
2244                        >;
2245                        fn call(
2246                            &mut self,
2247                            request: tonic::Request<super::connection::open::Req>,
2248                        ) -> Self::Future {
2249                            let inner = Arc::clone(&self.0);
2250                            let fut = async move {
2251                                <T as TypeDb>::connection_open(&inner, request).await
2252                            };
2253                            Box::pin(fut)
2254                        }
2255                    }
2256                    let accept_compression_encodings = self.accept_compression_encodings;
2257                    let send_compression_encodings = self.send_compression_encodings;
2258                    let max_decoding_message_size = self.max_decoding_message_size;
2259                    let max_encoding_message_size = self.max_encoding_message_size;
2260                    let inner = self.inner.clone();
2261                    let fut = async move {
2262                        let method = connection_openSvc(inner);
2263                        let codec = tonic::codec::ProstCodec::default();
2264                        let mut grpc = tonic::server::Grpc::new(codec)
2265                            .apply_compression_config(
2266                                accept_compression_encodings,
2267                                send_compression_encodings,
2268                            )
2269                            .apply_max_message_size_config(
2270                                max_decoding_message_size,
2271                                max_encoding_message_size,
2272                            );
2273                        let res = grpc.unary(method, req).await;
2274                        Ok(res)
2275                    };
2276                    Box::pin(fut)
2277                }
2278                "/typedb.protocol.TypeDB/authentication_token_create" => {
2279                    #[allow(non_camel_case_types)]
2280                    struct authentication_token_createSvc<T: TypeDb>(pub Arc<T>);
2281                    impl<
2282                        T: TypeDb,
2283                    > tonic::server::UnaryService<
2284                        super::authentication::token::create::Req,
2285                    > for authentication_token_createSvc<T> {
2286                        type Response = super::authentication::token::create::Res;
2287                        type Future = BoxFuture<
2288                            tonic::Response<Self::Response>,
2289                            tonic::Status,
2290                        >;
2291                        fn call(
2292                            &mut self,
2293                            request: tonic::Request<
2294                                super::authentication::token::create::Req,
2295                            >,
2296                        ) -> Self::Future {
2297                            let inner = Arc::clone(&self.0);
2298                            let fut = async move {
2299                                <T as TypeDb>::authentication_token_create(&inner, request)
2300                                    .await
2301                            };
2302                            Box::pin(fut)
2303                        }
2304                    }
2305                    let accept_compression_encodings = self.accept_compression_encodings;
2306                    let send_compression_encodings = self.send_compression_encodings;
2307                    let max_decoding_message_size = self.max_decoding_message_size;
2308                    let max_encoding_message_size = self.max_encoding_message_size;
2309                    let inner = self.inner.clone();
2310                    let fut = async move {
2311                        let method = authentication_token_createSvc(inner);
2312                        let codec = tonic::codec::ProstCodec::default();
2313                        let mut grpc = tonic::server::Grpc::new(codec)
2314                            .apply_compression_config(
2315                                accept_compression_encodings,
2316                                send_compression_encodings,
2317                            )
2318                            .apply_max_message_size_config(
2319                                max_decoding_message_size,
2320                                max_encoding_message_size,
2321                            );
2322                        let res = grpc.unary(method, req).await;
2323                        Ok(res)
2324                    };
2325                    Box::pin(fut)
2326                }
2327                "/typedb.protocol.TypeDB/servers_all" => {
2328                    #[allow(non_camel_case_types)]
2329                    struct servers_allSvc<T: TypeDb>(pub Arc<T>);
2330                    impl<
2331                        T: TypeDb,
2332                    > tonic::server::UnaryService<super::server_manager::all::Req>
2333                    for servers_allSvc<T> {
2334                        type Response = super::server_manager::all::Res;
2335                        type Future = BoxFuture<
2336                            tonic::Response<Self::Response>,
2337                            tonic::Status,
2338                        >;
2339                        fn call(
2340                            &mut self,
2341                            request: tonic::Request<super::server_manager::all::Req>,
2342                        ) -> Self::Future {
2343                            let inner = Arc::clone(&self.0);
2344                            let fut = async move {
2345                                <T as TypeDb>::servers_all(&inner, request).await
2346                            };
2347                            Box::pin(fut)
2348                        }
2349                    }
2350                    let accept_compression_encodings = self.accept_compression_encodings;
2351                    let send_compression_encodings = self.send_compression_encodings;
2352                    let max_decoding_message_size = self.max_decoding_message_size;
2353                    let max_encoding_message_size = self.max_encoding_message_size;
2354                    let inner = self.inner.clone();
2355                    let fut = async move {
2356                        let method = servers_allSvc(inner);
2357                        let codec = tonic::codec::ProstCodec::default();
2358                        let mut grpc = tonic::server::Grpc::new(codec)
2359                            .apply_compression_config(
2360                                accept_compression_encodings,
2361                                send_compression_encodings,
2362                            )
2363                            .apply_max_message_size_config(
2364                                max_decoding_message_size,
2365                                max_encoding_message_size,
2366                            );
2367                        let res = grpc.unary(method, req).await;
2368                        Ok(res)
2369                    };
2370                    Box::pin(fut)
2371                }
2372                "/typedb.protocol.TypeDB/users_get" => {
2373                    #[allow(non_camel_case_types)]
2374                    struct users_getSvc<T: TypeDb>(pub Arc<T>);
2375                    impl<
2376                        T: TypeDb,
2377                    > tonic::server::UnaryService<super::user_manager::get::Req>
2378                    for users_getSvc<T> {
2379                        type Response = super::user_manager::get::Res;
2380                        type Future = BoxFuture<
2381                            tonic::Response<Self::Response>,
2382                            tonic::Status,
2383                        >;
2384                        fn call(
2385                            &mut self,
2386                            request: tonic::Request<super::user_manager::get::Req>,
2387                        ) -> Self::Future {
2388                            let inner = Arc::clone(&self.0);
2389                            let fut = async move {
2390                                <T as TypeDb>::users_get(&inner, request).await
2391                            };
2392                            Box::pin(fut)
2393                        }
2394                    }
2395                    let accept_compression_encodings = self.accept_compression_encodings;
2396                    let send_compression_encodings = self.send_compression_encodings;
2397                    let max_decoding_message_size = self.max_decoding_message_size;
2398                    let max_encoding_message_size = self.max_encoding_message_size;
2399                    let inner = self.inner.clone();
2400                    let fut = async move {
2401                        let method = users_getSvc(inner);
2402                        let codec = tonic::codec::ProstCodec::default();
2403                        let mut grpc = tonic::server::Grpc::new(codec)
2404                            .apply_compression_config(
2405                                accept_compression_encodings,
2406                                send_compression_encodings,
2407                            )
2408                            .apply_max_message_size_config(
2409                                max_decoding_message_size,
2410                                max_encoding_message_size,
2411                            );
2412                        let res = grpc.unary(method, req).await;
2413                        Ok(res)
2414                    };
2415                    Box::pin(fut)
2416                }
2417                "/typedb.protocol.TypeDB/users_all" => {
2418                    #[allow(non_camel_case_types)]
2419                    struct users_allSvc<T: TypeDb>(pub Arc<T>);
2420                    impl<
2421                        T: TypeDb,
2422                    > tonic::server::UnaryService<super::user_manager::all::Req>
2423                    for users_allSvc<T> {
2424                        type Response = super::user_manager::all::Res;
2425                        type Future = BoxFuture<
2426                            tonic::Response<Self::Response>,
2427                            tonic::Status,
2428                        >;
2429                        fn call(
2430                            &mut self,
2431                            request: tonic::Request<super::user_manager::all::Req>,
2432                        ) -> Self::Future {
2433                            let inner = Arc::clone(&self.0);
2434                            let fut = async move {
2435                                <T as TypeDb>::users_all(&inner, request).await
2436                            };
2437                            Box::pin(fut)
2438                        }
2439                    }
2440                    let accept_compression_encodings = self.accept_compression_encodings;
2441                    let send_compression_encodings = self.send_compression_encodings;
2442                    let max_decoding_message_size = self.max_decoding_message_size;
2443                    let max_encoding_message_size = self.max_encoding_message_size;
2444                    let inner = self.inner.clone();
2445                    let fut = async move {
2446                        let method = users_allSvc(inner);
2447                        let codec = tonic::codec::ProstCodec::default();
2448                        let mut grpc = tonic::server::Grpc::new(codec)
2449                            .apply_compression_config(
2450                                accept_compression_encodings,
2451                                send_compression_encodings,
2452                            )
2453                            .apply_max_message_size_config(
2454                                max_decoding_message_size,
2455                                max_encoding_message_size,
2456                            );
2457                        let res = grpc.unary(method, req).await;
2458                        Ok(res)
2459                    };
2460                    Box::pin(fut)
2461                }
2462                "/typedb.protocol.TypeDB/users_contains" => {
2463                    #[allow(non_camel_case_types)]
2464                    struct users_containsSvc<T: TypeDb>(pub Arc<T>);
2465                    impl<
2466                        T: TypeDb,
2467                    > tonic::server::UnaryService<super::user_manager::contains::Req>
2468                    for users_containsSvc<T> {
2469                        type Response = super::user_manager::contains::Res;
2470                        type Future = BoxFuture<
2471                            tonic::Response<Self::Response>,
2472                            tonic::Status,
2473                        >;
2474                        fn call(
2475                            &mut self,
2476                            request: tonic::Request<super::user_manager::contains::Req>,
2477                        ) -> Self::Future {
2478                            let inner = Arc::clone(&self.0);
2479                            let fut = async move {
2480                                <T as TypeDb>::users_contains(&inner, request).await
2481                            };
2482                            Box::pin(fut)
2483                        }
2484                    }
2485                    let accept_compression_encodings = self.accept_compression_encodings;
2486                    let send_compression_encodings = self.send_compression_encodings;
2487                    let max_decoding_message_size = self.max_decoding_message_size;
2488                    let max_encoding_message_size = self.max_encoding_message_size;
2489                    let inner = self.inner.clone();
2490                    let fut = async move {
2491                        let method = users_containsSvc(inner);
2492                        let codec = tonic::codec::ProstCodec::default();
2493                        let mut grpc = tonic::server::Grpc::new(codec)
2494                            .apply_compression_config(
2495                                accept_compression_encodings,
2496                                send_compression_encodings,
2497                            )
2498                            .apply_max_message_size_config(
2499                                max_decoding_message_size,
2500                                max_encoding_message_size,
2501                            );
2502                        let res = grpc.unary(method, req).await;
2503                        Ok(res)
2504                    };
2505                    Box::pin(fut)
2506                }
2507                "/typedb.protocol.TypeDB/users_create" => {
2508                    #[allow(non_camel_case_types)]
2509                    struct users_createSvc<T: TypeDb>(pub Arc<T>);
2510                    impl<
2511                        T: TypeDb,
2512                    > tonic::server::UnaryService<super::user_manager::create::Req>
2513                    for users_createSvc<T> {
2514                        type Response = super::user_manager::create::Res;
2515                        type Future = BoxFuture<
2516                            tonic::Response<Self::Response>,
2517                            tonic::Status,
2518                        >;
2519                        fn call(
2520                            &mut self,
2521                            request: tonic::Request<super::user_manager::create::Req>,
2522                        ) -> Self::Future {
2523                            let inner = Arc::clone(&self.0);
2524                            let fut = async move {
2525                                <T as TypeDb>::users_create(&inner, request).await
2526                            };
2527                            Box::pin(fut)
2528                        }
2529                    }
2530                    let accept_compression_encodings = self.accept_compression_encodings;
2531                    let send_compression_encodings = self.send_compression_encodings;
2532                    let max_decoding_message_size = self.max_decoding_message_size;
2533                    let max_encoding_message_size = self.max_encoding_message_size;
2534                    let inner = self.inner.clone();
2535                    let fut = async move {
2536                        let method = users_createSvc(inner);
2537                        let codec = tonic::codec::ProstCodec::default();
2538                        let mut grpc = tonic::server::Grpc::new(codec)
2539                            .apply_compression_config(
2540                                accept_compression_encodings,
2541                                send_compression_encodings,
2542                            )
2543                            .apply_max_message_size_config(
2544                                max_decoding_message_size,
2545                                max_encoding_message_size,
2546                            );
2547                        let res = grpc.unary(method, req).await;
2548                        Ok(res)
2549                    };
2550                    Box::pin(fut)
2551                }
2552                "/typedb.protocol.TypeDB/users_update" => {
2553                    #[allow(non_camel_case_types)]
2554                    struct users_updateSvc<T: TypeDb>(pub Arc<T>);
2555                    impl<T: TypeDb> tonic::server::UnaryService<super::user::update::Req>
2556                    for users_updateSvc<T> {
2557                        type Response = super::user::update::Res;
2558                        type Future = BoxFuture<
2559                            tonic::Response<Self::Response>,
2560                            tonic::Status,
2561                        >;
2562                        fn call(
2563                            &mut self,
2564                            request: tonic::Request<super::user::update::Req>,
2565                        ) -> Self::Future {
2566                            let inner = Arc::clone(&self.0);
2567                            let fut = async move {
2568                                <T as TypeDb>::users_update(&inner, request).await
2569                            };
2570                            Box::pin(fut)
2571                        }
2572                    }
2573                    let accept_compression_encodings = self.accept_compression_encodings;
2574                    let send_compression_encodings = self.send_compression_encodings;
2575                    let max_decoding_message_size = self.max_decoding_message_size;
2576                    let max_encoding_message_size = self.max_encoding_message_size;
2577                    let inner = self.inner.clone();
2578                    let fut = async move {
2579                        let method = users_updateSvc(inner);
2580                        let codec = tonic::codec::ProstCodec::default();
2581                        let mut grpc = tonic::server::Grpc::new(codec)
2582                            .apply_compression_config(
2583                                accept_compression_encodings,
2584                                send_compression_encodings,
2585                            )
2586                            .apply_max_message_size_config(
2587                                max_decoding_message_size,
2588                                max_encoding_message_size,
2589                            );
2590                        let res = grpc.unary(method, req).await;
2591                        Ok(res)
2592                    };
2593                    Box::pin(fut)
2594                }
2595                "/typedb.protocol.TypeDB/users_delete" => {
2596                    #[allow(non_camel_case_types)]
2597                    struct users_deleteSvc<T: TypeDb>(pub Arc<T>);
2598                    impl<T: TypeDb> tonic::server::UnaryService<super::user::delete::Req>
2599                    for users_deleteSvc<T> {
2600                        type Response = super::user::delete::Res;
2601                        type Future = BoxFuture<
2602                            tonic::Response<Self::Response>,
2603                            tonic::Status,
2604                        >;
2605                        fn call(
2606                            &mut self,
2607                            request: tonic::Request<super::user::delete::Req>,
2608                        ) -> Self::Future {
2609                            let inner = Arc::clone(&self.0);
2610                            let fut = async move {
2611                                <T as TypeDb>::users_delete(&inner, request).await
2612                            };
2613                            Box::pin(fut)
2614                        }
2615                    }
2616                    let accept_compression_encodings = self.accept_compression_encodings;
2617                    let send_compression_encodings = self.send_compression_encodings;
2618                    let max_decoding_message_size = self.max_decoding_message_size;
2619                    let max_encoding_message_size = self.max_encoding_message_size;
2620                    let inner = self.inner.clone();
2621                    let fut = async move {
2622                        let method = users_deleteSvc(inner);
2623                        let codec = tonic::codec::ProstCodec::default();
2624                        let mut grpc = tonic::server::Grpc::new(codec)
2625                            .apply_compression_config(
2626                                accept_compression_encodings,
2627                                send_compression_encodings,
2628                            )
2629                            .apply_max_message_size_config(
2630                                max_decoding_message_size,
2631                                max_encoding_message_size,
2632                            );
2633                        let res = grpc.unary(method, req).await;
2634                        Ok(res)
2635                    };
2636                    Box::pin(fut)
2637                }
2638                "/typedb.protocol.TypeDB/databases_get" => {
2639                    #[allow(non_camel_case_types)]
2640                    struct databases_getSvc<T: TypeDb>(pub Arc<T>);
2641                    impl<
2642                        T: TypeDb,
2643                    > tonic::server::UnaryService<super::database_manager::get::Req>
2644                    for databases_getSvc<T> {
2645                        type Response = super::database_manager::get::Res;
2646                        type Future = BoxFuture<
2647                            tonic::Response<Self::Response>,
2648                            tonic::Status,
2649                        >;
2650                        fn call(
2651                            &mut self,
2652                            request: tonic::Request<super::database_manager::get::Req>,
2653                        ) -> Self::Future {
2654                            let inner = Arc::clone(&self.0);
2655                            let fut = async move {
2656                                <T as TypeDb>::databases_get(&inner, request).await
2657                            };
2658                            Box::pin(fut)
2659                        }
2660                    }
2661                    let accept_compression_encodings = self.accept_compression_encodings;
2662                    let send_compression_encodings = self.send_compression_encodings;
2663                    let max_decoding_message_size = self.max_decoding_message_size;
2664                    let max_encoding_message_size = self.max_encoding_message_size;
2665                    let inner = self.inner.clone();
2666                    let fut = async move {
2667                        let method = databases_getSvc(inner);
2668                        let codec = tonic::codec::ProstCodec::default();
2669                        let mut grpc = tonic::server::Grpc::new(codec)
2670                            .apply_compression_config(
2671                                accept_compression_encodings,
2672                                send_compression_encodings,
2673                            )
2674                            .apply_max_message_size_config(
2675                                max_decoding_message_size,
2676                                max_encoding_message_size,
2677                            );
2678                        let res = grpc.unary(method, req).await;
2679                        Ok(res)
2680                    };
2681                    Box::pin(fut)
2682                }
2683                "/typedb.protocol.TypeDB/databases_all" => {
2684                    #[allow(non_camel_case_types)]
2685                    struct databases_allSvc<T: TypeDb>(pub Arc<T>);
2686                    impl<
2687                        T: TypeDb,
2688                    > tonic::server::UnaryService<super::database_manager::all::Req>
2689                    for databases_allSvc<T> {
2690                        type Response = super::database_manager::all::Res;
2691                        type Future = BoxFuture<
2692                            tonic::Response<Self::Response>,
2693                            tonic::Status,
2694                        >;
2695                        fn call(
2696                            &mut self,
2697                            request: tonic::Request<super::database_manager::all::Req>,
2698                        ) -> Self::Future {
2699                            let inner = Arc::clone(&self.0);
2700                            let fut = async move {
2701                                <T as TypeDb>::databases_all(&inner, request).await
2702                            };
2703                            Box::pin(fut)
2704                        }
2705                    }
2706                    let accept_compression_encodings = self.accept_compression_encodings;
2707                    let send_compression_encodings = self.send_compression_encodings;
2708                    let max_decoding_message_size = self.max_decoding_message_size;
2709                    let max_encoding_message_size = self.max_encoding_message_size;
2710                    let inner = self.inner.clone();
2711                    let fut = async move {
2712                        let method = databases_allSvc(inner);
2713                        let codec = tonic::codec::ProstCodec::default();
2714                        let mut grpc = tonic::server::Grpc::new(codec)
2715                            .apply_compression_config(
2716                                accept_compression_encodings,
2717                                send_compression_encodings,
2718                            )
2719                            .apply_max_message_size_config(
2720                                max_decoding_message_size,
2721                                max_encoding_message_size,
2722                            );
2723                        let res = grpc.unary(method, req).await;
2724                        Ok(res)
2725                    };
2726                    Box::pin(fut)
2727                }
2728                "/typedb.protocol.TypeDB/databases_contains" => {
2729                    #[allow(non_camel_case_types)]
2730                    struct databases_containsSvc<T: TypeDb>(pub Arc<T>);
2731                    impl<
2732                        T: TypeDb,
2733                    > tonic::server::UnaryService<super::database_manager::contains::Req>
2734                    for databases_containsSvc<T> {
2735                        type Response = super::database_manager::contains::Res;
2736                        type Future = BoxFuture<
2737                            tonic::Response<Self::Response>,
2738                            tonic::Status,
2739                        >;
2740                        fn call(
2741                            &mut self,
2742                            request: tonic::Request<
2743                                super::database_manager::contains::Req,
2744                            >,
2745                        ) -> Self::Future {
2746                            let inner = Arc::clone(&self.0);
2747                            let fut = async move {
2748                                <T as TypeDb>::databases_contains(&inner, request).await
2749                            };
2750                            Box::pin(fut)
2751                        }
2752                    }
2753                    let accept_compression_encodings = self.accept_compression_encodings;
2754                    let send_compression_encodings = self.send_compression_encodings;
2755                    let max_decoding_message_size = self.max_decoding_message_size;
2756                    let max_encoding_message_size = self.max_encoding_message_size;
2757                    let inner = self.inner.clone();
2758                    let fut = async move {
2759                        let method = databases_containsSvc(inner);
2760                        let codec = tonic::codec::ProstCodec::default();
2761                        let mut grpc = tonic::server::Grpc::new(codec)
2762                            .apply_compression_config(
2763                                accept_compression_encodings,
2764                                send_compression_encodings,
2765                            )
2766                            .apply_max_message_size_config(
2767                                max_decoding_message_size,
2768                                max_encoding_message_size,
2769                            );
2770                        let res = grpc.unary(method, req).await;
2771                        Ok(res)
2772                    };
2773                    Box::pin(fut)
2774                }
2775                "/typedb.protocol.TypeDB/databases_create" => {
2776                    #[allow(non_camel_case_types)]
2777                    struct databases_createSvc<T: TypeDb>(pub Arc<T>);
2778                    impl<
2779                        T: TypeDb,
2780                    > tonic::server::UnaryService<super::database_manager::create::Req>
2781                    for databases_createSvc<T> {
2782                        type Response = super::database_manager::create::Res;
2783                        type Future = BoxFuture<
2784                            tonic::Response<Self::Response>,
2785                            tonic::Status,
2786                        >;
2787                        fn call(
2788                            &mut self,
2789                            request: tonic::Request<super::database_manager::create::Req>,
2790                        ) -> Self::Future {
2791                            let inner = Arc::clone(&self.0);
2792                            let fut = async move {
2793                                <T as TypeDb>::databases_create(&inner, request).await
2794                            };
2795                            Box::pin(fut)
2796                        }
2797                    }
2798                    let accept_compression_encodings = self.accept_compression_encodings;
2799                    let send_compression_encodings = self.send_compression_encodings;
2800                    let max_decoding_message_size = self.max_decoding_message_size;
2801                    let max_encoding_message_size = self.max_encoding_message_size;
2802                    let inner = self.inner.clone();
2803                    let fut = async move {
2804                        let method = databases_createSvc(inner);
2805                        let codec = tonic::codec::ProstCodec::default();
2806                        let mut grpc = tonic::server::Grpc::new(codec)
2807                            .apply_compression_config(
2808                                accept_compression_encodings,
2809                                send_compression_encodings,
2810                            )
2811                            .apply_max_message_size_config(
2812                                max_decoding_message_size,
2813                                max_encoding_message_size,
2814                            );
2815                        let res = grpc.unary(method, req).await;
2816                        Ok(res)
2817                    };
2818                    Box::pin(fut)
2819                }
2820                "/typedb.protocol.TypeDB/databases_import" => {
2821                    #[allow(non_camel_case_types)]
2822                    struct databases_importSvc<T: TypeDb>(pub Arc<T>);
2823                    impl<
2824                        T: TypeDb,
2825                    > tonic::server::StreamingService<
2826                        super::database_manager::import::Client,
2827                    > for databases_importSvc<T> {
2828                        type Response = super::database_manager::import::Server;
2829                        type ResponseStream = T::databases_importStream;
2830                        type Future = BoxFuture<
2831                            tonic::Response<Self::ResponseStream>,
2832                            tonic::Status,
2833                        >;
2834                        fn call(
2835                            &mut self,
2836                            request: tonic::Request<
2837                                tonic::Streaming<super::database_manager::import::Client>,
2838                            >,
2839                        ) -> Self::Future {
2840                            let inner = Arc::clone(&self.0);
2841                            let fut = async move {
2842                                <T as TypeDb>::databases_import(&inner, request).await
2843                            };
2844                            Box::pin(fut)
2845                        }
2846                    }
2847                    let accept_compression_encodings = self.accept_compression_encodings;
2848                    let send_compression_encodings = self.send_compression_encodings;
2849                    let max_decoding_message_size = self.max_decoding_message_size;
2850                    let max_encoding_message_size = self.max_encoding_message_size;
2851                    let inner = self.inner.clone();
2852                    let fut = async move {
2853                        let method = databases_importSvc(inner);
2854                        let codec = tonic::codec::ProstCodec::default();
2855                        let mut grpc = tonic::server::Grpc::new(codec)
2856                            .apply_compression_config(
2857                                accept_compression_encodings,
2858                                send_compression_encodings,
2859                            )
2860                            .apply_max_message_size_config(
2861                                max_decoding_message_size,
2862                                max_encoding_message_size,
2863                            );
2864                        let res = grpc.streaming(method, req).await;
2865                        Ok(res)
2866                    };
2867                    Box::pin(fut)
2868                }
2869                "/typedb.protocol.TypeDB/database_schema" => {
2870                    #[allow(non_camel_case_types)]
2871                    struct database_schemaSvc<T: TypeDb>(pub Arc<T>);
2872                    impl<
2873                        T: TypeDb,
2874                    > tonic::server::UnaryService<super::database::schema::Req>
2875                    for database_schemaSvc<T> {
2876                        type Response = super::database::schema::Res;
2877                        type Future = BoxFuture<
2878                            tonic::Response<Self::Response>,
2879                            tonic::Status,
2880                        >;
2881                        fn call(
2882                            &mut self,
2883                            request: tonic::Request<super::database::schema::Req>,
2884                        ) -> Self::Future {
2885                            let inner = Arc::clone(&self.0);
2886                            let fut = async move {
2887                                <T as TypeDb>::database_schema(&inner, request).await
2888                            };
2889                            Box::pin(fut)
2890                        }
2891                    }
2892                    let accept_compression_encodings = self.accept_compression_encodings;
2893                    let send_compression_encodings = self.send_compression_encodings;
2894                    let max_decoding_message_size = self.max_decoding_message_size;
2895                    let max_encoding_message_size = self.max_encoding_message_size;
2896                    let inner = self.inner.clone();
2897                    let fut = async move {
2898                        let method = database_schemaSvc(inner);
2899                        let codec = tonic::codec::ProstCodec::default();
2900                        let mut grpc = tonic::server::Grpc::new(codec)
2901                            .apply_compression_config(
2902                                accept_compression_encodings,
2903                                send_compression_encodings,
2904                            )
2905                            .apply_max_message_size_config(
2906                                max_decoding_message_size,
2907                                max_encoding_message_size,
2908                            );
2909                        let res = grpc.unary(method, req).await;
2910                        Ok(res)
2911                    };
2912                    Box::pin(fut)
2913                }
2914                "/typedb.protocol.TypeDB/database_type_schema" => {
2915                    #[allow(non_camel_case_types)]
2916                    struct database_type_schemaSvc<T: TypeDb>(pub Arc<T>);
2917                    impl<
2918                        T: TypeDb,
2919                    > tonic::server::UnaryService<super::database::type_schema::Req>
2920                    for database_type_schemaSvc<T> {
2921                        type Response = super::database::type_schema::Res;
2922                        type Future = BoxFuture<
2923                            tonic::Response<Self::Response>,
2924                            tonic::Status,
2925                        >;
2926                        fn call(
2927                            &mut self,
2928                            request: tonic::Request<super::database::type_schema::Req>,
2929                        ) -> Self::Future {
2930                            let inner = Arc::clone(&self.0);
2931                            let fut = async move {
2932                                <T as TypeDb>::database_type_schema(&inner, request).await
2933                            };
2934                            Box::pin(fut)
2935                        }
2936                    }
2937                    let accept_compression_encodings = self.accept_compression_encodings;
2938                    let send_compression_encodings = self.send_compression_encodings;
2939                    let max_decoding_message_size = self.max_decoding_message_size;
2940                    let max_encoding_message_size = self.max_encoding_message_size;
2941                    let inner = self.inner.clone();
2942                    let fut = async move {
2943                        let method = database_type_schemaSvc(inner);
2944                        let codec = tonic::codec::ProstCodec::default();
2945                        let mut grpc = tonic::server::Grpc::new(codec)
2946                            .apply_compression_config(
2947                                accept_compression_encodings,
2948                                send_compression_encodings,
2949                            )
2950                            .apply_max_message_size_config(
2951                                max_decoding_message_size,
2952                                max_encoding_message_size,
2953                            );
2954                        let res = grpc.unary(method, req).await;
2955                        Ok(res)
2956                    };
2957                    Box::pin(fut)
2958                }
2959                "/typedb.protocol.TypeDB/database_delete" => {
2960                    #[allow(non_camel_case_types)]
2961                    struct database_deleteSvc<T: TypeDb>(pub Arc<T>);
2962                    impl<
2963                        T: TypeDb,
2964                    > tonic::server::UnaryService<super::database::delete::Req>
2965                    for database_deleteSvc<T> {
2966                        type Response = super::database::delete::Res;
2967                        type Future = BoxFuture<
2968                            tonic::Response<Self::Response>,
2969                            tonic::Status,
2970                        >;
2971                        fn call(
2972                            &mut self,
2973                            request: tonic::Request<super::database::delete::Req>,
2974                        ) -> Self::Future {
2975                            let inner = Arc::clone(&self.0);
2976                            let fut = async move {
2977                                <T as TypeDb>::database_delete(&inner, request).await
2978                            };
2979                            Box::pin(fut)
2980                        }
2981                    }
2982                    let accept_compression_encodings = self.accept_compression_encodings;
2983                    let send_compression_encodings = self.send_compression_encodings;
2984                    let max_decoding_message_size = self.max_decoding_message_size;
2985                    let max_encoding_message_size = self.max_encoding_message_size;
2986                    let inner = self.inner.clone();
2987                    let fut = async move {
2988                        let method = database_deleteSvc(inner);
2989                        let codec = tonic::codec::ProstCodec::default();
2990                        let mut grpc = tonic::server::Grpc::new(codec)
2991                            .apply_compression_config(
2992                                accept_compression_encodings,
2993                                send_compression_encodings,
2994                            )
2995                            .apply_max_message_size_config(
2996                                max_decoding_message_size,
2997                                max_encoding_message_size,
2998                            );
2999                        let res = grpc.unary(method, req).await;
3000                        Ok(res)
3001                    };
3002                    Box::pin(fut)
3003                }
3004                "/typedb.protocol.TypeDB/database_export" => {
3005                    #[allow(non_camel_case_types)]
3006                    struct database_exportSvc<T: TypeDb>(pub Arc<T>);
3007                    impl<
3008                        T: TypeDb,
3009                    > tonic::server::ServerStreamingService<super::database::export::Req>
3010                    for database_exportSvc<T> {
3011                        type Response = super::database::export::Server;
3012                        type ResponseStream = T::database_exportStream;
3013                        type Future = BoxFuture<
3014                            tonic::Response<Self::ResponseStream>,
3015                            tonic::Status,
3016                        >;
3017                        fn call(
3018                            &mut self,
3019                            request: tonic::Request<super::database::export::Req>,
3020                        ) -> Self::Future {
3021                            let inner = Arc::clone(&self.0);
3022                            let fut = async move {
3023                                <T as TypeDb>::database_export(&inner, request).await
3024                            };
3025                            Box::pin(fut)
3026                        }
3027                    }
3028                    let accept_compression_encodings = self.accept_compression_encodings;
3029                    let send_compression_encodings = self.send_compression_encodings;
3030                    let max_decoding_message_size = self.max_decoding_message_size;
3031                    let max_encoding_message_size = self.max_encoding_message_size;
3032                    let inner = self.inner.clone();
3033                    let fut = async move {
3034                        let method = database_exportSvc(inner);
3035                        let codec = tonic::codec::ProstCodec::default();
3036                        let mut grpc = tonic::server::Grpc::new(codec)
3037                            .apply_compression_config(
3038                                accept_compression_encodings,
3039                                send_compression_encodings,
3040                            )
3041                            .apply_max_message_size_config(
3042                                max_decoding_message_size,
3043                                max_encoding_message_size,
3044                            );
3045                        let res = grpc.server_streaming(method, req).await;
3046                        Ok(res)
3047                    };
3048                    Box::pin(fut)
3049                }
3050                "/typedb.protocol.TypeDB/transaction" => {
3051                    #[allow(non_camel_case_types)]
3052                    struct transactionSvc<T: TypeDb>(pub Arc<T>);
3053                    impl<
3054                        T: TypeDb,
3055                    > tonic::server::StreamingService<super::transaction::Client>
3056                    for transactionSvc<T> {
3057                        type Response = super::transaction::Server;
3058                        type ResponseStream = T::transactionStream;
3059                        type Future = BoxFuture<
3060                            tonic::Response<Self::ResponseStream>,
3061                            tonic::Status,
3062                        >;
3063                        fn call(
3064                            &mut self,
3065                            request: tonic::Request<
3066                                tonic::Streaming<super::transaction::Client>,
3067                            >,
3068                        ) -> Self::Future {
3069                            let inner = Arc::clone(&self.0);
3070                            let fut = async move {
3071                                <T as TypeDb>::transaction(&inner, request).await
3072                            };
3073                            Box::pin(fut)
3074                        }
3075                    }
3076                    let accept_compression_encodings = self.accept_compression_encodings;
3077                    let send_compression_encodings = self.send_compression_encodings;
3078                    let max_decoding_message_size = self.max_decoding_message_size;
3079                    let max_encoding_message_size = self.max_encoding_message_size;
3080                    let inner = self.inner.clone();
3081                    let fut = async move {
3082                        let method = transactionSvc(inner);
3083                        let codec = tonic::codec::ProstCodec::default();
3084                        let mut grpc = tonic::server::Grpc::new(codec)
3085                            .apply_compression_config(
3086                                accept_compression_encodings,
3087                                send_compression_encodings,
3088                            )
3089                            .apply_max_message_size_config(
3090                                max_decoding_message_size,
3091                                max_encoding_message_size,
3092                            );
3093                        let res = grpc.streaming(method, req).await;
3094                        Ok(res)
3095                    };
3096                    Box::pin(fut)
3097                }
3098                _ => {
3099                    Box::pin(async move {
3100                        let mut response = http::Response::new(empty_body());
3101                        let headers = response.headers_mut();
3102                        headers
3103                            .insert(
3104                                tonic::Status::GRPC_STATUS,
3105                                (tonic::Code::Unimplemented as i32).into(),
3106                            );
3107                        headers
3108                            .insert(
3109                                http::header::CONTENT_TYPE,
3110                                tonic::metadata::GRPC_CONTENT_TYPE,
3111                            );
3112                        Ok(response)
3113                    })
3114                }
3115            }
3116        }
3117    }
3118    impl<T> Clone for TypeDbServer<T> {
3119        fn clone(&self) -> Self {
3120            let inner = self.inner.clone();
3121            Self {
3122                inner,
3123                accept_compression_encodings: self.accept_compression_encodings,
3124                send_compression_encodings: self.send_compression_encodings,
3125                max_decoding_message_size: self.max_decoding_message_size,
3126                max_encoding_message_size: self.max_encoding_message_size,
3127            }
3128        }
3129    }
3130    /// Generated gRPC service name
3131    pub const SERVICE_NAME: &str = "typedb.protocol.TypeDB";
3132    impl<T> tonic::server::NamedService for TypeDbServer<T> {
3133        const NAME: &'static str = SERVICE_NAME;
3134    }
3135}