1#[cfg(any(test, feature = "proptest"))]
11use proptest_derive::Arbitrary;
12use serde::{Deserialize, Serialize};
13use serde_repr::{Deserialize_repr, Serialize_repr};
14
15#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
16#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
17pub struct ConfigKey {
18 pub key: String,
19}
20
21#[derive(
22 Clone,
23 Copy,
24 Debug,
25 PartialEq,
26 Eq,
27 PartialOrd,
28 Ord,
29 Serialize,
30 Deserialize
31)]
32#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
33pub struct ConfigValue {
34 pub value: u64,
35}
36
37#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
38#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
39pub struct SettingKey {
40 pub name: String,
41}
42
43#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
44#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
45pub struct SettingValue {
46 pub value: String,
47}
48
49#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
50#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
51pub struct IdAllocKey {
52 pub name: String,
53}
54
55#[derive(
56 Clone,
57 Copy,
58 Debug,
59 PartialEq,
60 Eq,
61 PartialOrd,
62 Ord,
63 Serialize,
64 Deserialize
65)]
66#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
67pub struct IdAllocValue {
68 pub next_id: u64,
69}
70
71#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
72#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
73pub struct GidMappingKey {
74 pub schema_name: String,
75 pub object_type: CatalogItemType,
76 pub object_name: String,
77}
78
79#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
80#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
81pub struct GidMappingValue {
82 pub catalog_id: SystemCatalogItemId,
83 pub global_id: SystemGlobalId,
84 pub fingerprint: String,
85}
86
87#[derive(
88 Clone,
89 Copy,
90 Debug,
91 PartialEq,
92 Eq,
93 PartialOrd,
94 Ord,
95 Serialize,
96 Deserialize
97)]
98#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
99pub struct ClusterKey {
100 pub id: ClusterId,
101}
102
103#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
104#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
105pub struct ClusterValue {
106 pub name: String,
107 pub owner_id: RoleId,
108 pub privileges: Vec<MzAclItem>,
109 pub config: ClusterConfig,
110}
111
112#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
113#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
114pub struct ClusterIntrospectionSourceIndexKey {
115 pub cluster_id: ClusterId,
116 pub name: String,
117}
118
119#[derive(
120 Clone,
121 Copy,
122 Debug,
123 PartialEq,
124 Eq,
125 PartialOrd,
126 Ord,
127 Serialize,
128 Deserialize
129)]
130#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
131pub struct ClusterIntrospectionSourceIndexValue {
132 pub catalog_id: IntrospectionSourceIndexCatalogItemId,
133 pub global_id: IntrospectionSourceIndexGlobalId,
134 pub oid: u32,
135}
136
137#[derive(
138 Clone,
139 Copy,
140 Debug,
141 PartialEq,
142 Eq,
143 PartialOrd,
144 Ord,
145 Serialize,
146 Deserialize
147)]
148#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
149pub struct ClusterReplicaKey {
150 pub id: ReplicaId,
151}
152
153#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
154#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
155pub struct ClusterReplicaValue {
156 pub cluster_id: ClusterId,
157 pub name: String,
158 pub config: ReplicaConfig,
159 pub owner_id: RoleId,
160}
161
162#[derive(
163 Clone,
164 Copy,
165 Debug,
166 PartialEq,
167 Eq,
168 PartialOrd,
169 Ord,
170 Serialize,
171 Deserialize
172)]
173#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
174pub struct DatabaseKey {
175 pub id: DatabaseId,
176}
177
178#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
179#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
180pub struct DatabaseValue {
181 pub name: String,
182 pub owner_id: RoleId,
183 pub privileges: Vec<MzAclItem>,
184 pub oid: u32,
185}
186
187#[derive(
188 Clone,
189 Copy,
190 Debug,
191 PartialEq,
192 Eq,
193 PartialOrd,
194 Ord,
195 Serialize,
196 Deserialize
197)]
198#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
199pub struct SchemaKey {
200 pub id: SchemaId,
201}
202
203#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
204#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
205pub struct SchemaValue {
206 pub database_id: Option<DatabaseId>,
207 pub name: String,
208 pub owner_id: RoleId,
209 pub privileges: Vec<MzAclItem>,
210 pub oid: u32,
211}
212
213#[derive(
214 Clone,
215 Copy,
216 Debug,
217 PartialEq,
218 Eq,
219 PartialOrd,
220 Ord,
221 Serialize,
222 Deserialize
223)]
224#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
225pub struct ItemKey {
226 pub gid: CatalogItemId,
227}
228
229#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
230#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
231pub struct ItemValue {
232 pub schema_id: SchemaId,
233 pub name: String,
234 pub definition: CatalogItem,
235 pub owner_id: RoleId,
236 pub privileges: Vec<MzAclItem>,
237 pub oid: u32,
238 pub global_id: GlobalId,
239 pub extra_versions: Vec<ItemVersion>,
240}
241
242#[derive(
243 Clone,
244 Copy,
245 Debug,
246 PartialEq,
247 Eq,
248 PartialOrd,
249 Ord,
250 Serialize,
251 Deserialize
252)]
253#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
254pub struct ItemVersion {
255 pub global_id: GlobalId,
256 pub version: Version,
257}
258
259#[derive(
260 Clone,
261 Copy,
262 Debug,
263 PartialEq,
264 Eq,
265 PartialOrd,
266 Ord,
267 Serialize,
268 Deserialize
269)]
270#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
271pub struct RoleKey {
272 pub id: RoleId,
273}
274
275#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
276#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
277pub struct RoleValue {
278 pub name: String,
279 pub attributes: RoleAttributes,
280 pub membership: RoleMembership,
281 pub vars: RoleVars,
282 pub oid: u32,
283}
284
285#[derive(
286 Clone,
287 Copy,
288 Debug,
289 PartialEq,
290 Eq,
291 PartialOrd,
292 Ord,
293 Serialize,
294 Deserialize
295)]
296#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
297pub struct RoleAuthKey {
298 pub id: RoleId,
299}
300
301#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
302#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
303pub struct RoleAuthValue {
304 pub password_hash: Option<String>,
305 pub updated_at: EpochMillis,
306}
307
308#[derive(
309 Clone,
310 Copy,
311 Debug,
312 PartialEq,
313 Eq,
314 PartialOrd,
315 Ord,
316 Serialize,
317 Deserialize
318)]
319#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
320pub struct NetworkPolicyKey {
321 pub id: NetworkPolicyId,
322}
323
324#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
325#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
326pub struct NetworkPolicyValue {
327 pub name: String,
328 pub rules: Vec<NetworkPolicyRule>,
329 pub owner_id: RoleId,
330 pub privileges: Vec<MzAclItem>,
331 pub oid: u32,
332}
333
334#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
335#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
336pub struct ServerConfigurationKey {
337 pub name: String,
338}
339
340#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
341#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
342pub struct ServerConfigurationValue {
343 pub value: String,
344}
345
346#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
347#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
348pub struct AuditLogKey {
349 pub event: AuditLogEvent,
350}
351
352#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
353#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
354pub enum AuditLogEvent {
355 V1(AuditLogEventV1),
356}
357
358#[derive(
359 Clone,
360 Copy,
361 Debug,
362 PartialEq,
363 Eq,
364 PartialOrd,
365 Ord,
366 Serialize,
367 Deserialize
368)]
369#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
370pub struct CommentKey {
371 pub object: CommentObject,
372 pub sub_component: Option<CommentSubComponent>,
373}
374
375#[derive(
376 Clone,
377 Copy,
378 Debug,
379 PartialEq,
380 Eq,
381 PartialOrd,
382 Ord,
383 Serialize,
384 Deserialize
385)]
386#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
387pub enum CommentObject {
388 Table(CatalogItemId),
389 View(CatalogItemId),
390 MaterializedView(CatalogItemId),
391 Source(CatalogItemId),
392 Sink(CatalogItemId),
393 Index(CatalogItemId),
394 Func(CatalogItemId),
395 Connection(CatalogItemId),
396 Type(CatalogItemId),
397 Secret(CatalogItemId),
398 ContinualTask(CatalogItemId),
399 Role(RoleId),
400 Database(DatabaseId),
401 Schema(ResolvedSchema),
402 Cluster(ClusterId),
403 ClusterReplica(ClusterReplicaId),
404 NetworkPolicy(NetworkPolicyId),
405}
406
407#[derive(
408 Clone,
409 Copy,
410 Debug,
411 PartialEq,
412 Eq,
413 PartialOrd,
414 Ord,
415 Serialize,
416 Deserialize
417)]
418#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
419pub enum CommentSubComponent {
420 ColumnPos(u64),
421}
422
423#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
424#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
425pub struct CommentValue {
426 pub comment: String,
427}
428
429#[derive(
430 Clone,
431 Copy,
432 Debug,
433 PartialEq,
434 Eq,
435 PartialOrd,
436 Ord,
437 Serialize,
438 Deserialize
439)]
440#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
441pub struct SourceReferencesKey {
442 pub source: CatalogItemId,
443}
444
445#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
446#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
447pub struct SourceReferencesValue {
448 pub references: Vec<SourceReference>,
449 pub updated_at: EpochMillis,
450}
451
452#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
453#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
454pub struct SourceReference {
455 pub name: String,
456 pub namespace: Option<String>,
457 pub columns: Vec<String>,
458}
459
460#[derive(
461 Clone,
462 Copy,
463 Debug,
464 PartialEq,
465 Eq,
466 PartialOrd,
467 Ord,
468 Serialize,
469 Deserialize
470)]
471#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
472pub struct StorageCollectionMetadataKey {
473 pub id: GlobalId,
474}
475
476#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
477#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
478pub struct StorageCollectionMetadataValue {
479 pub shard: String,
480}
481
482#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
483#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
484pub struct UnfinalizedShardKey {
485 pub shard: String,
486}
487
488#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
489#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
490pub struct TxnWalShardValue {
491 pub shard: String,
492}
493
494#[derive(
495 Clone,
496 Copy,
497 Debug,
498 PartialEq,
499 Eq,
500 PartialOrd,
501 Ord,
502 Serialize,
503 Deserialize
504)]
505#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
506pub struct Empty {}
507
508#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
509#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
510pub struct StringWrapper {
511 pub inner: String,
512}
513
514#[derive(
515 Clone,
516 Copy,
517 Debug,
518 PartialEq,
519 Eq,
520 PartialOrd,
521 Ord,
522 Serialize,
523 Deserialize
524)]
525#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
526pub struct Duration {
527 pub secs: u64,
528 pub nanos: u32,
529}
530
531#[derive(
532 Clone,
533 Copy,
534 Debug,
535 PartialEq,
536 Eq,
537 PartialOrd,
538 Ord,
539 Serialize,
540 Deserialize
541)]
542#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
543pub struct EpochMillis {
544 pub millis: u64,
545}
546
547#[derive(
548 Clone,
549 Copy,
550 Debug,
551 PartialEq,
552 Eq,
553 PartialOrd,
554 Ord,
555 Serialize,
556 Deserialize
557)]
558#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
559pub struct Version {
560 pub value: u64,
561}
562
563#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
564#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
565pub enum CatalogItem {
566 V1(CatalogItemV1),
567}
568
569#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
570#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
571pub struct CatalogItemV1 {
572 pub create_sql: String,
573}
574
575#[derive(
576 Clone,
577 Copy,
578 Debug,
579 PartialEq,
580 Eq,
581 PartialOrd,
582 Ord,
583 Serialize,
584 Deserialize
585)]
586#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
587pub enum CatalogItemId {
588 System(u64),
589 User(u64),
590 Transient(u64),
591 IntrospectionSourceIndex(u64),
592}
593
594#[derive(
595 Clone,
596 Copy,
597 Debug,
598 PartialEq,
599 Eq,
600 PartialOrd,
601 Ord,
602 Serialize,
603 Deserialize
604)]
605#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
606pub struct SystemCatalogItemId(pub u64);
607
608#[derive(
609 Clone,
610 Copy,
611 Debug,
612 PartialEq,
613 Eq,
614 PartialOrd,
615 Ord,
616 Serialize,
617 Deserialize
618)]
619#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
620pub struct IntrospectionSourceIndexCatalogItemId(pub u64);
621
622#[derive(
623 Clone,
624 Copy,
625 Debug,
626 PartialEq,
627 Eq,
628 PartialOrd,
629 Ord,
630 Serialize,
631 Deserialize
632)]
633#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
634pub enum GlobalId {
635 System(u64),
636 User(u64),
637 Transient(u64),
638 Explain,
639 IntrospectionSourceIndex(u64),
640}
641
642#[derive(
643 Clone,
644 Copy,
645 Debug,
646 PartialEq,
647 Eq,
648 PartialOrd,
649 Ord,
650 Serialize,
651 Deserialize
652)]
653#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
654pub struct SystemGlobalId(pub u64);
655
656#[derive(
657 Clone,
658 Copy,
659 Debug,
660 PartialEq,
661 Eq,
662 PartialOrd,
663 Ord,
664 Serialize,
665 Deserialize
666)]
667#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
668pub struct IntrospectionSourceIndexGlobalId(pub u64);
669
670#[derive(
671 Clone,
672 Copy,
673 Debug,
674 PartialEq,
675 Eq,
676 PartialOrd,
677 Ord,
678 Serialize,
679 Deserialize
680)]
681#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
682pub enum ClusterId {
683 System(u64),
684 User(u64),
685}
686
687#[derive(
688 Clone,
689 Copy,
690 Debug,
691 PartialEq,
692 Eq,
693 PartialOrd,
694 Ord,
695 Serialize,
696 Deserialize
697)]
698#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
699pub enum DatabaseId {
700 System(u64),
701 User(u64),
702}
703
704#[derive(
705 Clone,
706 Copy,
707 Debug,
708 PartialEq,
709 Eq,
710 PartialOrd,
711 Ord,
712 Serialize,
713 Deserialize
714)]
715#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
716pub enum ResolvedDatabaseSpecifier {
717 Ambient,
718 Id(DatabaseId),
719}
720
721#[derive(
722 Clone,
723 Copy,
724 Debug,
725 PartialEq,
726 Eq,
727 PartialOrd,
728 Ord,
729 Serialize,
730 Deserialize
731)]
732#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
733pub enum SchemaId {
734 System(u64),
735 User(u64),
736}
737
738#[derive(
739 Clone,
740 Copy,
741 Debug,
742 PartialEq,
743 Eq,
744 PartialOrd,
745 Ord,
746 Serialize,
747 Deserialize
748)]
749#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
750pub enum SchemaSpecifier {
751 Temporary,
752 Id(SchemaId),
753}
754
755#[derive(
756 Clone,
757 Copy,
758 Debug,
759 PartialEq,
760 Eq,
761 PartialOrd,
762 Ord,
763 Serialize,
764 Deserialize
765)]
766#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
767pub struct ResolvedSchema {
768 pub database: ResolvedDatabaseSpecifier,
769 pub schema: SchemaSpecifier,
770}
771
772#[derive(
773 Clone,
774 Copy,
775 Debug,
776 PartialEq,
777 Eq,
778 PartialOrd,
779 Ord,
780 Serialize,
781 Deserialize
782)]
783#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
784pub enum ReplicaId {
785 System(u64),
786 User(u64),
787}
788
789#[derive(
790 Clone,
791 Copy,
792 Debug,
793 PartialEq,
794 Eq,
795 PartialOrd,
796 Ord,
797 Serialize,
798 Deserialize
799)]
800#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
801pub struct ClusterReplicaId {
802 pub cluster_id: ClusterId,
803 pub replica_id: ReplicaId,
804}
805
806#[derive(
807 Clone,
808 Copy,
809 Debug,
810 PartialEq,
811 Eq,
812 PartialOrd,
813 Ord,
814 Serialize,
815 Deserialize
816)]
817#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
818pub enum NetworkPolicyId {
819 System(u64),
820 User(u64),
821}
822
823#[derive(
824 Clone,
825 Copy,
826 Debug,
827 PartialEq,
828 Eq,
829 PartialOrd,
830 Ord,
831 Serialize,
832 Deserialize
833)]
834#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
835pub struct ReplicaLogging {
836 pub log_logging: bool,
837 pub interval: Option<Duration>,
838}
839
840#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
841#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
842pub struct OptimizerFeatureOverride {
843 pub name: String,
844 pub value: String,
845}
846
847#[derive(
848 Clone,
849 Copy,
850 Debug,
851 PartialEq,
852 Eq,
853 PartialOrd,
854 Ord,
855 Serialize,
856 Deserialize
857)]
858#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
859pub struct ClusterScheduleRefreshOptions {
860 pub rehydration_time_estimate: Duration,
861}
862
863#[derive(
864 Clone,
865 Copy,
866 Debug,
867 PartialEq,
868 Eq,
869 PartialOrd,
870 Ord,
871 Serialize,
872 Deserialize
873)]
874#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
875pub enum ClusterSchedule {
876 Manual,
877 Refresh(ClusterScheduleRefreshOptions),
878}
879
880#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
881#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
882pub struct ClusterConfig {
883 pub workload_class: Option<String>,
884 pub variant: ClusterVariant,
885}
886
887#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
888#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
889pub enum ClusterVariant {
890 Unmanaged,
891 Managed(ManagedCluster),
892}
893
894#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
895#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
896pub struct ManagedCluster {
897 pub size: String,
898 pub replication_factor: u32,
899 pub availability_zones: Vec<String>,
900 pub logging: ReplicaLogging,
901 pub optimizer_feature_overrides: Vec<OptimizerFeatureOverride>,
902 pub schedule: ClusterSchedule,
903}
904
905#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
906#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
907pub struct ReplicaConfig {
908 pub logging: ReplicaLogging,
909 pub location: ReplicaLocation,
910}
911
912#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
913#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
914pub struct UnmanagedLocation {
915 pub storagectl_addrs: Vec<String>,
916 pub computectl_addrs: Vec<String>,
917}
918
919#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
920#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
921pub struct ManagedLocation {
922 pub size: String,
923 pub availability_zone: Option<String>,
924 pub internal: bool,
925 pub billed_as: Option<String>,
926 pub pending: bool,
927}
928
929#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
930#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
931pub enum ReplicaLocation {
932 Unmanaged(UnmanagedLocation),
933 Managed(ManagedLocation),
934}
935
936#[derive(
937 Clone,
938 Copy,
939 Debug,
940 PartialEq,
941 Eq,
942 PartialOrd,
943 Ord,
944 Serialize,
945 Deserialize
946)]
947#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
948pub enum RoleId {
949 System(u64),
950 User(u64),
951 Public,
952 Predefined(u64),
953}
954
955#[derive(
956 Clone,
957 Copy,
958 Debug,
959 PartialEq,
960 Eq,
961 PartialOrd,
962 Ord,
963 Serialize,
964 Deserialize
965)]
966#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
967pub struct RoleAttributes {
968 pub inherit: bool,
969 pub superuser: Option<bool>,
970 pub login: Option<bool>,
971}
972
973#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
974#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
975pub struct RoleMembership {
976 pub map: Vec<RoleMembershipEntry>,
977}
978
979#[derive(
980 Clone,
981 Copy,
982 Debug,
983 PartialEq,
984 Eq,
985 PartialOrd,
986 Ord,
987 Serialize,
988 Deserialize
989)]
990#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
991pub struct RoleMembershipEntry {
992 pub key: RoleId,
993 pub value: RoleId,
994}
995
996#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
997#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
998pub struct RoleVars {
999 pub entries: Vec<RoleVarsEntry>,
1000}
1001
1002#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1003#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1004pub struct RoleVarsEntry {
1005 pub key: String,
1006 pub val: RoleVar,
1007}
1008
1009#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1010#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1011pub enum RoleVar {
1012 Flat(String),
1013 SqlSet(Vec<String>),
1014}
1015
1016#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1017#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1018pub struct NetworkPolicyRule {
1019 pub name: String,
1020 pub address: String,
1021 pub action: NetworkPolicyRuleAction,
1022 pub direction: NetworkPolicyRuleDirection,
1023}
1024
1025#[derive(
1026 Clone,
1027 Copy,
1028 Debug,
1029 PartialEq,
1030 Eq,
1031 PartialOrd,
1032 Ord,
1033 Serialize,
1034 Deserialize
1035)]
1036#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1037pub enum NetworkPolicyRuleAction {
1038 Allow,
1039}
1040
1041#[derive(
1042 Clone,
1043 Copy,
1044 Debug,
1045 PartialEq,
1046 Eq,
1047 PartialOrd,
1048 Ord,
1049 Serialize,
1050 Deserialize
1051)]
1052#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1053pub enum NetworkPolicyRuleDirection {
1054 Ingress,
1055}
1056
1057#[derive(
1058 Clone,
1059 Copy,
1060 Debug,
1061 PartialEq,
1062 Eq,
1063 PartialOrd,
1064 Ord,
1065 Serialize,
1066 Deserialize
1067)]
1068#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1069pub struct AclMode {
1070 pub bitflags: u64,
1071}
1072
1073#[derive(
1074 Clone,
1075 Copy,
1076 Debug,
1077 PartialEq,
1078 Eq,
1079 PartialOrd,
1080 Ord,
1081 Serialize,
1082 Deserialize
1083)]
1084#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1085pub struct MzAclItem {
1086 pub grantee: RoleId,
1087 pub grantor: RoleId,
1088 pub acl_mode: AclMode,
1089}
1090
1091#[derive(
1092 Clone,
1093 Copy,
1094 Debug,
1095 PartialEq,
1096 Eq,
1097 PartialOrd,
1098 Ord,
1099 Serialize,
1100 Deserialize
1101)]
1102#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1103pub struct DefaultPrivilegesKey {
1104 pub role_id: RoleId,
1105 pub database_id: Option<DatabaseId>,
1106 pub schema_id: Option<SchemaId>,
1107 pub object_type: ObjectType,
1108 pub grantee: RoleId,
1109}
1110
1111#[derive(
1112 Clone,
1113 Copy,
1114 Debug,
1115 PartialEq,
1116 Eq,
1117 PartialOrd,
1118 Ord,
1119 Serialize,
1120 Deserialize
1121)]
1122#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1123pub struct DefaultPrivilegesValue {
1124 pub privileges: AclMode,
1125}
1126
1127#[derive(
1128 Clone,
1129 Copy,
1130 Debug,
1131 PartialEq,
1132 Eq,
1133 PartialOrd,
1134 Ord,
1135 Serialize,
1136 Deserialize
1137)]
1138#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1139pub struct SystemPrivilegesKey {
1140 pub grantee: RoleId,
1141 pub grantor: RoleId,
1142}
1143
1144#[derive(
1145 Clone,
1146 Copy,
1147 Debug,
1148 PartialEq,
1149 Eq,
1150 PartialOrd,
1151 Ord,
1152 Serialize,
1153 Deserialize
1154)]
1155#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1156pub struct SystemPrivilegesValue {
1157 pub acl_mode: AclMode,
1158}
1159
1160#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1161#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1162pub struct AuditLogEventV1 {
1163 pub id: u64,
1164 pub event_type: audit_log_event_v1::EventType,
1165 pub object_type: audit_log_event_v1::ObjectType,
1166 pub user: Option<StringWrapper>,
1167 pub occurred_at: EpochMillis,
1168 pub details: audit_log_event_v1::Details,
1169}
1170
1171pub mod audit_log_event_v1 {
1172 use super::*;
1173
1174 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1175 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1176 pub struct IdFullNameV1 {
1177 pub id: String,
1178 pub name: FullNameV1,
1179 }
1180
1181 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1182 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1183 pub struct FullNameV1 {
1184 pub database: String,
1185 pub schema: String,
1186 pub item: String,
1187 }
1188
1189 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1190 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1191 pub struct IdNameV1 {
1192 pub id: String,
1193 pub name: String,
1194 }
1195
1196 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1197 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1198 pub struct RenameClusterV1 {
1199 pub id: String,
1200 pub old_name: String,
1201 pub new_name: String,
1202 }
1203
1204 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1205 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1206 pub struct RenameClusterReplicaV1 {
1207 pub cluster_id: String,
1208 pub replica_id: String,
1209 pub old_name: String,
1210 pub new_name: String,
1211 }
1212
1213 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1214 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1215 pub struct RenameItemV1 {
1216 pub id: String,
1217 pub old_name: FullNameV1,
1218 pub new_name: FullNameV1,
1219 }
1220
1221 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1222 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1223 pub struct CreateClusterReplicaV1 {
1224 pub cluster_id: String,
1225 pub cluster_name: String,
1226 pub replica_id: Option<StringWrapper>,
1227 pub replica_name: String,
1228 pub logical_size: String,
1229 pub disk: bool,
1230 pub billed_as: Option<String>,
1231 pub internal: bool,
1232 }
1233
1234 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1235 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1236 pub struct CreateClusterReplicaV2 {
1237 pub cluster_id: String,
1238 pub cluster_name: String,
1239 pub replica_id: Option<StringWrapper>,
1240 pub replica_name: String,
1241 pub logical_size: String,
1242 pub disk: bool,
1243 pub billed_as: Option<String>,
1244 pub internal: bool,
1245 pub reason: CreateOrDropClusterReplicaReasonV1,
1246 pub scheduling_policies: Option<SchedulingDecisionsWithReasonsV1>,
1247 }
1248
1249 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1250 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1251 pub struct CreateClusterReplicaV3 {
1252 pub cluster_id: String,
1253 pub cluster_name: String,
1254 pub replica_id: Option<StringWrapper>,
1255 pub replica_name: String,
1256 pub logical_size: String,
1257 pub disk: bool,
1258 pub billed_as: Option<String>,
1259 pub internal: bool,
1260 pub reason: CreateOrDropClusterReplicaReasonV1,
1261 pub scheduling_policies: Option<SchedulingDecisionsWithReasonsV2>,
1262 }
1263
1264 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1265 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1266 pub struct CreateClusterReplicaV4 {
1267 pub cluster_id: String,
1268 pub cluster_name: String,
1269 pub replica_id: Option<StringWrapper>,
1270 pub replica_name: String,
1271 pub logical_size: String,
1272 pub billed_as: Option<String>,
1273 pub internal: bool,
1274 pub reason: CreateOrDropClusterReplicaReasonV1,
1275 pub scheduling_policies: Option<SchedulingDecisionsWithReasonsV2>,
1276 }
1277
1278 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1279 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1280 pub struct DropClusterReplicaV1 {
1281 pub cluster_id: String,
1282 pub cluster_name: String,
1283 pub replica_id: Option<StringWrapper>,
1284 pub replica_name: String,
1285 }
1286
1287 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1288 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1289 pub struct DropClusterReplicaV2 {
1290 pub cluster_id: String,
1291 pub cluster_name: String,
1292 pub replica_id: Option<StringWrapper>,
1293 pub replica_name: String,
1294 pub reason: CreateOrDropClusterReplicaReasonV1,
1295 pub scheduling_policies: Option<SchedulingDecisionsWithReasonsV1>,
1296 }
1297
1298 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1299 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1300 pub struct DropClusterReplicaV3 {
1301 pub cluster_id: String,
1302 pub cluster_name: String,
1303 pub replica_id: Option<StringWrapper>,
1304 pub replica_name: String,
1305 pub reason: CreateOrDropClusterReplicaReasonV1,
1306 pub scheduling_policies: Option<SchedulingDecisionsWithReasonsV2>,
1307 }
1308
1309 #[derive(
1310 Clone,
1311 Copy,
1312 Debug,
1313 PartialEq,
1314 Eq,
1315 PartialOrd,
1316 Ord,
1317 Serialize,
1318 Deserialize
1319 )]
1320 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1321 pub struct CreateOrDropClusterReplicaReasonV1 {
1322 pub reason: CreateOrDropClusterReplicaReasonV1Reason,
1323 }
1324
1325 #[derive(
1326 Clone,
1327 Copy,
1328 Debug,
1329 PartialEq,
1330 Eq,
1331 PartialOrd,
1332 Ord,
1333 Serialize,
1334 Deserialize
1335 )]
1336 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1337 pub enum CreateOrDropClusterReplicaReasonV1Reason {
1338 Manual(Empty),
1339 Schedule(Empty),
1340 System(Empty),
1341 }
1342
1343 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1344 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1345 pub struct SchedulingDecisionsWithReasonsV1 {
1346 pub on_refresh: RefreshDecisionWithReasonV1,
1347 }
1348
1349 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1350 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1351 pub struct SchedulingDecisionsWithReasonsV2 {
1352 pub on_refresh: RefreshDecisionWithReasonV2,
1353 }
1354
1355 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1356 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1357 pub enum RefreshDecision {
1358 On(Empty),
1359 Off(Empty),
1360 }
1361
1362 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1363 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1364 pub struct RefreshDecisionWithReasonV1 {
1365 pub objects_needing_refresh: Vec<String>,
1366 pub rehydration_time_estimate: String,
1367 pub decision: RefreshDecision,
1368 }
1369
1370 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1371 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1372 pub struct RefreshDecisionWithReasonV2 {
1373 pub objects_needing_refresh: Vec<String>,
1374 pub objects_needing_compaction: Vec<String>,
1375 pub rehydration_time_estimate: String,
1376 pub decision: RefreshDecision,
1377 }
1378
1379 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1380 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1381 pub struct CreateSourceSinkV1 {
1382 pub id: String,
1383 pub name: FullNameV1,
1384 pub size: Option<StringWrapper>,
1385 }
1386
1387 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1388 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1389 pub struct CreateSourceSinkV2 {
1390 pub id: String,
1391 pub name: FullNameV1,
1392 pub size: Option<StringWrapper>,
1393 pub external_type: String,
1394 }
1395
1396 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1397 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1398 pub struct CreateSourceSinkV3 {
1399 pub id: String,
1400 pub name: FullNameV1,
1401 pub external_type: String,
1402 }
1403
1404 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1405 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1406 pub struct CreateSourceSinkV4 {
1407 pub id: String,
1408 pub cluster_id: Option<StringWrapper>,
1409 pub name: FullNameV1,
1410 pub external_type: String,
1411 }
1412
1413 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1414 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1415 pub struct CreateIndexV1 {
1416 pub id: String,
1417 pub cluster_id: String,
1418 pub name: FullNameV1,
1419 }
1420
1421 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1422 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1423 pub struct CreateMaterializedViewV1 {
1424 pub id: String,
1425 pub cluster_id: String,
1426 pub name: FullNameV1,
1427 pub replacement_target_id: Option<String>,
1428 }
1429
1430 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1431 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1432 pub struct AlterApplyReplacementV1 {
1433 pub target: IdFullNameV1,
1434 pub replacement: IdFullNameV1,
1435 }
1436
1437 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1438 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1439 pub struct AlterSourceSinkV1 {
1440 pub id: String,
1441 pub name: FullNameV1,
1442 pub old_size: Option<StringWrapper>,
1443 pub new_size: Option<StringWrapper>,
1444 }
1445
1446 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1447 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1448 pub struct AlterSetClusterV1 {
1449 pub id: String,
1450 pub name: FullNameV1,
1451 pub old_cluster_id: String,
1452 pub new_cluster_id: String,
1453 }
1454
1455 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1456 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1457 pub struct GrantRoleV1 {
1458 pub role_id: String,
1459 pub member_id: String,
1460 pub grantor_id: String,
1461 }
1462
1463 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1464 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1465 pub struct GrantRoleV2 {
1466 pub role_id: String,
1467 pub member_id: String,
1468 pub grantor_id: String,
1469 pub executed_by: String,
1470 }
1471
1472 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1473 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1474 pub struct RevokeRoleV1 {
1475 pub role_id: String,
1476 pub member_id: String,
1477 }
1478
1479 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1480 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1481 pub struct RevokeRoleV2 {
1482 pub role_id: String,
1483 pub member_id: String,
1484 pub grantor_id: String,
1485 pub executed_by: String,
1486 }
1487
1488 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1489 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1490 pub struct UpdatePrivilegeV1 {
1491 pub object_id: String,
1492 pub grantee_id: String,
1493 pub grantor_id: String,
1494 pub privileges: String,
1495 }
1496
1497 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1498 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1499 pub struct AlterDefaultPrivilegeV1 {
1500 pub role_id: String,
1501 pub database_id: Option<StringWrapper>,
1502 pub schema_id: Option<StringWrapper>,
1503 pub grantee_id: String,
1504 pub privileges: String,
1505 }
1506
1507 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1508 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1509 pub struct UpdateOwnerV1 {
1510 pub object_id: String,
1511 pub old_owner_id: String,
1512 pub new_owner_id: String,
1513 }
1514
1515 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1516 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1517 pub struct SchemaV1 {
1518 pub id: String,
1519 pub name: String,
1520 pub database_name: String,
1521 }
1522
1523 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1524 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1525 pub struct SchemaV2 {
1526 pub id: String,
1527 pub name: String,
1528 pub database_name: Option<StringWrapper>,
1529 }
1530
1531 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1532 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1533 pub struct RenameSchemaV1 {
1534 pub id: String,
1535 pub database_name: Option<String>,
1536 pub old_name: String,
1537 pub new_name: String,
1538 }
1539
1540 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1541 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1542 pub struct UpdateItemV1 {
1543 pub id: String,
1544 pub name: FullNameV1,
1545 }
1546
1547 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1548 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1549 pub struct AlterRetainHistoryV1 {
1550 pub id: String,
1551 pub old_history: Option<String>,
1552 pub new_history: Option<String>,
1553 }
1554
1555 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1556 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1557 pub struct ToNewIdV1 {
1558 pub id: String,
1559 pub new_id: String,
1560 }
1561
1562 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1563 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1564 pub struct FromPreviousIdV1 {
1565 pub id: String,
1566 pub previous_id: String,
1567 }
1568
1569 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1570 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1571 pub struct SetV1 {
1572 pub name: String,
1573 pub value: Option<String>,
1574 }
1575
1576 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1577 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1578 pub struct RotateKeysV1 {
1579 pub id: String,
1580 pub name: String,
1581 }
1582
1583 #[derive(
1584 Clone,
1585 Copy,
1586 Debug,
1587 PartialEq,
1588 Eq,
1589 Hash,
1590 PartialOrd,
1591 Ord,
1592 Serialize_repr,
1593 Deserialize_repr
1594 )]
1595 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1596 #[repr(u8)]
1597 pub enum EventType {
1598 Unknown = 0,
1599 Create = 1,
1600 Drop = 2,
1601 Alter = 3,
1602 Grant = 4,
1603 Revoke = 5,
1604 Comment = 6,
1605 }
1606
1607 #[derive(
1608 Clone,
1609 Copy,
1610 Debug,
1611 PartialEq,
1612 Eq,
1613 Hash,
1614 PartialOrd,
1615 Ord,
1616 Serialize_repr,
1617 Deserialize_repr
1618 )]
1619 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1620 #[repr(u8)]
1621 pub enum ObjectType {
1622 Unknown = 0,
1623 Cluster = 1,
1624 ClusterReplica = 2,
1625 Connection = 3,
1626 Database = 4,
1627 Func = 5,
1628 Index = 6,
1629 MaterializedView = 7,
1630 Role = 8,
1631 Secret = 9,
1632 Schema = 10,
1633 Sink = 11,
1634 Source = 12,
1635 Table = 13,
1636 Type = 14,
1637 View = 15,
1638 System = 16,
1639 ContinualTask = 17,
1640 NetworkPolicy = 18,
1641 }
1642
1643 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1644 #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1645 pub enum Details {
1646 CreateClusterReplicaV1(CreateClusterReplicaV1),
1647 CreateClusterReplicaV2(CreateClusterReplicaV2),
1648 CreateClusterReplicaV3(CreateClusterReplicaV3),
1649 CreateClusterReplicaV4(CreateClusterReplicaV4),
1650 DropClusterReplicaV1(DropClusterReplicaV1),
1651 DropClusterReplicaV2(DropClusterReplicaV2),
1652 DropClusterReplicaV3(DropClusterReplicaV3),
1653 CreateSourceSinkV1(CreateSourceSinkV1),
1654 CreateSourceSinkV2(CreateSourceSinkV2),
1655 AlterSourceSinkV1(AlterSourceSinkV1),
1656 AlterSetClusterV1(AlterSetClusterV1),
1657 GrantRoleV1(GrantRoleV1),
1658 GrantRoleV2(GrantRoleV2),
1659 RevokeRoleV1(RevokeRoleV1),
1660 RevokeRoleV2(RevokeRoleV2),
1661 UpdatePrivilegeV1(UpdatePrivilegeV1),
1662 AlterDefaultPrivilegeV1(AlterDefaultPrivilegeV1),
1663 UpdateOwnerV1(UpdateOwnerV1),
1664 IdFullNameV1(IdFullNameV1),
1665 RenameClusterV1(RenameClusterV1),
1666 RenameClusterReplicaV1(RenameClusterReplicaV1),
1667 RenameItemV1(RenameItemV1),
1668 IdNameV1(IdNameV1),
1669 SchemaV1(SchemaV1),
1670 SchemaV2(SchemaV2),
1671 RenameSchemaV1(RenameSchemaV1),
1672 UpdateItemV1(UpdateItemV1),
1673 CreateSourceSinkV3(CreateSourceSinkV3),
1674 AlterRetainHistoryV1(AlterRetainHistoryV1),
1675 ToNewIdV1(ToNewIdV1),
1676 FromPreviousIdV1(FromPreviousIdV1),
1677 SetV1(SetV1),
1678 ResetAllV1(Empty),
1679 RotateKeysV1(RotateKeysV1),
1680 CreateSourceSinkV4(CreateSourceSinkV4),
1681 CreateIndexV1(CreateIndexV1),
1682 CreateMaterializedViewV1(CreateMaterializedViewV1),
1683 AlterApplyReplacementV1(AlterApplyReplacementV1),
1684 }
1685}
1686
1687#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1689#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1690#[serde(tag = "kind")]
1693pub enum StateUpdateKind {
1694 AuditLog(AuditLog),
1695 Cluster(Cluster),
1696 ClusterIntrospectionSourceIndex(ClusterIntrospectionSourceIndex),
1697 ClusterReplica(ClusterReplica),
1698 Comment(Comment),
1699 Config(Config),
1700 Database(Database),
1701 DefaultPrivileges(DefaultPrivileges),
1702 FenceToken(FenceToken),
1703 GidMapping(GidMapping),
1704 IdAlloc(IdAlloc),
1705 Item(Item),
1706 NetworkPolicy(NetworkPolicy),
1707 Role(Role),
1708 RoleAuth(RoleAuth),
1709 Schema(Schema),
1710 ServerConfiguration(ServerConfiguration),
1711 Setting(Setting),
1712 SourceReferences(SourceReferences),
1713 StorageCollectionMetadata(StorageCollectionMetadata),
1714 SystemPrivileges(SystemPrivileges),
1715 TxnWalShard(TxnWalShard),
1716 UnfinalizedShard(UnfinalizedShard),
1717}
1718
1719#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1720#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1721pub struct AuditLog {
1722 pub key: AuditLogKey,
1723}
1724
1725#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1726#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1727pub struct Cluster {
1728 pub key: ClusterKey,
1729 pub value: ClusterValue,
1730}
1731
1732#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1733#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1734pub struct ClusterReplica {
1735 pub key: ClusterReplicaKey,
1736 pub value: ClusterReplicaValue,
1737}
1738
1739#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1740#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1741pub struct Comment {
1742 pub key: CommentKey,
1743 pub value: CommentValue,
1744}
1745
1746#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1747#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1748pub struct Config {
1749 pub key: ConfigKey,
1750 pub value: ConfigValue,
1751}
1752
1753#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1754#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1755pub struct Database {
1756 pub key: DatabaseKey,
1757 pub value: DatabaseValue,
1758}
1759
1760#[derive(
1761 Clone,
1762 Copy,
1763 Debug,
1764 PartialEq,
1765 Eq,
1766 PartialOrd,
1767 Ord,
1768 Serialize,
1769 Deserialize
1770)]
1771#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1772pub struct DefaultPrivileges {
1773 pub key: DefaultPrivilegesKey,
1774 pub value: DefaultPrivilegesValue,
1775}
1776
1777#[derive(
1778 Clone,
1779 Copy,
1780 Debug,
1781 PartialEq,
1782 Eq,
1783 PartialOrd,
1784 Ord,
1785 Serialize,
1786 Deserialize
1787)]
1788#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1789pub struct FenceToken {
1790 pub deploy_generation: u64,
1791 pub epoch: i64,
1792}
1793
1794#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1795#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1796pub struct IdAlloc {
1797 pub key: IdAllocKey,
1798 pub value: IdAllocValue,
1799}
1800
1801#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1802#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1803pub struct ClusterIntrospectionSourceIndex {
1804 pub key: ClusterIntrospectionSourceIndexKey,
1805 pub value: ClusterIntrospectionSourceIndexValue,
1806}
1807
1808#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1809#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1810pub struct Item {
1811 pub key: ItemKey,
1812 pub value: ItemValue,
1813}
1814
1815#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1816#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1817pub struct Role {
1818 pub key: RoleKey,
1819 pub value: RoleValue,
1820}
1821
1822#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1823#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1824pub struct RoleAuth {
1825 pub key: RoleAuthKey,
1826 pub value: RoleAuthValue,
1827}
1828
1829#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1830#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1831pub struct NetworkPolicy {
1832 pub key: NetworkPolicyKey,
1833 pub value: NetworkPolicyValue,
1834}
1835
1836#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1837#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1838pub struct Schema {
1839 pub key: SchemaKey,
1840 pub value: SchemaValue,
1841}
1842
1843#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1844#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1845pub struct Setting {
1846 pub key: SettingKey,
1847 pub value: SettingValue,
1848}
1849
1850#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1851#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1852pub struct ServerConfiguration {
1853 pub key: ServerConfigurationKey,
1854 pub value: ServerConfigurationValue,
1855}
1856
1857#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1858#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1859pub struct SourceReferences {
1860 pub key: SourceReferencesKey,
1861 pub value: SourceReferencesValue,
1862}
1863
1864#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1865#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1866pub struct GidMapping {
1867 pub key: GidMappingKey,
1868 pub value: GidMappingValue,
1869}
1870
1871#[derive(
1872 Clone,
1873 Copy,
1874 Debug,
1875 PartialEq,
1876 Eq,
1877 PartialOrd,
1878 Ord,
1879 Serialize,
1880 Deserialize
1881)]
1882#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1883pub struct SystemPrivileges {
1884 pub key: SystemPrivilegesKey,
1885 pub value: SystemPrivilegesValue,
1886}
1887
1888#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1889#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1890pub struct StorageCollectionMetadata {
1891 pub key: StorageCollectionMetadataKey,
1892 pub value: StorageCollectionMetadataValue,
1893}
1894
1895#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1896#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1897pub struct UnfinalizedShard {
1898 pub key: UnfinalizedShardKey,
1899}
1900
1901#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1902#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1903pub struct TxnWalShard {
1904 pub value: TxnWalShardValue,
1905}
1906
1907#[derive(
1908 Clone,
1909 Copy,
1910 Debug,
1911 PartialEq,
1912 Eq,
1913 Hash,
1914 PartialOrd,
1915 Ord,
1916 Serialize_repr,
1917 Deserialize_repr
1918)]
1919#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1920#[repr(u8)]
1921pub enum CatalogItemType {
1922 Unknown = 0,
1923 Table = 1,
1924 Source = 2,
1925 Sink = 3,
1926 View = 4,
1927 MaterializedView = 5,
1928 Index = 6,
1929 Type = 7,
1930 Func = 8,
1931 Secret = 9,
1932 Connection = 10,
1933 ContinualTask = 11,
1934}
1935
1936#[derive(
1937 Clone,
1938 Copy,
1939 Debug,
1940 PartialEq,
1941 Eq,
1942 Hash,
1943 PartialOrd,
1944 Ord,
1945 Serialize_repr,
1946 Deserialize_repr
1947)]
1948#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1949#[repr(u8)]
1950pub enum ObjectType {
1951 Unknown = 0,
1952 Table = 1,
1953 View = 2,
1954 MaterializedView = 3,
1955 Source = 4,
1956 Sink = 5,
1957 Index = 6,
1958 Type = 7,
1959 Role = 8,
1960 Cluster = 9,
1961 ClusterReplica = 10,
1962 Secret = 11,
1963 Connection = 12,
1964 Database = 13,
1965 Schema = 14,
1966 Func = 15,
1967 ContinualTask = 16,
1968 NetworkPolicy = 17,
1969}