1#[allow(clippy::derive_partial_eq_without_eq)]
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct Entity {
4 #[prost(string, tag = "1")]
5 pub id: ::prost::alloc::string::String,
6 #[prost(message, repeated, tag = "4")]
7 pub traits: ::prost::alloc::vec::Vec<Trait>,
8 #[prost(message, optional, tag = "5")]
9 pub creation_date: ::core::option::Option<::prost_types::Timestamp>,
10 #[prost(message, optional, tag = "6")]
11 pub modification_date: ::core::option::Option<::prost_types::Timestamp>,
12 #[prost(message, optional, tag = "7")]
13 pub deletion_date: ::core::option::Option<::prost_types::Timestamp>,
14 #[prost(uint64, tag = "8")]
15 pub last_operation_id: u64,
16}
17#[allow(clippy::derive_partial_eq_without_eq)]
18#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct Trait {
20 #[prost(string, tag = "1")]
21 pub id: ::prost::alloc::string::String,
22 #[prost(message, optional, tag = "2")]
23 pub message: ::core::option::Option<::prost_types::Any>,
24 #[prost(message, optional, tag = "3")]
25 pub creation_date: ::core::option::Option<::prost_types::Timestamp>,
26 #[prost(message, optional, tag = "4")]
27 pub modification_date: ::core::option::Option<::prost_types::Timestamp>,
28 #[prost(message, optional, tag = "6")]
29 pub deletion_date: ::core::option::Option<::prost_types::Timestamp>,
30 #[prost(uint64, tag = "7")]
31 pub last_operation_id: u64,
32 #[prost(enumeration = "TraitDetails", tag = "5")]
33 pub details: i32,
34}
35#[allow(clippy::derive_partial_eq_without_eq)]
36#[derive(Clone, PartialEq, ::prost::Message)]
37pub struct Reference {
38 #[prost(string, tag = "1")]
39 pub entity_id: ::prost::alloc::string::String,
40 #[prost(string, tag = "2")]
41 pub trait_id: ::prost::alloc::string::String,
42}
43#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
44#[repr(i32)]
45pub enum TraitDetails {
46 Full = 0,
47 Partial = 1,
48}
49impl TraitDetails {
50 pub fn as_str_name(&self) -> &'static str {
56 match self {
57 TraitDetails::Full => "TRAIT_DETAILS_FULL",
58 TraitDetails::Partial => "TRAIT_DETAILS_PARTIAL",
59 }
60 }
61 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
63 match value {
64 "TRAIT_DETAILS_FULL" => Some(Self::Full),
65 "TRAIT_DETAILS_PARTIAL" => Some(Self::Partial),
66 _ => None,
67 }
68 }
69}
70#[allow(clippy::derive_partial_eq_without_eq)]
71#[derive(Clone, PartialEq, ::prost::Message)]
72pub struct EntityQuery {
73 #[prost(message, repeated, tag = "7")]
75 pub projections: ::prost::alloc::vec::Vec<Projection>,
76 #[prost(message, optional, tag = "5")]
78 pub paging: ::core::option::Option<Paging>,
79 #[prost(message, optional, tag = "6")]
81 pub ordering: ::core::option::Option<Ordering>,
82 #[prost(uint64, tag = "8")]
84 pub watch_token: u64,
85 #[prost(uint64, tag = "9")]
88 pub result_hash: u64,
89 #[prost(bool, tag = "12")]
94 pub include_deleted: bool,
95 #[prost(bool, tag = "13")]
99 pub programmatic: bool,
100 #[prost(
102 oneof = "entity_query::Predicate",
103 tags = "1, 2, 3, 4, 10, 11, 14, 15, 99"
104 )]
105 pub predicate: ::core::option::Option<entity_query::Predicate>,
106}
107pub mod entity_query {
109 #[allow(clippy::derive_partial_eq_without_eq)]
111 #[derive(Clone, PartialEq, ::prost::Oneof)]
112 pub enum Predicate {
113 #[prost(message, tag = "1")]
114 Match(super::MatchPredicate),
115 #[prost(message, tag = "2")]
116 Trait(super::TraitPredicate),
117 #[prost(message, tag = "3")]
118 Ids(super::IdsPredicate),
119 #[prost(message, tag = "4")]
120 Reference(super::ReferencePredicate),
121 #[prost(message, tag = "10")]
122 Operations(super::OperationsPredicate),
123 #[prost(message, tag = "11")]
124 All(super::AllPredicate),
125 #[prost(message, tag = "14")]
126 Boolean(super::BooleanPredicate),
127 #[prost(message, tag = "15")]
128 QueryString(super::QueryStringPredicate),
129 #[prost(message, tag = "99")]
130 Test(super::TestPredicate),
131 }
132}
133#[allow(clippy::derive_partial_eq_without_eq)]
134#[derive(Clone, PartialEq, ::prost::Message)]
135pub struct Projection {
136 #[prost(string, repeated, tag = "1")]
141 pub package: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
142 #[prost(bool, tag = "2")]
144 pub skip: bool,
145 #[prost(uint32, repeated, tag = "4")]
147 pub field_ids: ::prost::alloc::vec::Vec<u32>,
148 #[prost(uint32, repeated, tag = "5")]
151 pub field_group_ids: ::prost::alloc::vec::Vec<u32>,
152}
153#[allow(clippy::derive_partial_eq_without_eq)]
155#[derive(Clone, PartialEq, ::prost::Message)]
156pub struct MatchPredicate {
157 #[prost(string, tag = "1")]
159 pub query: ::prost::alloc::string::String,
160 #[prost(bool, tag = "2")]
162 pub no_fuzzy: bool,
163}
164#[allow(clippy::derive_partial_eq_without_eq)]
166#[derive(Clone, PartialEq, ::prost::Message)]
167pub struct IdsPredicate {
168 #[prost(string, repeated, tag = "1")]
169 pub ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
170}
171#[allow(clippy::derive_partial_eq_without_eq)]
175#[derive(Clone, PartialEq, ::prost::Message)]
176pub struct OperationsPredicate {
177 #[prost(uint64, repeated, tag = "1")]
178 pub operation_ids: ::prost::alloc::vec::Vec<u64>,
179}
180#[allow(clippy::derive_partial_eq_without_eq)]
182#[derive(Clone, PartialEq, ::prost::Message)]
183pub struct AllPredicate {}
184#[allow(clippy::derive_partial_eq_without_eq)]
186#[derive(Clone, PartialEq, ::prost::Message)]
187pub struct TestPredicate {
188 #[prost(bool, tag = "1")]
189 pub success: bool,
190}
191#[allow(clippy::derive_partial_eq_without_eq)]
193#[derive(Clone, PartialEq, ::prost::Message)]
194pub struct BooleanPredicate {
195 #[prost(message, repeated, tag = "1")]
196 pub queries: ::prost::alloc::vec::Vec<boolean_predicate::SubQuery>,
197}
198pub mod boolean_predicate {
200 #[allow(clippy::derive_partial_eq_without_eq)]
201 #[derive(Clone, PartialEq, ::prost::Message)]
202 pub struct SubQuery {
203 #[prost(enumeration = "Occur", tag = "1")]
204 pub occur: i32,
205 #[prost(oneof = "sub_query::Predicate", tags = "2, 3, 4, 5, 6, 7, 8")]
206 pub predicate: ::core::option::Option<sub_query::Predicate>,
207 }
208 pub mod sub_query {
210 #[allow(clippy::derive_partial_eq_without_eq)]
211 #[derive(Clone, PartialEq, ::prost::Oneof)]
212 pub enum Predicate {
213 #[prost(message, tag = "2")]
214 Match(super::super::MatchPredicate),
215 #[prost(message, tag = "3")]
216 Trait(super::super::TraitPredicate),
217 #[prost(message, tag = "4")]
218 Ids(super::super::IdsPredicate),
219 #[prost(message, tag = "5")]
220 Reference(super::super::ReferencePredicate),
221 #[prost(message, tag = "6")]
222 Operations(super::super::OperationsPredicate),
223 #[prost(message, tag = "7")]
224 All(super::super::AllPredicate),
225 #[prost(message, tag = "8")]
226 Boolean(super::super::BooleanPredicate),
227 }
228 }
229 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
230 #[repr(i32)]
231 pub enum Occur {
232 Should = 0,
233 Must = 1,
234 MustNot = 2,
235 }
236 impl Occur {
237 pub fn as_str_name(&self) -> &'static str {
244 match self {
245 Occur::Should => "SHOULD",
246 Occur::Must => "MUST",
247 Occur::MustNot => "MUST_NOT",
248 }
249 }
250 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
252 match value {
253 "SHOULD" => Some(Self::Should),
254 "MUST" => Some(Self::Must),
255 "MUST_NOT" => Some(Self::MustNot),
256 _ => None,
257 }
258 }
259 }
260}
261#[allow(clippy::derive_partial_eq_without_eq)]
264#[derive(Clone, PartialEq, ::prost::Message)]
265pub struct TraitPredicate {
266 #[prost(string, tag = "1")]
267 pub trait_name: ::prost::alloc::string::String,
268 #[prost(message, optional, tag = "2")]
269 pub query: ::core::option::Option<TraitQuery>,
270}
271#[allow(clippy::derive_partial_eq_without_eq)]
272#[derive(Clone, PartialEq, ::prost::Message)]
273pub struct TraitQuery {
274 #[prost(oneof = "trait_query::Predicate", tags = "1, 2, 3, 4")]
275 pub predicate: ::core::option::Option<trait_query::Predicate>,
276}
277pub mod trait_query {
279 #[allow(clippy::derive_partial_eq_without_eq)]
280 #[derive(Clone, PartialEq, ::prost::Oneof)]
281 pub enum Predicate {
282 #[prost(message, tag = "1")]
283 Match(super::MatchPredicate),
284 #[prost(message, tag = "2")]
285 Field(super::TraitFieldPredicate),
286 #[prost(message, tag = "3")]
287 Reference(super::TraitFieldReferencePredicate),
288 #[prost(message, tag = "4")]
289 QueryString(super::QueryStringPredicate),
290 }
291}
292#[allow(clippy::derive_partial_eq_without_eq)]
293#[derive(Clone, PartialEq, ::prost::Message)]
294pub struct TraitFieldPredicate {
295 #[prost(string, tag = "1")]
296 pub field: ::prost::alloc::string::String,
297 #[prost(enumeration = "trait_field_predicate::Operator", tag = "6")]
298 pub operator: i32,
299 #[prost(oneof = "trait_field_predicate::Value", tags = "2, 3, 4, 5")]
300 pub value: ::core::option::Option<trait_field_predicate::Value>,
301}
302pub mod trait_field_predicate {
304 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
305 #[repr(i32)]
306 pub enum Operator {
307 Equal = 0,
308 Gt = 1,
309 Gte = 2,
310 Lt = 3,
311 Lte = 4,
312 }
313 impl Operator {
314 pub fn as_str_name(&self) -> &'static str {
321 match self {
322 Operator::Equal => "EQUAL",
323 Operator::Gt => "GT",
324 Operator::Gte => "GTE",
325 Operator::Lt => "LT",
326 Operator::Lte => "LTE",
327 }
328 }
329 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
331 match value {
332 "EQUAL" => Some(Self::Equal),
333 "GT" => Some(Self::Gt),
334 "GTE" => Some(Self::Gte),
335 "LT" => Some(Self::Lt),
336 "LTE" => Some(Self::Lte),
337 _ => None,
338 }
339 }
340 }
341 #[allow(clippy::derive_partial_eq_without_eq)]
342 #[derive(Clone, PartialEq, ::prost::Oneof)]
343 pub enum Value {
344 #[prost(string, tag = "2")]
345 String(::prost::alloc::string::String),
346 #[prost(int64, tag = "3")]
347 Int64(i64),
348 #[prost(uint64, tag = "4")]
349 Uint64(u64),
350 #[prost(message, tag = "5")]
351 Date(::prost_types::Timestamp),
352 }
353}
354#[allow(clippy::derive_partial_eq_without_eq)]
355#[derive(Clone, PartialEq, ::prost::Message)]
356pub struct TraitFieldReferencePredicate {
357 #[prost(string, tag = "1")]
358 pub field: ::prost::alloc::string::String,
359 #[prost(message, optional, tag = "2")]
360 pub reference: ::core::option::Option<ReferencePredicate>,
361}
362#[allow(clippy::derive_partial_eq_without_eq)]
363#[derive(Clone, PartialEq, ::prost::Message)]
364pub struct ReferencePredicate {
365 #[prost(string, tag = "1")]
367 pub entity_id: ::prost::alloc::string::String,
368 #[prost(string, tag = "2")]
370 pub trait_id: ::prost::alloc::string::String,
371}
372#[allow(clippy::derive_partial_eq_without_eq)]
373#[derive(Clone, PartialEq, ::prost::Message)]
374pub struct QueryStringPredicate {
375 #[prost(string, tag = "1")]
376 pub query: ::prost::alloc::string::String,
377}
378#[allow(clippy::derive_partial_eq_without_eq)]
379#[derive(Clone, PartialEq, ::prost::Message)]
380pub struct Paging {
381 #[prost(message, optional, tag = "1")]
383 pub after_ordering_value: ::core::option::Option<OrderingValue>,
384 #[prost(message, optional, tag = "2")]
386 pub before_ordering_value: ::core::option::Option<OrderingValue>,
387 #[prost(uint32, tag = "3")]
389 pub count: u32,
390 #[prost(uint32, tag = "4")]
392 pub offset: u32,
393}
394#[allow(clippy::derive_partial_eq_without_eq)]
395#[derive(Clone, PartialEq, ::prost::Message)]
396pub struct Ordering {
397 #[prost(bool, tag = "4")]
399 pub ascending: bool,
400 #[prost(bool, tag = "5")]
402 pub no_recency_boost: bool,
403 #[prost(bool, tag = "6")]
405 pub no_reference_boost: bool,
406 #[prost(oneof = "ordering::Value", tags = "1, 2, 3, 7, 8")]
408 pub value: ::core::option::Option<ordering::Value>,
409}
410pub mod ordering {
412 #[allow(clippy::derive_partial_eq_without_eq)]
414 #[derive(Clone, PartialEq, ::prost::Oneof)]
415 pub enum Value {
416 #[prost(bool, tag = "1")]
418 Score(bool),
419 #[prost(bool, tag = "2")]
421 OperationId(bool),
422 #[prost(string, tag = "3")]
424 Field(::prost::alloc::string::String),
425 #[prost(bool, tag = "7")]
427 CreatedAt(bool),
428 #[prost(bool, tag = "8")]
430 UpdatedAt(bool),
431 }
432}
433#[allow(clippy::derive_partial_eq_without_eq)]
434#[derive(Clone, PartialEq, ::prost::Message)]
435pub struct OrderingValue {
436 #[prost(uint64, tag = "6")]
439 pub operation_id: u64,
440 #[prost(oneof = "ordering_value::Value", tags = "1, 2, 3, 4, 5")]
442 pub value: ::core::option::Option<ordering_value::Value>,
443}
444pub mod ordering_value {
446 #[allow(clippy::derive_partial_eq_without_eq)]
448 #[derive(Clone, PartialEq, ::prost::Oneof)]
449 pub enum Value {
450 #[prost(float, tag = "1")]
451 Float(f32),
452 #[prost(uint64, tag = "2")]
453 Uint64(u64),
454 #[prost(message, tag = "3")]
455 Date(::prost_types::Timestamp),
456 #[prost(bool, tag = "4")]
457 Min(bool),
458 #[prost(bool, tag = "5")]
459 Max(bool),
460 }
461}
462#[allow(clippy::derive_partial_eq_without_eq)]
463#[derive(Clone, PartialEq, ::prost::Message)]
464pub struct EntityResults {
465 #[prost(message, repeated, tag = "1")]
467 pub entities: ::prost::alloc::vec::Vec<EntityResult>,
468 #[prost(bool, tag = "2")]
472 pub skipped_hash: bool,
473 #[prost(uint32, tag = "3")]
476 pub estimated_count: u32,
477 #[prost(message, optional, tag = "4")]
479 pub current_page: ::core::option::Option<Paging>,
480 #[prost(message, optional, tag = "5")]
482 pub next_page: ::core::option::Option<Paging>,
483 #[prost(uint64, tag = "6")]
486 pub hash: u64,
487}
488#[allow(clippy::derive_partial_eq_without_eq)]
489#[derive(Clone, PartialEq, ::prost::Message)]
490pub struct EntityResult {
491 #[prost(message, optional, tag = "1")]
494 pub entity: ::core::option::Option<Entity>,
495 #[prost(enumeration = "EntityResultSource", tag = "2")]
506 pub source: i32,
507 #[prost(message, optional, tag = "3")]
511 pub ordering_value: ::core::option::Option<OrderingValue>,
512 #[prost(uint64, tag = "4")]
515 pub hash: u64,
516}
517#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
518#[repr(i32)]
519pub enum EntityResultSource {
520 Unknown = 0,
521 Pending = 1,
522 Chain = 2,
523}
524impl EntityResultSource {
525 pub fn as_str_name(&self) -> &'static str {
531 match self {
532 EntityResultSource::Unknown => "UNKNOWN",
533 EntityResultSource::Pending => "PENDING",
534 EntityResultSource::Chain => "CHAIN",
535 }
536 }
537 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
539 match value {
540 "UNKNOWN" => Some(Self::Unknown),
541 "PENDING" => Some(Self::Pending),
542 "CHAIN" => Some(Self::Chain),
543 _ => None,
544 }
545 }
546}
547#[allow(clippy::derive_partial_eq_without_eq)]
548#[derive(Clone, PartialEq, ::prost::Message)]
549pub struct MutationRequest {
550 #[prost(message, repeated, tag = "1")]
552 pub mutations: ::prost::alloc::vec::Vec<EntityMutation>,
553 #[prost(bool, tag = "2")]
555 pub wait_indexed: bool,
556 #[prost(bool, tag = "3")]
558 pub return_entities: bool,
559 #[prost(bool, tag = "4")]
562 pub common_entity_id: bool,
563}
564#[allow(clippy::derive_partial_eq_without_eq)]
565#[derive(Clone, PartialEq, ::prost::Message)]
566pub struct MutationResult {
567 #[prost(uint64, repeated, tag = "1")]
569 pub operation_ids: ::prost::alloc::vec::Vec<u64>,
570 #[prost(message, repeated, tag = "2")]
572 pub entities: ::prost::alloc::vec::Vec<Entity>,
573}
574#[allow(clippy::derive_partial_eq_without_eq)]
575#[derive(Clone, PartialEq, ::prost::Message)]
576pub struct EntityMutation {
577 #[prost(string, tag = "1")]
578 pub entity_id: ::prost::alloc::string::String,
579 #[prost(oneof = "entity_mutation::Mutation", tags = "2, 3, 4, 7, 99")]
580 pub mutation: ::core::option::Option<entity_mutation::Mutation>,
581}
582pub mod entity_mutation {
584 #[allow(clippy::derive_partial_eq_without_eq)]
585 #[derive(Clone, PartialEq, ::prost::Oneof)]
586 pub enum Mutation {
587 #[prost(message, tag = "2")]
588 PutTrait(super::PutTraitMutation),
589 #[prost(message, tag = "3")]
590 DeleteTrait(super::DeleteTraitMutation),
591 #[prost(message, tag = "4")]
592 DeleteEntity(super::DeleteEntityMutation),
593 #[prost(message, tag = "7")]
594 DeleteOperations(super::DeleteOperationsMutation),
595 #[prost(message, tag = "99")]
596 Test(super::TestMutation),
597 }
598}
599#[allow(clippy::derive_partial_eq_without_eq)]
601#[derive(Clone, PartialEq, ::prost::Message)]
602pub struct PutTraitMutation {
603 #[prost(message, optional, tag = "1")]
604 pub r#trait: ::core::option::Option<Trait>,
605}
606#[allow(clippy::derive_partial_eq_without_eq)]
608#[derive(Clone, PartialEq, ::prost::Message)]
609pub struct DeleteTraitMutation {
610 #[prost(string, tag = "1")]
611 pub trait_id: ::prost::alloc::string::String,
612}
613#[allow(clippy::derive_partial_eq_without_eq)]
615#[derive(Clone, PartialEq, ::prost::Message)]
616pub struct DeleteEntityMutation {}
617#[allow(clippy::derive_partial_eq_without_eq)]
623#[derive(Clone, PartialEq, ::prost::Message)]
624pub struct DeleteOperationsMutation {
625 #[prost(uint64, repeated, tag = "1")]
626 pub operation_ids: ::prost::alloc::vec::Vec<u64>,
627}
628#[allow(clippy::derive_partial_eq_without_eq)]
630#[derive(Clone, PartialEq, ::prost::Message)]
631pub struct TestMutation {
632 #[prost(bool, tag = "1")]
633 pub success: bool,
634}
635#[allow(clippy::derive_partial_eq_without_eq)]
637#[derive(Clone, PartialEq, ::prost::Message)]
638pub struct CommittedEntityMutation {
639 #[prost(uint64, tag = "1")]
640 pub block_offset: u64,
641 #[prost(uint64, tag = "2")]
642 pub operation_id: u64,
643 #[prost(message, optional, tag = "3")]
644 pub mutation: ::core::option::Option<EntityMutation>,
645}