Skip to main content

mz_catalog_protos/
objects_v78.rs

1// Copyright Materialize, Inc. and contributors. All rights reserved.
2//
3// Use of this software is governed by the Business Source License
4// included in the LICENSE file.
5//
6// As of the Change Date specified in that file, in accordance with
7// the Business Source License, use of this software will be governed
8// by the Apache License, Version 2.0.
9
10use num_enum::{IntoPrimitive, TryFromPrimitive};
11#[cfg(any(test, feature = "proptest"))]
12use proptest_derive::Arbitrary;
13use serde::{Deserialize, Serialize};
14
15#[derive(
16    Clone,
17    Debug,
18    Default,
19    PartialEq,
20    Eq,
21    PartialOrd,
22    Ord,
23    Serialize,
24    Deserialize
25)]
26#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
27pub struct ConfigKey {
28    pub key: String,
29}
30
31#[derive(
32    Clone,
33    Copy,
34    Debug,
35    Default,
36    PartialEq,
37    Eq,
38    PartialOrd,
39    Ord,
40    Serialize,
41    Deserialize
42)]
43#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
44pub struct ConfigValue {
45    pub value: u64,
46}
47
48#[derive(
49    Clone,
50    Debug,
51    Default,
52    PartialEq,
53    Eq,
54    PartialOrd,
55    Ord,
56    Serialize,
57    Deserialize
58)]
59#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
60pub struct SettingKey {
61    pub name: String,
62}
63
64#[derive(
65    Clone,
66    Debug,
67    Default,
68    PartialEq,
69    Eq,
70    PartialOrd,
71    Ord,
72    Serialize,
73    Deserialize
74)]
75#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
76pub struct SettingValue {
77    pub value: String,
78}
79
80#[derive(
81    Clone,
82    Debug,
83    Default,
84    PartialEq,
85    Eq,
86    PartialOrd,
87    Ord,
88    Serialize,
89    Deserialize
90)]
91#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
92pub struct IdAllocKey {
93    pub name: String,
94}
95
96#[derive(
97    Clone,
98    Copy,
99    Debug,
100    Default,
101    PartialEq,
102    Eq,
103    PartialOrd,
104    Ord,
105    Serialize,
106    Deserialize
107)]
108#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
109pub struct IdAllocValue {
110    pub next_id: u64,
111}
112
113#[derive(
114    Clone,
115    Debug,
116    Default,
117    PartialEq,
118    Eq,
119    PartialOrd,
120    Ord,
121    Serialize,
122    Deserialize
123)]
124#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
125pub struct GidMappingKey {
126    pub schema_name: String,
127    pub object_type: i32,
128    pub object_name: String,
129}
130
131#[derive(
132    Clone,
133    Debug,
134    Default,
135    PartialEq,
136    Eq,
137    PartialOrd,
138    Ord,
139    Serialize,
140    Deserialize
141)]
142#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
143pub struct GidMappingValue {
144    pub id: u64,
145    pub fingerprint: String,
146    pub global_id: Option<SystemGlobalId>,
147}
148
149#[derive(
150    Clone,
151    Copy,
152    Debug,
153    Default,
154    PartialEq,
155    Eq,
156    PartialOrd,
157    Ord,
158    Serialize,
159    Deserialize
160)]
161#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
162pub struct ClusterKey {
163    pub id: Option<ClusterId>,
164}
165
166#[derive(
167    Clone,
168    Debug,
169    Default,
170    PartialEq,
171    Eq,
172    PartialOrd,
173    Ord,
174    Serialize,
175    Deserialize
176)]
177#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
178pub struct ClusterValue {
179    pub name: String,
180    pub owner_id: Option<RoleId>,
181    pub privileges: Vec<MzAclItem>,
182    pub config: Option<ClusterConfig>,
183}
184
185#[derive(
186    Clone,
187    Debug,
188    Default,
189    PartialEq,
190    Eq,
191    PartialOrd,
192    Ord,
193    Serialize,
194    Deserialize
195)]
196#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
197pub struct ClusterIntrospectionSourceIndexKey {
198    pub cluster_id: Option<ClusterId>,
199    pub name: String,
200}
201
202#[derive(
203    Clone,
204    Copy,
205    Debug,
206    Default,
207    PartialEq,
208    Eq,
209    PartialOrd,
210    Ord,
211    Serialize,
212    Deserialize
213)]
214#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
215pub struct ClusterIntrospectionSourceIndexValue {
216    pub index_id: u64,
217    pub oid: u32,
218    pub global_id: Option<IntrospectionSourceIndexGlobalId>,
219}
220
221#[derive(
222    Clone,
223    Copy,
224    Debug,
225    Default,
226    PartialEq,
227    Eq,
228    PartialOrd,
229    Ord,
230    Serialize,
231    Deserialize
232)]
233#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
234pub struct ClusterReplicaKey {
235    pub id: Option<ReplicaId>,
236}
237
238#[derive(
239    Clone,
240    Debug,
241    Default,
242    PartialEq,
243    Eq,
244    PartialOrd,
245    Ord,
246    Serialize,
247    Deserialize
248)]
249#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
250pub struct ClusterReplicaValue {
251    pub cluster_id: Option<ClusterId>,
252    pub name: String,
253    pub config: Option<ReplicaConfig>,
254    pub owner_id: Option<RoleId>,
255}
256
257#[derive(
258    Clone,
259    Copy,
260    Debug,
261    Default,
262    PartialEq,
263    Eq,
264    PartialOrd,
265    Ord,
266    Serialize,
267    Deserialize
268)]
269#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
270pub struct DatabaseKey {
271    pub id: Option<DatabaseId>,
272}
273
274#[derive(
275    Clone,
276    Debug,
277    Default,
278    PartialEq,
279    Eq,
280    PartialOrd,
281    Ord,
282    Serialize,
283    Deserialize
284)]
285#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
286pub struct DatabaseValue {
287    pub name: String,
288    pub owner_id: Option<RoleId>,
289    pub privileges: Vec<MzAclItem>,
290    pub oid: u32,
291}
292
293#[derive(
294    Clone,
295    Copy,
296    Debug,
297    Default,
298    PartialEq,
299    Eq,
300    PartialOrd,
301    Ord,
302    Serialize,
303    Deserialize
304)]
305#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
306pub struct SchemaKey {
307    pub id: Option<SchemaId>,
308}
309
310#[derive(
311    Clone,
312    Debug,
313    Default,
314    PartialEq,
315    Eq,
316    PartialOrd,
317    Ord,
318    Serialize,
319    Deserialize
320)]
321#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
322pub struct SchemaValue {
323    pub database_id: Option<DatabaseId>,
324    pub name: String,
325    pub owner_id: Option<RoleId>,
326    pub privileges: Vec<MzAclItem>,
327    pub oid: u32,
328}
329
330#[derive(
331    Clone,
332    Copy,
333    Debug,
334    Default,
335    PartialEq,
336    Eq,
337    PartialOrd,
338    Ord,
339    Serialize,
340    Deserialize
341)]
342#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
343pub struct ItemKey {
344    pub gid: Option<CatalogItemId>,
345}
346
347#[derive(
348    Clone,
349    Debug,
350    Default,
351    PartialEq,
352    Eq,
353    PartialOrd,
354    Ord,
355    Serialize,
356    Deserialize
357)]
358#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
359pub struct ItemValue {
360    pub schema_id: Option<SchemaId>,
361    pub name: String,
362    pub definition: Option<CatalogItem>,
363    pub owner_id: Option<RoleId>,
364    pub privileges: Vec<MzAclItem>,
365    pub oid: u32,
366    pub global_id: Option<GlobalId>,
367    pub extra_versions: Vec<ItemVersion>,
368}
369
370#[derive(
371    Clone,
372    Copy,
373    Debug,
374    Default,
375    PartialEq,
376    Eq,
377    PartialOrd,
378    Ord,
379    Serialize,
380    Deserialize
381)]
382#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
383pub struct ItemVersion {
384    pub global_id: Option<GlobalId>,
385    pub version: Option<Version>,
386}
387
388#[derive(
389    Clone,
390    Copy,
391    Debug,
392    Default,
393    PartialEq,
394    Eq,
395    PartialOrd,
396    Ord,
397    Serialize,
398    Deserialize
399)]
400#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
401pub struct RoleKey {
402    pub id: Option<RoleId>,
403}
404
405#[derive(
406    Clone,
407    Debug,
408    Default,
409    PartialEq,
410    Eq,
411    PartialOrd,
412    Ord,
413    Serialize,
414    Deserialize
415)]
416#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
417pub struct RoleValue {
418    pub name: String,
419    pub attributes: Option<RoleAttributes>,
420    pub membership: Option<RoleMembership>,
421    pub vars: Option<RoleVars>,
422    pub oid: u32,
423}
424
425#[derive(
426    Clone,
427    Copy,
428    Debug,
429    Default,
430    PartialEq,
431    Eq,
432    PartialOrd,
433    Ord,
434    Serialize,
435    Deserialize
436)]
437#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
438pub struct RoleAuthKey {
439    pub id: Option<RoleId>,
440}
441
442#[derive(
443    Clone,
444    Debug,
445    Default,
446    PartialEq,
447    Eq,
448    PartialOrd,
449    Ord,
450    Serialize,
451    Deserialize
452)]
453#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
454pub struct RoleAuthValue {
455    pub password_hash: Option<String>,
456    #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
457    pub updated_at: Option<EpochMillis>,
458}
459
460#[derive(
461    Clone,
462    Copy,
463    Debug,
464    Default,
465    PartialEq,
466    Eq,
467    PartialOrd,
468    Ord,
469    Serialize,
470    Deserialize
471)]
472#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
473pub struct NetworkPolicyKey {
474    pub id: Option<NetworkPolicyId>,
475}
476
477#[derive(
478    Clone,
479    Debug,
480    Default,
481    PartialEq,
482    Eq,
483    PartialOrd,
484    Ord,
485    Serialize,
486    Deserialize
487)]
488#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
489pub struct NetworkPolicyValue {
490    pub name: String,
491    pub rules: Vec<NetworkPolicyRule>,
492    pub owner_id: Option<RoleId>,
493    pub privileges: Vec<MzAclItem>,
494    pub oid: u32,
495}
496
497#[derive(
498    Clone,
499    Debug,
500    Default,
501    PartialEq,
502    Eq,
503    PartialOrd,
504    Ord,
505    Serialize,
506    Deserialize
507)]
508#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
509pub struct ServerConfigurationKey {
510    pub name: String,
511}
512
513#[derive(
514    Clone,
515    Debug,
516    Default,
517    PartialEq,
518    Eq,
519    PartialOrd,
520    Ord,
521    Serialize,
522    Deserialize
523)]
524#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
525pub struct ServerConfigurationValue {
526    pub value: String,
527}
528
529#[derive(
530    Clone,
531    Debug,
532    Default,
533    PartialEq,
534    Eq,
535    PartialOrd,
536    Ord,
537    Serialize,
538    Deserialize
539)]
540#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
541pub struct AuditLogKey {
542    #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
543    pub event: Option<audit_log_key::Event>,
544}
545
546pub mod audit_log_key {
547    use super::*;
548
549    #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
550    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
551    pub enum Event {
552        V1(AuditLogEventV1),
553    }
554}
555
556#[derive(
557    Clone,
558    Copy,
559    Debug,
560    Default,
561    PartialEq,
562    Eq,
563    PartialOrd,
564    Ord,
565    Serialize,
566    Deserialize
567)]
568#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
569pub struct CommentKey {
570    pub object: Option<comment_key::Object>,
571    pub sub_component: Option<comment_key::SubComponent>,
572}
573
574pub mod comment_key {
575    use super::*;
576
577    #[derive(
578        Clone,
579        Copy,
580        Debug,
581        PartialEq,
582        Eq,
583        PartialOrd,
584        Ord,
585        Serialize,
586        Deserialize
587    )]
588    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
589    pub enum Object {
590        Table(CatalogItemId),
591        View(CatalogItemId),
592        MaterializedView(CatalogItemId),
593        Source(CatalogItemId),
594        Sink(CatalogItemId),
595        Index(CatalogItemId),
596        Func(CatalogItemId),
597        Connection(CatalogItemId),
598        Type(CatalogItemId),
599        Secret(CatalogItemId),
600        ContinualTask(CatalogItemId),
601        Role(RoleId),
602        Database(DatabaseId),
603        Schema(ResolvedSchema),
604        Cluster(ClusterId),
605        ClusterReplica(ClusterReplicaId),
606        NetworkPolicy(NetworkPolicyId),
607    }
608
609    #[derive(
610        Clone,
611        Copy,
612        Debug,
613        PartialEq,
614        Eq,
615        PartialOrd,
616        Ord,
617        Serialize,
618        Deserialize
619    )]
620    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
621    pub enum SubComponent {
622        ColumnPos(u64),
623    }
624}
625
626#[derive(
627    Clone,
628    Debug,
629    Default,
630    PartialEq,
631    Eq,
632    PartialOrd,
633    Ord,
634    Serialize,
635    Deserialize
636)]
637#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
638pub struct CommentValue {
639    pub comment: String,
640}
641
642#[derive(
643    Clone,
644    Copy,
645    Debug,
646    Default,
647    PartialEq,
648    Eq,
649    PartialOrd,
650    Ord,
651    Serialize,
652    Deserialize
653)]
654#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
655pub struct SourceReferencesKey {
656    pub source: Option<CatalogItemId>,
657}
658
659#[derive(
660    Clone,
661    Debug,
662    Default,
663    PartialEq,
664    Eq,
665    PartialOrd,
666    Ord,
667    Serialize,
668    Deserialize
669)]
670#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
671pub struct SourceReferencesValue {
672    pub references: Vec<SourceReference>,
673    #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
674    pub updated_at: Option<EpochMillis>,
675}
676
677#[derive(
678    Clone,
679    Debug,
680    Default,
681    PartialEq,
682    Eq,
683    PartialOrd,
684    Ord,
685    Serialize,
686    Deserialize
687)]
688#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
689pub struct SourceReference {
690    pub name: String,
691    pub namespace: Option<String>,
692    pub columns: Vec<String>,
693}
694
695#[derive(
696    Clone,
697    Copy,
698    Debug,
699    Default,
700    PartialEq,
701    Eq,
702    PartialOrd,
703    Ord,
704    Serialize,
705    Deserialize
706)]
707#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
708pub struct StorageCollectionMetadataKey {
709    pub id: Option<GlobalId>,
710}
711
712#[derive(
713    Clone,
714    Debug,
715    Default,
716    PartialEq,
717    Eq,
718    PartialOrd,
719    Ord,
720    Serialize,
721    Deserialize
722)]
723#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
724pub struct StorageCollectionMetadataValue {
725    pub shard: String,
726}
727
728#[derive(
729    Clone,
730    Debug,
731    Default,
732    PartialEq,
733    Eq,
734    PartialOrd,
735    Ord,
736    Serialize,
737    Deserialize
738)]
739#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
740pub struct UnfinalizedShardKey {
741    pub shard: String,
742}
743
744#[derive(
745    Clone,
746    Debug,
747    Default,
748    PartialEq,
749    Eq,
750    PartialOrd,
751    Ord,
752    Serialize,
753    Deserialize
754)]
755#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
756pub struct TxnWalShardValue {
757    pub shard: String,
758}
759
760#[derive(
761    Clone,
762    Copy,
763    Debug,
764    Default,
765    PartialEq,
766    Eq,
767    PartialOrd,
768    Ord,
769    Serialize,
770    Deserialize
771)]
772#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
773pub struct Empty {}
774
775#[derive(
776    Clone,
777    Debug,
778    Default,
779    PartialEq,
780    Eq,
781    PartialOrd,
782    Ord,
783    Serialize,
784    Deserialize
785)]
786#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
787pub struct StringWrapper {
788    pub inner: String,
789}
790
791#[derive(
792    Clone,
793    Copy,
794    Debug,
795    Default,
796    PartialEq,
797    Eq,
798    PartialOrd,
799    Ord,
800    Serialize,
801    Deserialize
802)]
803#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
804pub struct Duration {
805    pub secs: u64,
806    pub nanos: u32,
807}
808
809#[derive(
810    Clone,
811    Copy,
812    Debug,
813    Default,
814    PartialEq,
815    Eq,
816    PartialOrd,
817    Ord,
818    Serialize,
819    Deserialize
820)]
821#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
822pub struct EpochMillis {
823    pub millis: u64,
824}
825
826#[derive(
827    Clone,
828    Copy,
829    Debug,
830    Default,
831    PartialEq,
832    Eq,
833    PartialOrd,
834    Ord,
835    Serialize,
836    Deserialize
837)]
838#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
839pub struct Timestamp {
840    pub internal: u64,
841}
842
843#[derive(
844    Clone,
845    Copy,
846    Debug,
847    Default,
848    PartialEq,
849    Eq,
850    PartialOrd,
851    Ord,
852    Serialize,
853    Deserialize
854)]
855#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
856pub struct Version {
857    pub value: u64,
858}
859
860#[derive(
861    Clone,
862    Debug,
863    Default,
864    PartialEq,
865    Eq,
866    PartialOrd,
867    Ord,
868    Serialize,
869    Deserialize
870)]
871#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
872pub struct CatalogItem {
873    pub value: Option<catalog_item::Value>,
874}
875
876pub mod catalog_item {
877    use super::*;
878
879    #[derive(
880        Clone,
881        Debug,
882        Default,
883        PartialEq,
884        Eq,
885        PartialOrd,
886        Ord,
887        Serialize,
888        Deserialize
889    )]
890    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
891    pub struct V1 {
892        pub create_sql: String,
893    }
894
895    #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
896    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
897    pub enum Value {
898        V1(V1),
899    }
900}
901
902#[derive(
903    Clone,
904    Copy,
905    Debug,
906    Default,
907    PartialEq,
908    Eq,
909    PartialOrd,
910    Ord,
911    Serialize,
912    Deserialize
913)]
914#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
915pub struct CatalogItemId {
916    pub value: Option<catalog_item_id::Value>,
917}
918
919pub mod catalog_item_id {
920    use super::*;
921
922    #[derive(
923        Clone,
924        Copy,
925        Debug,
926        PartialEq,
927        Eq,
928        PartialOrd,
929        Ord,
930        Serialize,
931        Deserialize
932    )]
933    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
934    pub enum Value {
935        System(u64),
936        User(u64),
937        Transient(u64),
938        IntrospectionSourceIndex(u64),
939    }
940}
941
942#[derive(
943    Clone,
944    Copy,
945    Debug,
946    Default,
947    PartialEq,
948    Eq,
949    PartialOrd,
950    Ord,
951    Serialize,
952    Deserialize
953)]
954#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
955pub struct SystemCatalogItemId {
956    pub value: u64,
957}
958
959#[derive(
960    Clone,
961    Copy,
962    Debug,
963    Default,
964    PartialEq,
965    Eq,
966    PartialOrd,
967    Ord,
968    Serialize,
969    Deserialize
970)]
971#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
972pub struct IntrospectionSourceIndexCatalogItemId {
973    pub value: u64,
974}
975
976#[derive(
977    Clone,
978    Copy,
979    Debug,
980    Default,
981    PartialEq,
982    Eq,
983    PartialOrd,
984    Ord,
985    Serialize,
986    Deserialize
987)]
988#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
989pub struct GlobalId {
990    pub value: Option<global_id::Value>,
991}
992
993pub mod global_id {
994    use super::*;
995
996    #[derive(
997        Clone,
998        Copy,
999        Debug,
1000        PartialEq,
1001        Eq,
1002        PartialOrd,
1003        Ord,
1004        Serialize,
1005        Deserialize
1006    )]
1007    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1008    pub enum Value {
1009        System(u64),
1010        User(u64),
1011        Transient(u64),
1012        Explain(Empty),
1013        IntrospectionSourceIndex(u64),
1014    }
1015}
1016
1017#[derive(
1018    Clone,
1019    Copy,
1020    Debug,
1021    Default,
1022    PartialEq,
1023    Eq,
1024    PartialOrd,
1025    Ord,
1026    Serialize,
1027    Deserialize
1028)]
1029#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1030pub struct SystemGlobalId {
1031    pub value: u64,
1032}
1033
1034#[derive(
1035    Clone,
1036    Copy,
1037    Debug,
1038    Default,
1039    PartialEq,
1040    Eq,
1041    PartialOrd,
1042    Ord,
1043    Serialize,
1044    Deserialize
1045)]
1046#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1047pub struct IntrospectionSourceIndexGlobalId {
1048    pub value: u64,
1049}
1050
1051#[derive(
1052    Clone,
1053    Copy,
1054    Debug,
1055    Default,
1056    PartialEq,
1057    Eq,
1058    PartialOrd,
1059    Ord,
1060    Serialize,
1061    Deserialize
1062)]
1063#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1064pub struct ClusterId {
1065    pub value: Option<cluster_id::Value>,
1066}
1067
1068pub mod cluster_id {
1069    use super::*;
1070
1071    #[derive(
1072        Clone,
1073        Copy,
1074        Debug,
1075        PartialEq,
1076        Eq,
1077        PartialOrd,
1078        Ord,
1079        Serialize,
1080        Deserialize
1081    )]
1082    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1083    pub enum Value {
1084        System(u64),
1085        User(u64),
1086    }
1087}
1088
1089#[derive(
1090    Clone,
1091    Copy,
1092    Debug,
1093    Default,
1094    PartialEq,
1095    Eq,
1096    PartialOrd,
1097    Ord,
1098    Serialize,
1099    Deserialize
1100)]
1101#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1102pub struct DatabaseId {
1103    pub value: Option<database_id::Value>,
1104}
1105
1106pub mod database_id {
1107    use super::*;
1108
1109    #[derive(
1110        Clone,
1111        Copy,
1112        Debug,
1113        PartialEq,
1114        Eq,
1115        PartialOrd,
1116        Ord,
1117        Serialize,
1118        Deserialize
1119    )]
1120    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1121    pub enum Value {
1122        System(u64),
1123        User(u64),
1124    }
1125}
1126
1127#[derive(
1128    Clone,
1129    Copy,
1130    Debug,
1131    Default,
1132    PartialEq,
1133    Eq,
1134    PartialOrd,
1135    Ord,
1136    Serialize,
1137    Deserialize
1138)]
1139#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1140pub struct ResolvedDatabaseSpecifier {
1141    pub spec: Option<resolved_database_specifier::Spec>,
1142}
1143
1144pub mod resolved_database_specifier {
1145    use super::*;
1146
1147    #[derive(
1148        Clone,
1149        Copy,
1150        Debug,
1151        PartialEq,
1152        Eq,
1153        PartialOrd,
1154        Ord,
1155        Serialize,
1156        Deserialize
1157    )]
1158    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1159    pub enum Spec {
1160        Ambient(Empty),
1161        Id(DatabaseId),
1162    }
1163}
1164
1165#[derive(
1166    Clone,
1167    Copy,
1168    Debug,
1169    Default,
1170    PartialEq,
1171    Eq,
1172    PartialOrd,
1173    Ord,
1174    Serialize,
1175    Deserialize
1176)]
1177#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1178pub struct SchemaId {
1179    pub value: Option<schema_id::Value>,
1180}
1181
1182pub mod schema_id {
1183    use super::*;
1184
1185    #[derive(
1186        Clone,
1187        Copy,
1188        Debug,
1189        PartialEq,
1190        Eq,
1191        PartialOrd,
1192        Ord,
1193        Serialize,
1194        Deserialize
1195    )]
1196    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1197    pub enum Value {
1198        System(u64),
1199        User(u64),
1200    }
1201}
1202
1203#[derive(
1204    Clone,
1205    Copy,
1206    Debug,
1207    Default,
1208    PartialEq,
1209    Eq,
1210    PartialOrd,
1211    Ord,
1212    Serialize,
1213    Deserialize
1214)]
1215#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1216pub struct SchemaSpecifier {
1217    pub spec: Option<schema_specifier::Spec>,
1218}
1219
1220pub mod schema_specifier {
1221    use super::*;
1222
1223    #[derive(
1224        Clone,
1225        Copy,
1226        Debug,
1227        PartialEq,
1228        Eq,
1229        PartialOrd,
1230        Ord,
1231        Serialize,
1232        Deserialize
1233    )]
1234    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1235    pub enum Spec {
1236        Temporary(Empty),
1237        Id(SchemaId),
1238    }
1239}
1240
1241#[derive(
1242    Clone,
1243    Copy,
1244    Debug,
1245    Default,
1246    PartialEq,
1247    Eq,
1248    PartialOrd,
1249    Ord,
1250    Serialize,
1251    Deserialize
1252)]
1253#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1254pub struct ResolvedSchema {
1255    pub database: Option<ResolvedDatabaseSpecifier>,
1256    pub schema: Option<SchemaSpecifier>,
1257}
1258
1259#[derive(
1260    Clone,
1261    Copy,
1262    Debug,
1263    Default,
1264    PartialEq,
1265    Eq,
1266    PartialOrd,
1267    Ord,
1268    Serialize,
1269    Deserialize
1270)]
1271#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1272pub struct ReplicaId {
1273    pub value: Option<replica_id::Value>,
1274}
1275
1276pub mod replica_id {
1277    use super::*;
1278
1279    #[derive(
1280        Clone,
1281        Copy,
1282        Debug,
1283        PartialEq,
1284        Eq,
1285        PartialOrd,
1286        Ord,
1287        Serialize,
1288        Deserialize
1289    )]
1290    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1291    pub enum Value {
1292        System(u64),
1293        User(u64),
1294    }
1295}
1296
1297#[derive(
1298    Clone,
1299    Copy,
1300    Debug,
1301    Default,
1302    PartialEq,
1303    Eq,
1304    PartialOrd,
1305    Ord,
1306    Serialize,
1307    Deserialize
1308)]
1309#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1310pub struct ClusterReplicaId {
1311    pub cluster_id: Option<ClusterId>,
1312    pub replica_id: Option<ReplicaId>,
1313}
1314
1315#[derive(
1316    Clone,
1317    Copy,
1318    Debug,
1319    Default,
1320    PartialEq,
1321    Eq,
1322    PartialOrd,
1323    Ord,
1324    Serialize,
1325    Deserialize
1326)]
1327#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1328pub struct NetworkPolicyId {
1329    pub value: Option<network_policy_id::Value>,
1330}
1331
1332pub mod network_policy_id {
1333    use super::*;
1334
1335    #[derive(
1336        Clone,
1337        Copy,
1338        Debug,
1339        PartialEq,
1340        Eq,
1341        PartialOrd,
1342        Ord,
1343        Serialize,
1344        Deserialize
1345    )]
1346    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1347    pub enum Value {
1348        System(u64),
1349        User(u64),
1350    }
1351}
1352
1353#[derive(
1354    Clone,
1355    Copy,
1356    Debug,
1357    Default,
1358    PartialEq,
1359    Eq,
1360    PartialOrd,
1361    Ord,
1362    Serialize,
1363    Deserialize
1364)]
1365#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1366pub struct ReplicaLogging {
1367    pub log_logging: bool,
1368    pub interval: Option<Duration>,
1369}
1370
1371#[derive(
1372    Clone,
1373    Debug,
1374    Default,
1375    PartialEq,
1376    Eq,
1377    PartialOrd,
1378    Ord,
1379    Serialize,
1380    Deserialize
1381)]
1382#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1383pub struct OptimizerFeatureOverride {
1384    pub name: String,
1385    pub value: String,
1386}
1387
1388#[derive(
1389    Clone,
1390    Copy,
1391    Debug,
1392    Default,
1393    PartialEq,
1394    Eq,
1395    PartialOrd,
1396    Ord,
1397    Serialize,
1398    Deserialize
1399)]
1400#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1401pub struct ClusterScheduleRefreshOptions {
1402    #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
1403    pub rehydration_time_estimate: Option<Duration>,
1404}
1405
1406#[derive(
1407    Clone,
1408    Copy,
1409    Debug,
1410    Default,
1411    PartialEq,
1412    Eq,
1413    PartialOrd,
1414    Ord,
1415    Serialize,
1416    Deserialize
1417)]
1418#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1419pub struct ClusterSchedule {
1420    pub value: Option<cluster_schedule::Value>,
1421}
1422
1423pub mod cluster_schedule {
1424    use super::*;
1425
1426    #[derive(
1427        Clone,
1428        Copy,
1429        Debug,
1430        PartialEq,
1431        Eq,
1432        PartialOrd,
1433        Ord,
1434        Serialize,
1435        Deserialize
1436    )]
1437    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1438    pub enum Value {
1439        Manual(Empty),
1440        Refresh(ClusterScheduleRefreshOptions),
1441    }
1442}
1443
1444#[derive(
1445    Clone,
1446    Debug,
1447    Default,
1448    PartialEq,
1449    Eq,
1450    PartialOrd,
1451    Ord,
1452    Serialize,
1453    Deserialize
1454)]
1455#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1456pub struct ClusterConfig {
1457    pub workload_class: Option<String>,
1458    pub variant: Option<cluster_config::Variant>,
1459}
1460
1461pub mod cluster_config {
1462    use super::*;
1463
1464    #[derive(
1465        Clone,
1466        Debug,
1467        Default,
1468        PartialEq,
1469        Eq,
1470        PartialOrd,
1471        Ord,
1472        Serialize,
1473        Deserialize
1474    )]
1475    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1476    pub struct ManagedCluster {
1477        pub size: String,
1478        pub replication_factor: u32,
1479        pub availability_zones: Vec<String>,
1480        pub logging: Option<ReplicaLogging>,
1481        pub optimizer_feature_overrides: Vec<OptimizerFeatureOverride>,
1482        pub schedule: Option<ClusterSchedule>,
1483    }
1484
1485    #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1486    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1487    pub enum Variant {
1488        Unmanaged(Empty),
1489        Managed(ManagedCluster),
1490    }
1491}
1492
1493#[derive(
1494    Clone,
1495    Debug,
1496    Default,
1497    PartialEq,
1498    Eq,
1499    PartialOrd,
1500    Ord,
1501    Serialize,
1502    Deserialize
1503)]
1504#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1505pub struct ReplicaConfig {
1506    #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
1507    pub logging: Option<ReplicaLogging>,
1508    #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
1509    pub location: Option<replica_config::Location>,
1510}
1511
1512pub mod replica_config {
1513    use super::*;
1514
1515    #[derive(
1516        Clone,
1517        Debug,
1518        Default,
1519        PartialEq,
1520        Eq,
1521        PartialOrd,
1522        Ord,
1523        Serialize,
1524        Deserialize
1525    )]
1526    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1527    pub struct UnmanagedLocation {
1528        pub storagectl_addrs: Vec<String>,
1529        pub computectl_addrs: Vec<String>,
1530    }
1531
1532    #[derive(
1533        Clone,
1534        Debug,
1535        Default,
1536        PartialEq,
1537        Eq,
1538        PartialOrd,
1539        Ord,
1540        Serialize,
1541        Deserialize
1542    )]
1543    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1544    pub struct ManagedLocation {
1545        pub size: String,
1546        pub availability_zone: Option<String>,
1547        pub internal: bool,
1548        pub billed_as: Option<String>,
1549        pub pending: bool,
1550    }
1551
1552    #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1553    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1554    pub enum Location {
1555        Unmanaged(UnmanagedLocation),
1556        Managed(ManagedLocation),
1557    }
1558}
1559
1560#[derive(
1561    Clone,
1562    Copy,
1563    Debug,
1564    Default,
1565    PartialEq,
1566    Eq,
1567    PartialOrd,
1568    Ord,
1569    Serialize,
1570    Deserialize
1571)]
1572#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1573pub struct RoleId {
1574    pub value: Option<role_id::Value>,
1575}
1576
1577pub mod role_id {
1578    use super::*;
1579
1580    #[derive(
1581        Clone,
1582        Copy,
1583        Debug,
1584        PartialEq,
1585        Eq,
1586        PartialOrd,
1587        Ord,
1588        Serialize,
1589        Deserialize
1590    )]
1591    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1592    pub enum Value {
1593        System(u64),
1594        User(u64),
1595        Public(Empty),
1596        Predefined(u64),
1597    }
1598}
1599
1600#[derive(
1601    Clone,
1602    Copy,
1603    Debug,
1604    Default,
1605    PartialEq,
1606    Eq,
1607    PartialOrd,
1608    Ord,
1609    Serialize,
1610    Deserialize
1611)]
1612#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1613pub struct RoleAttributes {
1614    pub inherit: bool,
1615    pub superuser: Option<bool>,
1616    pub login: Option<bool>,
1617}
1618
1619#[derive(
1620    Clone,
1621    Debug,
1622    Default,
1623    PartialEq,
1624    Eq,
1625    PartialOrd,
1626    Ord,
1627    Serialize,
1628    Deserialize
1629)]
1630#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1631pub struct RoleMembership {
1632    pub map: Vec<role_membership::Entry>,
1633}
1634
1635pub mod role_membership {
1636    use super::*;
1637
1638    #[derive(
1639        Clone,
1640        Copy,
1641        Debug,
1642        Default,
1643        PartialEq,
1644        Eq,
1645        PartialOrd,
1646        Ord,
1647        Serialize,
1648        Deserialize
1649    )]
1650    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1651    pub struct Entry {
1652        pub key: Option<RoleId>,
1653        pub value: Option<RoleId>,
1654    }
1655}
1656
1657#[derive(
1658    Clone,
1659    Debug,
1660    Default,
1661    PartialEq,
1662    Eq,
1663    PartialOrd,
1664    Ord,
1665    Serialize,
1666    Deserialize
1667)]
1668#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1669pub struct RoleVars {
1670    pub entries: Vec<role_vars::Entry>,
1671}
1672
1673pub mod role_vars {
1674    use super::*;
1675
1676    #[derive(
1677        Clone,
1678        Debug,
1679        Default,
1680        PartialEq,
1681        Eq,
1682        PartialOrd,
1683        Ord,
1684        Serialize,
1685        Deserialize
1686    )]
1687    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1688    pub struct SqlSet {
1689        pub entries: Vec<String>,
1690    }
1691
1692    #[derive(
1693        Clone,
1694        Debug,
1695        Default,
1696        PartialEq,
1697        Eq,
1698        PartialOrd,
1699        Ord,
1700        Serialize,
1701        Deserialize
1702    )]
1703    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1704    pub struct Entry {
1705        pub key: String,
1706        pub val: Option<entry::Val>,
1707    }
1708
1709    pub mod entry {
1710        use super::*;
1711
1712        #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
1713        #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1714        pub enum Val {
1715            Flat(String),
1716            SqlSet(SqlSet),
1717        }
1718    }
1719}
1720
1721#[derive(
1722    Clone,
1723    Debug,
1724    Default,
1725    PartialEq,
1726    Eq,
1727    PartialOrd,
1728    Ord,
1729    Serialize,
1730    Deserialize
1731)]
1732#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1733pub struct NetworkPolicyRule {
1734    pub name: String,
1735    pub address: String,
1736    pub action: Option<network_policy_rule::Action>,
1737    pub direction: Option<network_policy_rule::Direction>,
1738}
1739
1740pub mod network_policy_rule {
1741    use super::*;
1742
1743    #[derive(
1744        Clone,
1745        Copy,
1746        Debug,
1747        PartialEq,
1748        Eq,
1749        PartialOrd,
1750        Ord,
1751        Serialize,
1752        Deserialize
1753    )]
1754    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1755    pub enum Action {
1756        Allow(Empty),
1757    }
1758
1759    #[derive(
1760        Clone,
1761        Copy,
1762        Debug,
1763        PartialEq,
1764        Eq,
1765        PartialOrd,
1766        Ord,
1767        Serialize,
1768        Deserialize
1769    )]
1770    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1771    pub enum Direction {
1772        Ingress(Empty),
1773    }
1774}
1775
1776#[derive(
1777    Clone,
1778    Copy,
1779    Debug,
1780    Default,
1781    PartialEq,
1782    Eq,
1783    PartialOrd,
1784    Ord,
1785    Serialize,
1786    Deserialize
1787)]
1788#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1789pub struct AclMode {
1790    pub bitflags: u64,
1791}
1792
1793#[derive(
1794    Clone,
1795    Copy,
1796    Debug,
1797    Default,
1798    PartialEq,
1799    Eq,
1800    PartialOrd,
1801    Ord,
1802    Serialize,
1803    Deserialize
1804)]
1805#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1806pub struct MzAclItem {
1807    pub grantee: Option<RoleId>,
1808    pub grantor: Option<RoleId>,
1809    pub acl_mode: Option<AclMode>,
1810}
1811
1812#[derive(
1813    Clone,
1814    Copy,
1815    Debug,
1816    Default,
1817    PartialEq,
1818    Eq,
1819    PartialOrd,
1820    Ord,
1821    Serialize,
1822    Deserialize
1823)]
1824#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1825pub struct DefaultPrivilegesKey {
1826    pub role_id: Option<RoleId>,
1827    pub database_id: Option<DatabaseId>,
1828    pub schema_id: Option<SchemaId>,
1829    pub object_type: i32,
1830    pub grantee: Option<RoleId>,
1831}
1832
1833#[derive(
1834    Clone,
1835    Copy,
1836    Debug,
1837    Default,
1838    PartialEq,
1839    Eq,
1840    PartialOrd,
1841    Ord,
1842    Serialize,
1843    Deserialize
1844)]
1845#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1846pub struct DefaultPrivilegesValue {
1847    #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
1848    pub privileges: Option<AclMode>,
1849}
1850
1851#[derive(
1852    Clone,
1853    Copy,
1854    Debug,
1855    Default,
1856    PartialEq,
1857    Eq,
1858    PartialOrd,
1859    Ord,
1860    Serialize,
1861    Deserialize
1862)]
1863#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1864pub struct SystemPrivilegesKey {
1865    pub grantee: Option<RoleId>,
1866    pub grantor: Option<RoleId>,
1867}
1868
1869#[derive(
1870    Clone,
1871    Copy,
1872    Debug,
1873    Default,
1874    PartialEq,
1875    Eq,
1876    PartialOrd,
1877    Ord,
1878    Serialize,
1879    Deserialize
1880)]
1881#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1882pub struct SystemPrivilegesValue {
1883    #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
1884    pub acl_mode: Option<AclMode>,
1885}
1886
1887#[derive(
1888    Clone,
1889    Debug,
1890    Default,
1891    PartialEq,
1892    Eq,
1893    PartialOrd,
1894    Ord,
1895    Serialize,
1896    Deserialize
1897)]
1898#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1899pub struct AuditLogEventV1 {
1900    pub id: u64,
1901    #[cfg_attr(any(test, feature = "proptest"), proptest(strategy = "0..=6"))]
1902    pub event_type: i32,
1903    #[cfg_attr(any(test, feature = "proptest"), proptest(strategy = "0..=18"))]
1904    pub object_type: i32,
1905    pub user: Option<StringWrapper>,
1906    #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
1907    pub occurred_at: Option<EpochMillis>,
1908    #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
1909    pub details: Option<audit_log_event_v1::Details>,
1910}
1911
1912pub mod audit_log_event_v1 {
1913    use super::*;
1914
1915    #[derive(
1916        Clone,
1917        Debug,
1918        Default,
1919        PartialEq,
1920        Eq,
1921        PartialOrd,
1922        Ord,
1923        Serialize,
1924        Deserialize
1925    )]
1926    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1927    pub struct IdFullNameV1 {
1928        pub id: String,
1929        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
1930        pub name: Option<FullNameV1>,
1931    }
1932
1933    #[derive(
1934        Clone,
1935        Debug,
1936        Default,
1937        PartialEq,
1938        Eq,
1939        PartialOrd,
1940        Ord,
1941        Serialize,
1942        Deserialize
1943    )]
1944    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1945    pub struct FullNameV1 {
1946        pub database: String,
1947        pub schema: String,
1948        pub item: String,
1949    }
1950
1951    #[derive(
1952        Clone,
1953        Debug,
1954        Default,
1955        PartialEq,
1956        Eq,
1957        PartialOrd,
1958        Ord,
1959        Serialize,
1960        Deserialize
1961    )]
1962    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1963    pub struct IdNameV1 {
1964        pub id: String,
1965        pub name: String,
1966    }
1967
1968    #[derive(
1969        Clone,
1970        Debug,
1971        Default,
1972        PartialEq,
1973        Eq,
1974        PartialOrd,
1975        Ord,
1976        Serialize,
1977        Deserialize
1978    )]
1979    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1980    pub struct RenameClusterV1 {
1981        pub id: String,
1982        pub old_name: String,
1983        pub new_name: String,
1984    }
1985
1986    #[derive(
1987        Clone,
1988        Debug,
1989        Default,
1990        PartialEq,
1991        Eq,
1992        PartialOrd,
1993        Ord,
1994        Serialize,
1995        Deserialize
1996    )]
1997    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
1998    pub struct RenameClusterReplicaV1 {
1999        pub cluster_id: String,
2000        pub replica_id: String,
2001        pub old_name: String,
2002        pub new_name: String,
2003    }
2004
2005    #[derive(
2006        Clone,
2007        Debug,
2008        Default,
2009        PartialEq,
2010        Eq,
2011        PartialOrd,
2012        Ord,
2013        Serialize,
2014        Deserialize
2015    )]
2016    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2017    pub struct RenameItemV1 {
2018        pub id: String,
2019        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2020        pub old_name: Option<FullNameV1>,
2021        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2022        pub new_name: Option<FullNameV1>,
2023    }
2024
2025    #[derive(
2026        Clone,
2027        Debug,
2028        Default,
2029        PartialEq,
2030        Eq,
2031        PartialOrd,
2032        Ord,
2033        Serialize,
2034        Deserialize
2035    )]
2036    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2037    pub struct CreateClusterReplicaV1 {
2038        pub cluster_id: String,
2039        pub cluster_name: String,
2040        pub replica_id: Option<StringWrapper>,
2041        pub replica_name: String,
2042        pub logical_size: String,
2043        pub disk: bool,
2044        pub billed_as: Option<String>,
2045        pub internal: bool,
2046    }
2047
2048    #[derive(
2049        Clone,
2050        Debug,
2051        Default,
2052        PartialEq,
2053        Eq,
2054        PartialOrd,
2055        Ord,
2056        Serialize,
2057        Deserialize
2058    )]
2059    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2060    pub struct CreateClusterReplicaV2 {
2061        pub cluster_id: String,
2062        pub cluster_name: String,
2063        pub replica_id: Option<StringWrapper>,
2064        pub replica_name: String,
2065        pub logical_size: String,
2066        pub disk: bool,
2067        pub billed_as: Option<String>,
2068        pub internal: bool,
2069        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2070        pub reason: Option<CreateOrDropClusterReplicaReasonV1>,
2071        pub scheduling_policies: Option<SchedulingDecisionsWithReasonsV1>,
2072    }
2073
2074    #[derive(
2075        Clone,
2076        Debug,
2077        Default,
2078        PartialEq,
2079        Eq,
2080        PartialOrd,
2081        Ord,
2082        Serialize,
2083        Deserialize
2084    )]
2085    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2086    pub struct CreateClusterReplicaV3 {
2087        pub cluster_id: String,
2088        pub cluster_name: String,
2089        pub replica_id: Option<StringWrapper>,
2090        pub replica_name: String,
2091        pub logical_size: String,
2092        pub disk: bool,
2093        pub billed_as: Option<String>,
2094        pub internal: bool,
2095        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2096        pub reason: Option<CreateOrDropClusterReplicaReasonV1>,
2097        pub scheduling_policies: Option<SchedulingDecisionsWithReasonsV2>,
2098    }
2099
2100    #[derive(
2101        Clone,
2102        Debug,
2103        Default,
2104        PartialEq,
2105        Eq,
2106        PartialOrd,
2107        Ord,
2108        Serialize,
2109        Deserialize
2110    )]
2111    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2112    pub struct CreateClusterReplicaV4 {
2113        pub cluster_id: String,
2114        pub cluster_name: String,
2115        pub replica_id: Option<StringWrapper>,
2116        pub replica_name: String,
2117        pub logical_size: String,
2118        pub billed_as: Option<String>,
2119        pub internal: bool,
2120        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2121        pub reason: Option<CreateOrDropClusterReplicaReasonV1>,
2122        pub scheduling_policies: Option<SchedulingDecisionsWithReasonsV2>,
2123    }
2124
2125    #[derive(
2126        Clone,
2127        Debug,
2128        Default,
2129        PartialEq,
2130        Eq,
2131        PartialOrd,
2132        Ord,
2133        Serialize,
2134        Deserialize
2135    )]
2136    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2137    pub struct DropClusterReplicaV1 {
2138        pub cluster_id: String,
2139        pub cluster_name: String,
2140        pub replica_id: Option<StringWrapper>,
2141        pub replica_name: String,
2142    }
2143
2144    #[derive(
2145        Clone,
2146        Debug,
2147        Default,
2148        PartialEq,
2149        Eq,
2150        PartialOrd,
2151        Ord,
2152        Serialize,
2153        Deserialize
2154    )]
2155    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2156    pub struct DropClusterReplicaV2 {
2157        pub cluster_id: String,
2158        pub cluster_name: String,
2159        pub replica_id: Option<StringWrapper>,
2160        pub replica_name: String,
2161        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2162        pub reason: Option<CreateOrDropClusterReplicaReasonV1>,
2163        pub scheduling_policies: Option<SchedulingDecisionsWithReasonsV1>,
2164    }
2165
2166    #[derive(
2167        Clone,
2168        Debug,
2169        Default,
2170        PartialEq,
2171        Eq,
2172        PartialOrd,
2173        Ord,
2174        Serialize,
2175        Deserialize
2176    )]
2177    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2178    pub struct DropClusterReplicaV3 {
2179        pub cluster_id: String,
2180        pub cluster_name: String,
2181        pub replica_id: Option<StringWrapper>,
2182        pub replica_name: String,
2183        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2184        pub reason: Option<CreateOrDropClusterReplicaReasonV1>,
2185        pub scheduling_policies: Option<SchedulingDecisionsWithReasonsV2>,
2186    }
2187
2188    #[derive(
2189        Clone,
2190        Copy,
2191        Debug,
2192        Default,
2193        PartialEq,
2194        Eq,
2195        PartialOrd,
2196        Ord,
2197        Serialize,
2198        Deserialize
2199    )]
2200    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2201    pub struct CreateOrDropClusterReplicaReasonV1 {
2202        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2203        pub reason: Option<create_or_drop_cluster_replica_reason_v1::Reason>,
2204    }
2205
2206    pub mod create_or_drop_cluster_replica_reason_v1 {
2207        use super::*;
2208
2209        #[derive(
2210            Clone,
2211            Copy,
2212            Debug,
2213            PartialEq,
2214            Eq,
2215            PartialOrd,
2216            Ord,
2217            Serialize,
2218            Deserialize
2219        )]
2220        #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2221        pub enum Reason {
2222            Manual(Empty),
2223            Schedule(Empty),
2224            System(Empty),
2225        }
2226    }
2227
2228    #[derive(
2229        Clone,
2230        Debug,
2231        Default,
2232        PartialEq,
2233        Eq,
2234        PartialOrd,
2235        Ord,
2236        Serialize,
2237        Deserialize
2238    )]
2239    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2240    pub struct SchedulingDecisionsWithReasonsV1 {
2241        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2242        pub on_refresh: Option<RefreshDecisionWithReasonV1>,
2243    }
2244
2245    #[derive(
2246        Clone,
2247        Debug,
2248        Default,
2249        PartialEq,
2250        Eq,
2251        PartialOrd,
2252        Ord,
2253        Serialize,
2254        Deserialize
2255    )]
2256    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2257    pub struct SchedulingDecisionsWithReasonsV2 {
2258        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2259        pub on_refresh: Option<RefreshDecisionWithReasonV2>,
2260    }
2261
2262    #[derive(
2263        Clone,
2264        Debug,
2265        Default,
2266        PartialEq,
2267        Eq,
2268        PartialOrd,
2269        Ord,
2270        Serialize,
2271        Deserialize
2272    )]
2273    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2274    pub struct RefreshDecisionWithReasonV1 {
2275        pub objects_needing_refresh: Vec<String>,
2276        pub rehydration_time_estimate: String,
2277        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2278        pub decision: Option<refresh_decision_with_reason_v1::Decision>,
2279    }
2280
2281    pub mod refresh_decision_with_reason_v1 {
2282        use super::*;
2283
2284        #[derive(
2285            Clone,
2286            Copy,
2287            Debug,
2288            PartialEq,
2289            Eq,
2290            PartialOrd,
2291            Ord,
2292            Serialize,
2293            Deserialize
2294        )]
2295        #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2296        pub enum Decision {
2297            On(Empty),
2298            Off(Empty),
2299        }
2300    }
2301
2302    #[derive(
2303        Clone,
2304        Debug,
2305        Default,
2306        PartialEq,
2307        Eq,
2308        PartialOrd,
2309        Ord,
2310        Serialize,
2311        Deserialize
2312    )]
2313    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2314    pub struct RefreshDecisionWithReasonV2 {
2315        pub objects_needing_refresh: Vec<String>,
2316        pub objects_needing_compaction: Vec<String>,
2317        pub rehydration_time_estimate: String,
2318        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2319        pub decision: Option<refresh_decision_with_reason_v2::Decision>,
2320    }
2321
2322    pub mod refresh_decision_with_reason_v2 {
2323        use super::*;
2324
2325        #[derive(
2326            Clone,
2327            Copy,
2328            Debug,
2329            PartialEq,
2330            Eq,
2331            PartialOrd,
2332            Ord,
2333            Serialize,
2334            Deserialize
2335        )]
2336        #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2337        pub enum Decision {
2338            On(Empty),
2339            Off(Empty),
2340        }
2341    }
2342
2343    #[derive(
2344        Clone,
2345        Debug,
2346        Default,
2347        PartialEq,
2348        Eq,
2349        PartialOrd,
2350        Ord,
2351        Serialize,
2352        Deserialize
2353    )]
2354    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2355    pub struct CreateSourceSinkV1 {
2356        pub id: String,
2357        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2358        pub name: Option<FullNameV1>,
2359        pub size: Option<StringWrapper>,
2360    }
2361
2362    #[derive(
2363        Clone,
2364        Debug,
2365        Default,
2366        PartialEq,
2367        Eq,
2368        PartialOrd,
2369        Ord,
2370        Serialize,
2371        Deserialize
2372    )]
2373    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2374    pub struct CreateSourceSinkV2 {
2375        pub id: String,
2376        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2377        pub name: Option<FullNameV1>,
2378        pub size: Option<StringWrapper>,
2379        pub external_type: String,
2380    }
2381
2382    #[derive(
2383        Clone,
2384        Debug,
2385        Default,
2386        PartialEq,
2387        Eq,
2388        PartialOrd,
2389        Ord,
2390        Serialize,
2391        Deserialize
2392    )]
2393    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2394    pub struct CreateSourceSinkV3 {
2395        pub id: String,
2396        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2397        pub name: Option<FullNameV1>,
2398        pub external_type: String,
2399    }
2400
2401    #[derive(
2402        Clone,
2403        Debug,
2404        Default,
2405        PartialEq,
2406        Eq,
2407        PartialOrd,
2408        Ord,
2409        Serialize,
2410        Deserialize
2411    )]
2412    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2413    pub struct CreateSourceSinkV4 {
2414        pub id: String,
2415        pub cluster_id: Option<StringWrapper>,
2416        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2417        pub name: Option<FullNameV1>,
2418        pub external_type: String,
2419    }
2420
2421    #[derive(
2422        Clone,
2423        Debug,
2424        Default,
2425        PartialEq,
2426        Eq,
2427        PartialOrd,
2428        Ord,
2429        Serialize,
2430        Deserialize
2431    )]
2432    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2433    pub struct CreateIndexV1 {
2434        pub id: String,
2435        pub cluster_id: String,
2436        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2437        pub name: Option<FullNameV1>,
2438    }
2439
2440    #[derive(
2441        Clone,
2442        Debug,
2443        Default,
2444        PartialEq,
2445        Eq,
2446        PartialOrd,
2447        Ord,
2448        Serialize,
2449        Deserialize
2450    )]
2451    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2452    pub struct CreateMaterializedViewV1 {
2453        pub id: String,
2454        pub cluster_id: String,
2455        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2456        pub name: Option<FullNameV1>,
2457    }
2458
2459    #[derive(
2460        Clone,
2461        Debug,
2462        Default,
2463        PartialEq,
2464        Eq,
2465        PartialOrd,
2466        Ord,
2467        Serialize,
2468        Deserialize
2469    )]
2470    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2471    pub struct AlterSourceSinkV1 {
2472        pub id: String,
2473        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2474        pub name: Option<FullNameV1>,
2475        pub old_size: Option<StringWrapper>,
2476        pub new_size: Option<StringWrapper>,
2477    }
2478
2479    #[derive(
2480        Clone,
2481        Debug,
2482        Default,
2483        PartialEq,
2484        Eq,
2485        PartialOrd,
2486        Ord,
2487        Serialize,
2488        Deserialize
2489    )]
2490    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2491    pub struct AlterSetClusterV1 {
2492        pub id: String,
2493        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2494        pub name: Option<FullNameV1>,
2495        pub old_cluster: Option<StringWrapper>,
2496        pub new_cluster: Option<StringWrapper>,
2497    }
2498
2499    #[derive(
2500        Clone,
2501        Debug,
2502        Default,
2503        PartialEq,
2504        Eq,
2505        PartialOrd,
2506        Ord,
2507        Serialize,
2508        Deserialize
2509    )]
2510    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2511    pub struct GrantRoleV1 {
2512        pub role_id: String,
2513        pub member_id: String,
2514        pub grantor_id: String,
2515    }
2516
2517    #[derive(
2518        Clone,
2519        Debug,
2520        Default,
2521        PartialEq,
2522        Eq,
2523        PartialOrd,
2524        Ord,
2525        Serialize,
2526        Deserialize
2527    )]
2528    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2529    pub struct GrantRoleV2 {
2530        pub role_id: String,
2531        pub member_id: String,
2532        pub grantor_id: String,
2533        pub executed_by: String,
2534    }
2535
2536    #[derive(
2537        Clone,
2538        Debug,
2539        Default,
2540        PartialEq,
2541        Eq,
2542        PartialOrd,
2543        Ord,
2544        Serialize,
2545        Deserialize
2546    )]
2547    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2548    pub struct RevokeRoleV1 {
2549        pub role_id: String,
2550        pub member_id: String,
2551    }
2552
2553    #[derive(
2554        Clone,
2555        Debug,
2556        Default,
2557        PartialEq,
2558        Eq,
2559        PartialOrd,
2560        Ord,
2561        Serialize,
2562        Deserialize
2563    )]
2564    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2565    pub struct RevokeRoleV2 {
2566        pub role_id: String,
2567        pub member_id: String,
2568        pub grantor_id: String,
2569        pub executed_by: String,
2570    }
2571
2572    #[derive(
2573        Clone,
2574        Debug,
2575        Default,
2576        PartialEq,
2577        Eq,
2578        PartialOrd,
2579        Ord,
2580        Serialize,
2581        Deserialize
2582    )]
2583    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2584    pub struct UpdatePrivilegeV1 {
2585        pub object_id: String,
2586        pub grantee_id: String,
2587        pub grantor_id: String,
2588        pub privileges: String,
2589    }
2590
2591    #[derive(
2592        Clone,
2593        Debug,
2594        Default,
2595        PartialEq,
2596        Eq,
2597        PartialOrd,
2598        Ord,
2599        Serialize,
2600        Deserialize
2601    )]
2602    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2603    pub struct AlterDefaultPrivilegeV1 {
2604        pub role_id: String,
2605        pub database_id: Option<StringWrapper>,
2606        pub schema_id: Option<StringWrapper>,
2607        pub grantee_id: String,
2608        pub privileges: String,
2609    }
2610
2611    #[derive(
2612        Clone,
2613        Debug,
2614        Default,
2615        PartialEq,
2616        Eq,
2617        PartialOrd,
2618        Ord,
2619        Serialize,
2620        Deserialize
2621    )]
2622    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2623    pub struct UpdateOwnerV1 {
2624        pub object_id: String,
2625        pub old_owner_id: String,
2626        pub new_owner_id: String,
2627    }
2628
2629    #[derive(
2630        Clone,
2631        Debug,
2632        Default,
2633        PartialEq,
2634        Eq,
2635        PartialOrd,
2636        Ord,
2637        Serialize,
2638        Deserialize
2639    )]
2640    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2641    pub struct SchemaV1 {
2642        pub id: String,
2643        pub name: String,
2644        pub database_name: String,
2645    }
2646
2647    #[derive(
2648        Clone,
2649        Debug,
2650        Default,
2651        PartialEq,
2652        Eq,
2653        PartialOrd,
2654        Ord,
2655        Serialize,
2656        Deserialize
2657    )]
2658    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2659    pub struct SchemaV2 {
2660        pub id: String,
2661        pub name: String,
2662        pub database_name: Option<StringWrapper>,
2663    }
2664
2665    #[derive(
2666        Clone,
2667        Debug,
2668        Default,
2669        PartialEq,
2670        Eq,
2671        PartialOrd,
2672        Ord,
2673        Serialize,
2674        Deserialize
2675    )]
2676    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2677    pub struct RenameSchemaV1 {
2678        pub id: String,
2679        pub database_name: Option<String>,
2680        pub old_name: String,
2681        pub new_name: String,
2682    }
2683
2684    #[derive(
2685        Clone,
2686        Debug,
2687        Default,
2688        PartialEq,
2689        Eq,
2690        PartialOrd,
2691        Ord,
2692        Serialize,
2693        Deserialize
2694    )]
2695    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2696    pub struct UpdateItemV1 {
2697        pub id: String,
2698        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2699        pub name: Option<FullNameV1>,
2700    }
2701
2702    #[derive(
2703        Clone,
2704        Debug,
2705        Default,
2706        PartialEq,
2707        Eq,
2708        PartialOrd,
2709        Ord,
2710        Serialize,
2711        Deserialize
2712    )]
2713    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2714    pub struct AlterRetainHistoryV1 {
2715        pub id: String,
2716        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2717        pub old_history: Option<String>,
2718        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2719        pub new_history: Option<String>,
2720    }
2721
2722    #[derive(
2723        Clone,
2724        Debug,
2725        Default,
2726        PartialEq,
2727        Eq,
2728        PartialOrd,
2729        Ord,
2730        Serialize,
2731        Deserialize
2732    )]
2733    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2734    pub struct ToNewIdV1 {
2735        pub id: String,
2736        pub new_id: String,
2737    }
2738
2739    #[derive(
2740        Clone,
2741        Debug,
2742        Default,
2743        PartialEq,
2744        Eq,
2745        PartialOrd,
2746        Ord,
2747        Serialize,
2748        Deserialize
2749    )]
2750    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2751    pub struct FromPreviousIdV1 {
2752        pub id: String,
2753        pub previous_id: String,
2754    }
2755
2756    #[derive(
2757        Clone,
2758        Debug,
2759        Default,
2760        PartialEq,
2761        Eq,
2762        PartialOrd,
2763        Ord,
2764        Serialize,
2765        Deserialize
2766    )]
2767    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2768    pub struct SetV1 {
2769        pub name: String,
2770        pub value: Option<String>,
2771    }
2772
2773    #[derive(
2774        Clone,
2775        Debug,
2776        Default,
2777        PartialEq,
2778        Eq,
2779        PartialOrd,
2780        Ord,
2781        Serialize,
2782        Deserialize
2783    )]
2784    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2785    pub struct RotateKeysV1 {
2786        pub id: String,
2787        pub name: String,
2788    }
2789
2790    #[derive(
2791        Clone,
2792        Copy,
2793        Debug,
2794        PartialEq,
2795        Eq,
2796        Hash,
2797        PartialOrd,
2798        Ord,
2799        IntoPrimitive,
2800        TryFromPrimitive
2801    )]
2802    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2803    #[repr(i32)]
2804    pub enum EventType {
2805        Unknown = 0,
2806        Create = 1,
2807        Drop = 2,
2808        Alter = 3,
2809        Grant = 4,
2810        Revoke = 5,
2811        Comment = 6,
2812    }
2813
2814    #[derive(
2815        Clone,
2816        Copy,
2817        Debug,
2818        PartialEq,
2819        Eq,
2820        Hash,
2821        PartialOrd,
2822        Ord,
2823        IntoPrimitive,
2824        TryFromPrimitive
2825    )]
2826    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2827    #[repr(i32)]
2828    pub enum ObjectType {
2829        Unknown = 0,
2830        Cluster = 1,
2831        ClusterReplica = 2,
2832        Connection = 3,
2833        Database = 4,
2834        Func = 5,
2835        Index = 6,
2836        MaterializedView = 7,
2837        Role = 8,
2838        Secret = 9,
2839        Schema = 10,
2840        Sink = 11,
2841        Source = 12,
2842        Table = 13,
2843        Type = 14,
2844        View = 15,
2845        System = 16,
2846        ContinualTask = 17,
2847        NetworkPolicy = 18,
2848    }
2849
2850    #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
2851    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2852    pub enum Details {
2853        CreateClusterReplicaV1(CreateClusterReplicaV1),
2854        CreateClusterReplicaV2(CreateClusterReplicaV2),
2855        CreateClusterReplicaV3(CreateClusterReplicaV3),
2856        CreateClusterReplicaV4(CreateClusterReplicaV4),
2857        DropClusterReplicaV1(DropClusterReplicaV1),
2858        DropClusterReplicaV2(DropClusterReplicaV2),
2859        DropClusterReplicaV3(DropClusterReplicaV3),
2860        CreateSourceSinkV1(CreateSourceSinkV1),
2861        CreateSourceSinkV2(CreateSourceSinkV2),
2862        AlterSourceSinkV1(AlterSourceSinkV1),
2863        AlterSetClusterV1(AlterSetClusterV1),
2864        GrantRoleV1(GrantRoleV1),
2865        GrantRoleV2(GrantRoleV2),
2866        RevokeRoleV1(RevokeRoleV1),
2867        RevokeRoleV2(RevokeRoleV2),
2868        UpdatePrivilegeV1(UpdatePrivilegeV1),
2869        AlterDefaultPrivilegeV1(AlterDefaultPrivilegeV1),
2870        UpdateOwnerV1(UpdateOwnerV1),
2871        IdFullNameV1(IdFullNameV1),
2872        RenameClusterV1(RenameClusterV1),
2873        RenameClusterReplicaV1(RenameClusterReplicaV1),
2874        RenameItemV1(RenameItemV1),
2875        IdNameV1(IdNameV1),
2876        SchemaV1(SchemaV1),
2877        SchemaV2(SchemaV2),
2878        RenameSchemaV1(RenameSchemaV1),
2879        UpdateItemV1(UpdateItemV1),
2880        CreateSourceSinkV3(CreateSourceSinkV3),
2881        AlterRetainHistoryV1(AlterRetainHistoryV1),
2882        ToNewIdV1(ToNewIdV1),
2883        FromPreviousIdV1(FromPreviousIdV1),
2884        SetV1(SetV1),
2885        ResetAllV1(Empty),
2886        RotateKeysV1(RotateKeysV1),
2887        CreateSourceSinkV4(CreateSourceSinkV4),
2888        CreateIndexV1(CreateIndexV1),
2889        CreateMaterializedViewV1(CreateMaterializedViewV1),
2890    }
2891}
2892
2893#[derive(
2894    Clone,
2895    Debug,
2896    Default,
2897    PartialEq,
2898    Eq,
2899    PartialOrd,
2900    Ord,
2901    Serialize,
2902    Deserialize
2903)]
2904#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2905pub struct StateUpdateKind {
2906    pub kind: Option<state_update_kind::Kind>,
2907}
2908
2909pub mod state_update_kind {
2910    use super::*;
2911
2912    #[derive(
2913        Clone,
2914        Debug,
2915        Default,
2916        PartialEq,
2917        Eq,
2918        PartialOrd,
2919        Ord,
2920        Serialize,
2921        Deserialize
2922    )]
2923    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2924    pub struct AuditLog {
2925        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2926        pub key: Option<AuditLogKey>,
2927    }
2928
2929    #[derive(
2930        Clone,
2931        Debug,
2932        Default,
2933        PartialEq,
2934        Eq,
2935        PartialOrd,
2936        Ord,
2937        Serialize,
2938        Deserialize
2939    )]
2940    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2941    pub struct Cluster {
2942        pub key: Option<ClusterKey>,
2943        pub value: Option<ClusterValue>,
2944    }
2945
2946    #[derive(
2947        Clone,
2948        Debug,
2949        Default,
2950        PartialEq,
2951        Eq,
2952        PartialOrd,
2953        Ord,
2954        Serialize,
2955        Deserialize
2956    )]
2957    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2958    pub struct ClusterReplica {
2959        pub key: Option<ClusterReplicaKey>,
2960        pub value: Option<ClusterReplicaValue>,
2961    }
2962
2963    #[derive(
2964        Clone,
2965        Debug,
2966        Default,
2967        PartialEq,
2968        Eq,
2969        PartialOrd,
2970        Ord,
2971        Serialize,
2972        Deserialize
2973    )]
2974    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2975    pub struct Comment {
2976        pub key: Option<CommentKey>,
2977        pub value: Option<CommentValue>,
2978    }
2979
2980    #[derive(
2981        Clone,
2982        Debug,
2983        Default,
2984        PartialEq,
2985        Eq,
2986        PartialOrd,
2987        Ord,
2988        Serialize,
2989        Deserialize
2990    )]
2991    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
2992    pub struct Config {
2993        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2994        pub key: Option<ConfigKey>,
2995        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
2996        pub value: Option<ConfigValue>,
2997    }
2998
2999    #[derive(
3000        Clone,
3001        Debug,
3002        Default,
3003        PartialEq,
3004        Eq,
3005        PartialOrd,
3006        Ord,
3007        Serialize,
3008        Deserialize
3009    )]
3010    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3011    pub struct Database {
3012        pub key: Option<DatabaseKey>,
3013        pub value: Option<DatabaseValue>,
3014    }
3015
3016    #[derive(
3017        Clone,
3018        Copy,
3019        Debug,
3020        Default,
3021        PartialEq,
3022        Eq,
3023        PartialOrd,
3024        Ord,
3025        Serialize,
3026        Deserialize
3027    )]
3028    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3029    pub struct DefaultPrivileges {
3030        pub key: Option<DefaultPrivilegesKey>,
3031        pub value: Option<DefaultPrivilegesValue>,
3032    }
3033
3034    #[derive(
3035        Clone,
3036        Copy,
3037        Debug,
3038        Default,
3039        PartialEq,
3040        Eq,
3041        PartialOrd,
3042        Ord,
3043        Serialize,
3044        Deserialize
3045    )]
3046    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3047    pub struct FenceToken {
3048        pub deploy_generation: u64,
3049        pub epoch: i64,
3050    }
3051
3052    #[derive(
3053        Clone,
3054        Debug,
3055        Default,
3056        PartialEq,
3057        Eq,
3058        PartialOrd,
3059        Ord,
3060        Serialize,
3061        Deserialize
3062    )]
3063    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3064    pub struct IdAlloc {
3065        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
3066        pub key: Option<IdAllocKey>,
3067        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
3068        pub value: Option<IdAllocValue>,
3069    }
3070
3071    #[derive(
3072        Clone,
3073        Debug,
3074        Default,
3075        PartialEq,
3076        Eq,
3077        PartialOrd,
3078        Ord,
3079        Serialize,
3080        Deserialize
3081    )]
3082    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3083    pub struct ClusterIntrospectionSourceIndex {
3084        pub key: Option<ClusterIntrospectionSourceIndexKey>,
3085        pub value: Option<ClusterIntrospectionSourceIndexValue>,
3086    }
3087
3088    #[derive(
3089        Clone,
3090        Debug,
3091        Default,
3092        PartialEq,
3093        Eq,
3094        PartialOrd,
3095        Ord,
3096        Serialize,
3097        Deserialize
3098    )]
3099    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3100    pub struct Item {
3101        pub key: Option<ItemKey>,
3102        pub value: Option<ItemValue>,
3103    }
3104
3105    #[derive(
3106        Clone,
3107        Debug,
3108        Default,
3109        PartialEq,
3110        Eq,
3111        PartialOrd,
3112        Ord,
3113        Serialize,
3114        Deserialize
3115    )]
3116    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3117    pub struct Role {
3118        pub key: Option<RoleKey>,
3119        pub value: Option<RoleValue>,
3120    }
3121
3122    #[derive(
3123        Clone,
3124        Debug,
3125        Default,
3126        PartialEq,
3127        Eq,
3128        PartialOrd,
3129        Ord,
3130        Serialize,
3131        Deserialize
3132    )]
3133    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3134    pub struct RoleAuth {
3135        pub key: Option<RoleAuthKey>,
3136        pub value: Option<RoleAuthValue>,
3137    }
3138
3139    #[derive(
3140        Clone,
3141        Debug,
3142        Default,
3143        PartialEq,
3144        Eq,
3145        PartialOrd,
3146        Ord,
3147        Serialize,
3148        Deserialize
3149    )]
3150    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3151    pub struct NetworkPolicy {
3152        pub key: Option<NetworkPolicyKey>,
3153        pub value: Option<NetworkPolicyValue>,
3154    }
3155
3156    #[derive(
3157        Clone,
3158        Debug,
3159        Default,
3160        PartialEq,
3161        Eq,
3162        PartialOrd,
3163        Ord,
3164        Serialize,
3165        Deserialize
3166    )]
3167    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3168    pub struct Schema {
3169        pub key: Option<SchemaKey>,
3170        pub value: Option<SchemaValue>,
3171    }
3172
3173    #[derive(
3174        Clone,
3175        Debug,
3176        Default,
3177        PartialEq,
3178        Eq,
3179        PartialOrd,
3180        Ord,
3181        Serialize,
3182        Deserialize
3183    )]
3184    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3185    pub struct Setting {
3186        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
3187        pub key: Option<SettingKey>,
3188        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
3189        pub value: Option<SettingValue>,
3190    }
3191
3192    #[derive(
3193        Clone,
3194        Debug,
3195        Default,
3196        PartialEq,
3197        Eq,
3198        PartialOrd,
3199        Ord,
3200        Serialize,
3201        Deserialize
3202    )]
3203    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3204    pub struct ServerConfiguration {
3205        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
3206        pub key: Option<ServerConfigurationKey>,
3207        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
3208        pub value: Option<ServerConfigurationValue>,
3209    }
3210
3211    #[derive(
3212        Clone,
3213        Debug,
3214        Default,
3215        PartialEq,
3216        Eq,
3217        PartialOrd,
3218        Ord,
3219        Serialize,
3220        Deserialize
3221    )]
3222    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3223    pub struct SourceReferences {
3224        pub key: Option<SourceReferencesKey>,
3225        pub value: Option<SourceReferencesValue>,
3226    }
3227
3228    #[derive(
3229        Clone,
3230        Debug,
3231        Default,
3232        PartialEq,
3233        Eq,
3234        PartialOrd,
3235        Ord,
3236        Serialize,
3237        Deserialize
3238    )]
3239    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3240    pub struct GidMapping {
3241        pub key: Option<GidMappingKey>,
3242        pub value: Option<GidMappingValue>,
3243    }
3244
3245    #[derive(
3246        Clone,
3247        Copy,
3248        Debug,
3249        Default,
3250        PartialEq,
3251        Eq,
3252        PartialOrd,
3253        Ord,
3254        Serialize,
3255        Deserialize
3256    )]
3257    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3258    pub struct SystemPrivileges {
3259        pub key: Option<SystemPrivilegesKey>,
3260        pub value: Option<SystemPrivilegesValue>,
3261    }
3262
3263    #[derive(
3264        Clone,
3265        Debug,
3266        Default,
3267        PartialEq,
3268        Eq,
3269        PartialOrd,
3270        Ord,
3271        Serialize,
3272        Deserialize
3273    )]
3274    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3275    pub struct StorageCollectionMetadata {
3276        pub key: Option<StorageCollectionMetadataKey>,
3277        pub value: Option<StorageCollectionMetadataValue>,
3278    }
3279
3280    #[derive(
3281        Clone,
3282        Debug,
3283        Default,
3284        PartialEq,
3285        Eq,
3286        PartialOrd,
3287        Ord,
3288        Serialize,
3289        Deserialize
3290    )]
3291    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3292    pub struct UnfinalizedShard {
3293        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
3294        pub key: Option<UnfinalizedShardKey>,
3295    }
3296
3297    #[derive(
3298        Clone,
3299        Debug,
3300        Default,
3301        PartialEq,
3302        Eq,
3303        PartialOrd,
3304        Ord,
3305        Serialize,
3306        Deserialize
3307    )]
3308    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3309    pub struct TxnWalShard {
3310        #[cfg_attr(any(test, feature = "proptest"), proptest(filter = "Option::is_some"))]
3311        pub value: Option<TxnWalShardValue>,
3312    }
3313
3314    #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
3315    #[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3316    // Serialize the top-level enum in the persist-backed catalog as internally tagged to set up
3317    // persist pushdown statistics for success.
3318    #[serde(tag = "kind")]
3319    pub enum Kind {
3320        AuditLog(AuditLog),
3321        Cluster(Cluster),
3322        ClusterReplica(ClusterReplica),
3323        Comment(Comment),
3324        Config(Config),
3325        Database(Database),
3326        DefaultPrivileges(DefaultPrivileges),
3327        IdAlloc(IdAlloc),
3328        ClusterIntrospectionSourceIndex(ClusterIntrospectionSourceIndex),
3329        Item(Item),
3330        Role(Role),
3331        Schema(Schema),
3332        Setting(Setting),
3333        ServerConfiguration(ServerConfiguration),
3334        GidMapping(GidMapping),
3335        SystemPrivileges(SystemPrivileges),
3336        StorageCollectionMetadata(StorageCollectionMetadata),
3337        UnfinalizedShard(UnfinalizedShard),
3338        TxnWalShard(TxnWalShard),
3339        SourceReferences(SourceReferences),
3340        FenceToken(FenceToken),
3341        NetworkPolicy(NetworkPolicy),
3342        RoleAuth(RoleAuth),
3343    }
3344}
3345
3346#[derive(
3347    Clone,
3348    Copy,
3349    Debug,
3350    PartialEq,
3351    Eq,
3352    Hash,
3353    PartialOrd,
3354    Ord,
3355    IntoPrimitive,
3356    TryFromPrimitive
3357)]
3358#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3359#[repr(i32)]
3360pub enum CatalogItemType {
3361    Unknown = 0,
3362    Table = 1,
3363    Source = 2,
3364    Sink = 3,
3365    View = 4,
3366    MaterializedView = 5,
3367    Index = 6,
3368    Type = 7,
3369    Func = 8,
3370    Secret = 9,
3371    Connection = 10,
3372    ContinualTask = 11,
3373}
3374
3375#[derive(
3376    Clone,
3377    Copy,
3378    Debug,
3379    PartialEq,
3380    Eq,
3381    Hash,
3382    PartialOrd,
3383    Ord,
3384    IntoPrimitive,
3385    TryFromPrimitive
3386)]
3387#[cfg_attr(any(test, feature = "proptest"), derive(Arbitrary))]
3388#[repr(i32)]
3389pub enum ObjectType {
3390    Unknown = 0,
3391    Table = 1,
3392    View = 2,
3393    MaterializedView = 3,
3394    Source = 4,
3395    Sink = 5,
3396    Index = 6,
3397    Type = 7,
3398    Role = 8,
3399    Cluster = 9,
3400    ClusterReplica = 10,
3401    Secret = 11,
3402    Connection = 12,
3403    Database = 13,
3404    Schema = 14,
3405    Func = 15,
3406    ContinualTask = 16,
3407    NetworkPolicy = 17,
3408}